/* Generated by Cython 0.9.6.9 on Wed Dec 19 12:49:24 2007 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#if PY_VERSION_HEX < 0x02050000
  typedef int Py_ssize_t;
  #define PY_SSIZE_T_MAX INT_MAX
  #define PY_SSIZE_T_MIN INT_MIN
  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
#endif
#ifndef WIN32
  #define __stdcall
  #define __cdecl
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#include "etree_defs.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
#include "stdarg.h"
#include "lxml-version.h"
#include "libxml/xmlversion.h"
#include "libxml/encoding.h"
#include "libxml/chvalid.h"
#include "libxml/hash.h"
#include "libxml/tree.h"
#include "libxml/HTMLtree.h"
#include "libxml/valid.h"
#include "libxml/xmlIO.h"
#include "libxml/xmlsave.h"
#include "libxml/globals.h"
#include "libxml/xmlstring.h"
#include "libxml/xmlmemory.h"
#include "pythread.h"
#include "libxml/xmlerror.h"
#include "libxml/xpath.h"
#include "libxml/xpathInternals.h"
#include "libxml/xinclude.h"
#include "libxml/c14n.h"
#include "libxml/parser.h"
#include "libxml/parserInternals.h"
#include "libxml/HTMLparser.h"
#include "libxslt/xslt.h"
#include "libxslt/xsltconfig.h"
#include "libxslt/xsltInternals.h"
#include "libxslt/extensions.h"
#include "libxslt/documents.h"
#include "libxslt/transform.h"
#include "libxslt/xsltutils.h"
#include "libxslt/security.h"
#include "libxslt/extra.h"
#include "libexslt/exslt.h"
#include "libxml/relaxng.h"
#include "libxml/xmlschemas.h"
#include "libxml/schematron.h"


#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE 
#endif

typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n; int is_unicode;} __Pyx_StringTabEntry; /*proto*/

static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if (x == Py_False) return 0;
   else return PyObject_IsTrue(x);
}



static int __pyx_skip_dispatch = 0;


#ifdef __GNUC__
/* Test for GCC > 2.95 */
#if __GNUC__ > 2 ||               (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)) 
#define likely(x)   __builtin_expect(!!(x), 1)
#define unlikely(x) __builtin_expect(!!(x), 0)
#else /* __GNUC__ > 2 ... */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ > 2 ... */
#else /* __GNUC__ */
#define likely(x)   (x)
#define unlikely(x) (x)
#endif /* __GNUC__ */
    
static PyObject *__pyx_m;
static PyObject *__pyx_b;
static int __pyx_lineno;
static char *__pyx_filename;
static char **__pyx_f;

static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[],     Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/

static int __Pyx_PrintItem(PyObject *); /*proto*/
static int __Pyx_PrintNewline(void); /*proto*/

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static void __Pyx_WriteUnraisable(char *name); /*proto*/

static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

static int __Pyx_ExportFunction(char *n, void *f, char *s); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name, long size);  /*proto*/

static PyObject *__Pyx_ImportModule(char *name); /*proto*/

static void __Pyx_AddTraceback(char *funcname); /*proto*/

static int __Pyx_RegisterCleanup(); /*proto*/
static PyObject* cleanup(PyObject *self, PyObject *unused); /*proto*/
static PyMethodDef cleanup_def = {"__cleanup", (PyCFunction)&cleanup, METH_NOARGS, 0};

/* Declarations from cstd */


/* Declarations from tree */


/* Declarations from __builtin__ */


/* Declarations from python */

static PyTypeObject *__pyx_ptype_6python_slice = 0;

/* Declarations from config */


/* Declarations from xmlerror */


/* Declarations from xpath */


/* Declarations from xinclude */


/* Declarations from c14n */


/* Declarations from xmlparser */


/* Declarations from htmlparser */


/* Declarations from xslt */


/* Declarations from dtdvalid */


/* Declarations from relaxng */


/* Declarations from xmlschema */


/* Declarations from schematron */


/* Declarations from lxml.etree */

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":177
 * 
 * # class for temporary storage of Python references
 * cdef class _TempStore:             # <<<<<<<<<<<<<< 
 *     cdef object _storage
 *     def __init__(self):
 */

struct __pyx_obj_4lxml_5etree__TempStore {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__TempStore *__pyx_vtab;
  PyObject *_storage;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":191
 * 
 * # class for temporarily storing exceptions raised in extensions
 * cdef class _ExceptionContext:             # <<<<<<<<<<<<<< 
 *     cdef object _exc_info
 *     cdef void clear(self):
 */

struct __pyx_obj_4lxml_5etree__ExceptionContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *__pyx_vtab;
  PyObject *_exc_info;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":216
 * 
 * 
 * cdef class QName:             # <<<<<<<<<<<<<< 
 *     """QName wrapper.
 * 
 */

struct __pyx_obj_4lxml_5etree_QName {
  PyObject_HEAD
  PyObject *text;
};

typedef xmlNode *(*_node_to_node_function)(xmlNode *);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":256
 * 
 * 
 * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<< 
 *     """Internal base class to reference a libxml document.
 * 
 */

struct LxmlDocument {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__Document *__pyx_vtab;
  int _ns_counter;
  PyObject *_prefix_tail;
  xmlDoc *_c_doc;
  struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":439
 * 
 * 
 * cdef class DocInfo:             # <<<<<<<<<<<<<< 
 *     "Document information provided by parser and DTD."
 *     cdef _Document _doc
 */

struct __pyx_obj_4lxml_5etree_DocInfo {
  PyObject_HEAD
  struct LxmlDocument *_doc;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":512
 * 
 * 
 * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<< 
 *     """Element class.  References a document object and a libxml node.
 * 
 */

struct LxmlElement {
  PyObject_HEAD
  PyObject *_gc_doc;
  struct LxmlDocument *_doc;
  xmlNode *_c_node;
  PyObject *_tag;
  PyObject *_attrib;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1249
 * 
 * 
 * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<< 
 *     cdef int _raiseImmutable(self) except -1:
 *         raise TypeError("this element does not have children or attributes")
 */

struct __pyx_obj_4lxml_5etree___ContentOnlyElement {
  struct LxmlElement __pyx_base;
  struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *__pyx_vtab;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1311
 *         return []
 * 
 * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_obj_4lxml_5etree__Comment {
  struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1319
 *         return "<!--%s-->" % self.text
 *     
 * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_obj_4lxml_5etree__ProcessingInstruction {
  struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1341
 *             return "<?%s?>" % self.target
 * 
 * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_obj_4lxml_5etree__Entity {
  struct __pyx_obj_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1360
 * 
 * 
 * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<< 
 *                                  object LxmlElementTree ]:
 *     cdef _Document _doc
 */

struct LxmlElementTree {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ElementTree *__pyx_vtab;
  struct LxmlDocument *_doc;
  struct LxmlElement *_context_node;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1670
 * 
 * 
 * cdef class _Attrib:             # <<<<<<<<<<<<<< 
 *     cdef _Element _element
 *     def __init__(self, _Element element not None):
 */

struct __pyx_obj_4lxml_5etree__Attrib {
  PyObject_HEAD
  struct LxmlElement *_element;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1794
 *         return python.PyObject_RichCompare(one, other, op)
 * 
 * cdef class _AttribIterator:             # <<<<<<<<<<<<<< 
 *     """Attribute iterator - for internal use only!
 *     """
 */

struct __pyx_obj_4lxml_5etree__AttribIterator {
  PyObject_HEAD
  struct LxmlElement *_node;
  xmlAttr *_c_attr;
  int _keysvalues;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1835
 * 
 * 
 * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<< 
 *                                        type LxmlElementTagMatcherType ]:
 *     cdef object _pystrings
 */

struct LxmlElementTagMatcher {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtab;
  PyObject *_pystrings;
  int _node_type;
  char *_href;
  char *_name;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1863
 *                 self._name = NULL
 * 
 * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<< 
 *     object LxmlElementIterator, type LxmlElementIteratorType ]:
 *     # we keep Python references here to control GC
 */

struct LxmlElementIterator {
  struct LxmlElementTagMatcher __pyx_base;
  struct LxmlElement *_node;
  _node_to_node_function _next_element;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1895
 *         return current_node
 * 
 * cdef class ElementChildIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):
 */

struct __pyx_obj_4lxml_5etree_ElementChildIterator {
  struct LxmlElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1916
 *             self._node = _elementFactory(node._doc, c_node)
 * 
 * cdef class SiblingsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     """Iterates over the siblings of an element.
 * 
 */

struct __pyx_obj_4lxml_5etree_SiblingsIterator {
  struct LxmlElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1929
 *         self._storeNext(node)
 * 
 * cdef class AncestorsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):
 */

struct __pyx_obj_4lxml_5etree_AncestorsIterator {
  struct LxmlElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1936
 *         self._storeNext(node)
 * 
 * cdef class ElementDepthFirstIterator(_ElementTagMatcher):             # <<<<<<<<<<<<<< 
 *     """Iterates over an element and its sub-elements in document order (depth
 *     first pre-order).  Note that this also includes comments, entities and
 */

struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator {
  struct LxmlElementTagMatcher __pyx_base;
  struct LxmlElement *_next_node;
  struct LxmlElement *_top_node;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2003
 *         return NULL
 * 
 * cdef class ElementTextIterator:             # <<<<<<<<<<<<<< 
 *     """Iterates over the text content of a subtree.
 * 
 */

struct __pyx_obj_4lxml_5etree_ElementTextIterator {
  PyObject_HEAD
  PyObject *_nextEvent;
  struct LxmlElement *_start_element;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":35
 * # Logging classes
 * 
 * cdef class _LogEntry:             # <<<<<<<<<<<<<< 
 *     cdef readonly object domain
 *     cdef readonly object type
 */

struct __pyx_obj_4lxml_5etree__LogEntry {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__LogEntry *__pyx_vtab;
  PyObject *domain;
  PyObject *type;
  PyObject *level;
  PyObject *line;
  PyObject *column;
  PyObject *message;
  PyObject *filename;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":87
 *             return ErrorLevels._getName(self.level, "unknown")
 * 
 * cdef class _BaseErrorLog:             # <<<<<<<<<<<<<< 
 *     cdef _LogEntry _first_error
 *     cdef readonly object last_error
 */

struct __pyx_obj_4lxml_5etree__BaseErrorLog {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *__pyx_vtab;
  struct __pyx_obj_4lxml_5etree__LogEntry *_first_error;
  PyObject *last_error;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":170
 *         return message
 * 
 * cdef class _ListErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     "Immutable base version of a list based error log."
 *     cdef object _entries
 */

struct __pyx_obj_4lxml_5etree__ListErrorLog {
  struct __pyx_obj_4lxml_5etree__BaseErrorLog __pyx_base;
  PyObject *_entries;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":274
 *         return self.filter_from_level(ErrorLevels.WARNING)
 * 
 * cdef class _ErrorLog(_ListErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)
 */

struct __pyx_obj_4lxml_5etree__ErrorLog {
  struct __pyx_obj_4lxml_5etree__ListErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":304
 *         python.PyList_Append(self._entries, entry)
 * 
 * cdef class _DomainErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)
 */

struct __pyx_obj_4lxml_5etree__DomainErrorLog {
  struct __pyx_obj_4lxml_5etree__ErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":313
 *             _ErrorLog.receive(self, entry)
 * 
 * cdef class _RotatingErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     cdef int _max_len
 *     def __init__(self, max_len):
 */

struct __pyx_obj_4lxml_5etree__RotatingErrorLog {
  struct __pyx_obj_4lxml_5etree__ErrorLog __pyx_base;
  int _max_len;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":325
 *         python.PyList_Append(entries, entry)
 * 
 * cdef class PyErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     """A global error log that connects to the Python stdlib logging package.
 * 
 */

struct __pyx_obj_4lxml_5etree_PyErrorLog {
  struct __pyx_obj_4lxml_5etree__BaseErrorLog __pyx_base;
  PyObject *level_map;
  PyObject *_map_level;
  PyObject *_log;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":6
 * # Custom Element classes
 * 
 * cdef public class ElementBase(_Element) [ type LxmlElementBaseType,             # <<<<<<<<<<<<<< 
 *                                           object LxmlElementBase ]:
 *     """All custom Element classes must inherit from this one.
 */

struct LxmlElementBase {
  struct LxmlElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":17
 *     """
 * 
 * cdef class CommentBase(_Comment):             # <<<<<<<<<<<<<< 
 *     """All custom Comment classes must inherit from this one.
 * 
 */

struct __pyx_obj_4lxml_5etree_CommentBase {
  struct __pyx_obj_4lxml_5etree__Comment __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":27
 *     """
 * 
 * cdef class PIBase(_ProcessingInstruction):             # <<<<<<<<<<<<<< 
 *     """All custom Processing Instruction classes must inherit from this one.
 * 
 */

struct __pyx_obj_4lxml_5etree_PIBase {
  struct __pyx_obj_4lxml_5etree__ProcessingInstruction __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":37
 *     """
 * 
 * cdef class EntityBase(_Entity):             # <<<<<<<<<<<<<< 
 *     """All custom Entity classes must inherit from this one.
 * 
 */

struct __pyx_obj_4lxml_5etree_EntityBase {
  struct __pyx_obj_4lxml_5etree__Entity __pyx_base;
};

typedef PyObject *(*_element_class_lookup_function)(PyObject *,struct LxmlDocument *,xmlNode *);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":54
 * 
 * # class to store element class lookup functions
 * cdef public class ElementClassLookup [ type LxmlElementClassLookupType,             # <<<<<<<<<<<<<< 
 *                                        object LxmlElementClassLookup ]:
 *     """Superclass of Element class lookups.
 */

struct LxmlElementClassLookup {
  PyObject_HEAD
  _element_class_lookup_function _lookup_function;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":62
 *         self._lookup_function = NULL # use default lookup
 * 
 * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<< 
 *          [ type LxmlFallbackElementClassLookupType,
 *            object LxmlFallbackElementClassLookup ]:
 */

struct LxmlFallbackElementClassLookup {
  struct LxmlElementClassLookup __pyx_base;
  struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtab;
  struct LxmlElementClassLookup *fallback;
  _element_class_lookup_function _fallback_function;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":91
 * # Custom Element class lookup schemes
 * 
 * cdef class ElementDefaultClassLookup(ElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup scheme that always returns the default Element
 *     class.
 */

struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup {
  struct LxmlElementClassLookup __pyx_base;
  PyObject *element_class;
  PyObject *comment_class;
  PyObject *pi_class;
  PyObject *entity_class;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":171
 *         assert 0, "Unknown node type: %s" % c_node.type
 * 
 * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Checks an attribute of an Element and looks up the value in a class
 *     dictionary.  
 */

struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
  PyObject *_class_mapping;
  PyObject *_pytag;
  char *_c_ns;
  char *_c_name;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":215
 * 
 * 
 * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on the XML parser.
 *     """
 */

struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":231
 * 
 * 
 * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on a subclass method.
 * 
 */

struct __pyx_obj_4lxml_5etree_CustomElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":14
 * 
 * 
 * cdef class _NamespaceRegistry:             # <<<<<<<<<<<<<< 
 *     "Dictionary-like namespace registry"
 *     cdef object _ns_uri
 */

struct __pyx_obj_4lxml_5etree__NamespaceRegistry {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *__pyx_vtab;
  PyObject *_ns_uri;
  PyObject *_ns_uri_utf;
  PyObject *_entries;
  char *_c_ns_uri_utf;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":77
 *         python.PyDict_Clear(self._entries)
 * 
 * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):
 */

struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry {
  struct __pyx_obj_4lxml_5etree__NamespaceRegistry __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":91
 * 
 * 
 * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup scheme that searches the Element class in the
 *     Namespace registry.
 */

struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
  PyObject *_namespace_registries;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":173
 *         return registry
 * 
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     def __setitem__(self, name, item):
 *         if not callable(item):
 */

struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry {
  struct __pyx_obj_4lxml_5etree__NamespaceRegistry __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":186
 *         return "FunctionNamespace(%r)" % self._ns_uri
 * 
 * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     cdef object _prefix
 *     cdef object _prefix_utf
 */

struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry {
  struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry __pyx_base;
  PyObject *_prefix;
  PyObject *_prefix_utf;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":3
 * # Custom resolver API
 * 
 * ctypedef enum _InputDocumentDataType:             # <<<<<<<<<<<<<< 
 *     PARSER_DATA_EMPTY
 *     PARSER_DATA_STRING
 */

typedef enum {
  __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY,
  __pyx_e_4lxml_5etree_PARSER_DATA_STRING,
  __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME,
  __pyx_e_4lxml_5etree_PARSER_DATA_FILE
} __pyx_t_4lxml_5etree__InputDocumentDataType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":9
 *     PARSER_DATA_FILE
 * 
 * cdef class _InputDocument:             # <<<<<<<<<<<<<< 
 *     cdef _InputDocumentDataType _type
 *     cdef object _data_bytes
 */

struct __pyx_obj_4lxml_5etree__InputDocument {
  PyObject_HEAD
  __pyx_t_4lxml_5etree__InputDocumentDataType _type;
  PyObject *_data_bytes;
  PyObject *_filename;
  PyObject *_file;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":15
 *     cdef object _file
 * 
 * cdef class Resolver:             # <<<<<<<<<<<<<< 
 *     "This is the base class of all resolvers."
 *     def resolve(self, system_url, public_id, context):
 */

struct __pyx_obj_4lxml_5etree_Resolver {
  PyObject_HEAD
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":78
 *         return doc_ref
 * 
 * cdef class _ResolverRegistry:             # <<<<<<<<<<<<<< 
 *     cdef object _resolvers
 *     cdef Resolver _default_resolver
 */

struct __pyx_obj_4lxml_5etree__ResolverRegistry {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *__pyx_vtab;
  PyObject *_resolvers;
  struct __pyx_obj_4lxml_5etree_Resolver *_default_resolver;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":120
 *         return repr(self._resolvers)
 * 
 * cdef class _ResolverContext(_ExceptionContext):             # <<<<<<<<<<<<<< 
 *     cdef _ResolverRegistry _resolvers
 *     cdef _TempStore _storage
 */

struct __pyx_obj_4lxml_5etree__ResolverContext {
  struct __pyx_obj_4lxml_5etree__ExceptionContext __pyx_base;
  struct __pyx_obj_4lxml_5etree__ResolverRegistry *_resolvers;
  struct __pyx_obj_4lxml_5etree__TempStore *_storage;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":26
 *     pass
 * 
 * cdef class _ParserDictionaryContext:             # <<<<<<<<<<<<<< 
 *     # Global parser context to share the string dictionary.
 *     #
 */

struct __pyx_obj_4lxml_5etree__ParserDictionaryContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *__pyx_vtab;
  xmlDict *_c_dict;
  struct __pyx_obj_4lxml_5etree__BaseParser *_default_parser;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":205
 * ############################################################
 * 
 * cdef class _FileReaderContext:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef object _encoding
 */

struct __pyx_obj_4lxml_5etree__FileReaderContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *__pyx_vtab;
  PyObject *_filelike;
  PyObject *_encoding;
  PyObject *_url;
  PyObject *_bytes;
  struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc_context;
  size_t _bytes_read;
  char *_c_url;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":375
 * ############################################################
 * 
 * cdef class _ParserContext(_ResolverContext)             # <<<<<<<<<<<<<< 
 * cdef class _SaxParserContext(_ParserContext)
 * cdef class _TargetParserContext(_SaxParserContext)
 */

struct __pyx_obj_4lxml_5etree__ParserContext {
  struct __pyx_obj_4lxml_5etree__ResolverContext __pyx_base;
  struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
  xmlParserCtxt *_c_ctxt;
  PyThread_type_lock _lock;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":251
 * 
 * # forward declaration of _BaseParser, see parser.pxi
 * cdef class _BaseParser             # <<<<<<<<<<<<<< 
 * 
 * ctypedef public xmlNode* (*_node_to_node_function)(xmlNode*)
 */

struct __pyx_obj_4lxml_5etree__BaseParser {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__BaseParser *__pyx_vtab;
  struct LxmlElementClassLookup *_class_lookup;
  struct __pyx_obj_4lxml_5etree__ResolverRegistry *_resolvers;
  struct __pyx_obj_4lxml_5etree__ParserContext *_parser_context;
  struct __pyx_obj_4lxml_5etree__ParserContext *_push_parser_context;
  int _parse_options;
  int _for_html;
  int _remove_comments;
  int _remove_pis;
  PyObject *_filename;
  PyObject *_target;
  PyObject *_default_encoding;
  int _default_encoding_int;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":830
 * ############################################################
 * 
 * cdef class _FeedParser(_BaseParser):             # <<<<<<<<<<<<<< 
 *     cdef bint _feed_parser_running
 * 
 */

struct __pyx_obj_4lxml_5etree__FeedParser {
  struct __pyx_obj_4lxml_5etree__BaseParser __pyx_base;
  int _feed_parser_running;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":988
 * ############################################################
 * 
 * ctypedef enum _SaxParserEvents:             # <<<<<<<<<<<<<< 
 *     SAX_EVENT_START   =  1
 *     SAX_EVENT_END     =  2
 */

typedef enum {
  __pyx_e_4lxml_5etree_SAX_EVENT_START = 1,
  __pyx_e_4lxml_5etree_SAX_EVENT_END = 2,
  __pyx_e_4lxml_5etree_SAX_EVENT_DATA = 4,
  __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE = 8,
  __pyx_e_4lxml_5etree_SAX_EVENT_PI = 16,
  __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT = 32
} __pyx_t_4lxml_5etree__SaxParserEvents;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":996
 *     SAX_EVENT_COMMENT = 32
 * 
 * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<< 
 *     cdef int _sax_event_filter
 *     cdef int _sax_event_propagate
 */

struct __pyx_obj_4lxml_5etree__SaxParserTarget {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *__pyx_vtab;
  int _sax_event_filter;
  int _sax_event_propagate;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":376
 * 
 * cdef class _ParserContext(_ResolverContext)
 * cdef class _SaxParserContext(_ParserContext)             # <<<<<<<<<<<<<< 
 * cdef class _TargetParserContext(_SaxParserContext)
 * 
 */

struct __pyx_obj_4lxml_5etree__SaxParserContext {
  struct __pyx_obj_4lxml_5etree__ParserContext __pyx_base;
  struct __pyx_obj_4lxml_5etree__SaxParserTarget *_target;
  startElementNsSAX2Func _origSaxStart;
  endElementNsSAX2Func _origSaxEnd;
  startElementSAXFunc _origSaxStartNoNs;
  endElementSAXFunc _origSaxEndNoNs;
  charactersSAXFunc _origSaxData;
  internalSubsetSAXFunc _origSaxDoctype;
  commentSAXFunc _origSaxComment;
  processingInstructionSAXFunc _origSaxPi;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1286
 * ############################################################
 * 
 * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     """Parser target that builds a tree.
 * 
 */

struct __pyx_obj_4lxml_5etree_TreeBuilder {
  struct __pyx_obj_4lxml_5etree__SaxParserTarget __pyx_base;
  struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
  PyObject *_factory;
  PyObject *_data;
  PyObject *_element_stack;
  PyObject *_element_stack_pop;
  struct LxmlElement *_last;
  int _in_tail;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1415
 *     )
 * 
 * cdef class XMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The XML parser.  Parsers can be supplied as additional argument to
 *     various parse functions of the lxml API.  A default parser is always
 */

struct __pyx_obj_4lxml_5etree_XMLParser {
  struct __pyx_obj_4lxml_5etree__FeedParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1479
 *                              target, None, encoding)
 * 
 * cdef class ETCompatXMLParser(XMLParser):             # <<<<<<<<<<<<<< 
 *     """An XML parser with an ElementTree compatible default setup.  See the
 *     XMLParser class for details.
 */

struct __pyx_obj_4lxml_5etree_ETCompatXMLParser {
  struct __pyx_obj_4lxml_5etree_XMLParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1548
 *     )
 * 
 * cdef class HTMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The HTML parser.  This parser allows reading HTML into a normal XML
 *     tree.  By default, it can read broken (non well-formed) HTML, depending on
 */

struct __pyx_obj_4lxml_5etree_HTMLParser {
  struct __pyx_obj_4lxml_5etree__FeedParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":13
 *         self.result = result
 * 
 * cdef class _PythonSaxParserTarget(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     cdef object _target_start
 *     cdef object _target_end
 */

struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget {
  struct __pyx_obj_4lxml_5etree__SaxParserTarget __pyx_base;
  PyObject *_target_start;
  PyObject *_target_end;
  PyObject *_target_data;
  PyObject *_target_doctype;
  PyObject *_target_pi;
  PyObject *_target_comment;
  int _start_takes_nsmap;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":377
 * cdef class _ParserContext(_ResolverContext)
 * cdef class _SaxParserContext(_ParserContext)
 * cdef class _TargetParserContext(_SaxParserContext)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ParserContext(_ResolverContext):
 */

struct __pyx_obj_4lxml_5etree__TargetParserContext {
  struct __pyx_obj_4lxml_5etree__SaxParserContext __pyx_base;
  PyObject *_python_target;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":3
 * # XML serialization and output functions
 * 
 * cdef enum _OutputMethods:             # <<<<<<<<<<<<<< 
 *     OUTPUT_METHOD_XML
 *     OUTPUT_METHOD_HTML
 */

enum __pyx_t_4lxml_5etree__OutputMethods {
  __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML,
  __pyx_e_4lxml_5etree_OUTPUT_METHOD_HTML,
  __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":269
 * # output to file-like objects
 * 
 * cdef class _FilelikeWriter:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef _ExceptionContext _exc_context
 */

struct __pyx_obj_4lxml_5etree__FilelikeWriter {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *__pyx_vtab;
  PyObject *_filelike;
  struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc_context;
  struct __pyx_obj_4lxml_5etree__ErrorLog *error_log;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":6
 * __ITERPARSE_CHUNK_SIZE = 32768
 * 
 * ctypedef enum _IterparseEventFilter:             # <<<<<<<<<<<<<< 
 *     ITERPARSE_FILTER_START     = 1
 *     ITERPARSE_FILTER_END       = 2
 */

typedef enum {
  __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START = 1,
  __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END = 2,
  __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS = 4,
  __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS = 8
} __pyx_t_4lxml_5etree__IterparseEventFilter;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":51
 *     return count
 * 
 * cdef class _IterparseContext(_ParserContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlparser.startElementNsSAX2Func _origSaxStart
 *     cdef xmlparser.endElementNsSAX2Func   _origSaxEnd
 */

struct __pyx_obj_4lxml_5etree__IterparseContext {
  struct __pyx_obj_4lxml_5etree__ParserContext __pyx_base;
  startElementNsSAX2Func _origSaxStart;
  endElementNsSAX2Func _origSaxEnd;
  startElementSAXFunc _origSaxStartNoNs;
  endElementSAXFunc _origSaxEndNoNs;
  struct LxmlElement *_root;
  struct LxmlDocument *_doc;
  int _event_filter;
  PyObject *_events;
  int _event_index;
  PyObject *_ns_stack;
  PyObject *_pop_ns;
  PyObject *_node_stack;
  PyObject *_pop_node;
  PyObject *_tag_tuple;
  char *_tag_href;
  char *_tag_name;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":241
 *     origEnd(ctxt, name)
 * 
 * cdef class iterparse(_BaseParser):             # <<<<<<<<<<<<<< 
 *     """Incremental parser.  Parses XML into a tree and generates tuples
 *     (event, element) in a SAX-like fashion. ``event`` is any of 'start',
 */

struct __pyx_obj_4lxml_5etree_iterparse {
  struct __pyx_obj_4lxml_5etree__BaseParser __pyx_base;
  PyObject *_source;
  PyObject *root;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":398
 * 
 * 
 * cdef class iterwalk:             # <<<<<<<<<<<<<< 
 *     """A tree walker that generates events from an existing tree as if it was
 *     parsing XML data with ``iterparse()``.
 */

struct __pyx_obj_4lxml_5etree_iterwalk {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree_iterwalk *__pyx_vtab;
  PyObject *_node_stack;
  PyObject *_pop_node;
  int _index;
  PyObject *_events;
  PyObject *_pop_event;
  int _event_filter;
  PyObject *_tag_tuple;
  char *_tag_href;
  char *_tag_name;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":51
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))
 * 
 * cdef class _IDDict:             # <<<<<<<<<<<<<< 
 *     """A dictionary-like proxy class that mapps ID attributes to elements.
 * 
 */

struct __pyx_obj_4lxml_5etree__IDDict {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__IDDict *__pyx_vtab;
  struct LxmlDocument *_doc;
  PyObject *_keys;
  PyObject *_items;
};

typedef int (*__pyx_t_4lxml_5etree__register_function)(void *,PyObject *,PyObject *);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":31
 * # Base class for XSLT and XPath evaluation contexts: functions, namespaces, ...
 * 
 * cdef class _BaseContext:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _Document _doc
 */

struct __pyx_obj_4lxml_5etree__BaseContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__BaseContext *__pyx_vtab;
  xmlXPathContext *_xpathCtxt;
  struct LxmlDocument *_doc;
  PyObject *_extensions;
  PyObject *_namespaces;
  PyObject *_global_namespaces;
  PyObject *_utf_refs;
  PyObject *_function_cache;
  PyObject *_eval_context_dict;
  struct __pyx_obj_4lxml_5etree__TempStore *_temp_refs;
  struct __pyx_obj_4lxml_5etree__ExceptionContext *_exc;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":26
 * 
 * ctypedef int (*_register_function)(void* ctxt, name_utf, ns_uri_utf)
 * cdef class _ExsltRegExp             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */

struct __pyx_obj_4lxml_5etree__ExsltRegExp {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *__pyx_vtab;
  PyObject *_compile_map;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":50
 * 
 * 
 * cdef class _XPathContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef object _variables
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 */

struct __pyx_obj_4lxml_5etree__XPathContext {
  struct __pyx_obj_4lxml_5etree__BaseContext __pyx_base;
  PyObject *_variables;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":100
 *     _XPATH_VERSION_WARNING_REQUIRED = 0
 * 
 * cdef class _XPathEvaluatorBase:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _XPathContext _context
 */

struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *__pyx_vtab;
  xmlXPathContext *_xpathCtxt;
  struct __pyx_obj_4lxml_5etree__XPathContext *_context;
  PyThread_type_lock _eval_lock;
  struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":207
 * 
 * 
 * cdef class XPathElementEvaluator(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an element.
 * 
 */

struct __pyx_obj_4lxml_5etree_XPathElementEvaluator {
  struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase __pyx_base;
  struct LxmlElement *_element;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":276
 * 
 * 
 * cdef class XPathDocumentEvaluator(XPathElementEvaluator):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an ElementTree.
 * 
 */

struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator {
  struct __pyx_obj_4lxml_5etree_XPathElementEvaluator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":347
 * 
 * 
 * cdef class XPath(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """A compiled XPath expression that can be called on Elements and
 *     ElementTrees.
 */

struct __pyx_obj_4lxml_5etree_XPath {
  struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase __pyx_base;
  xmlXPathCompExpr *_xpath;
  PyObject *path;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":414
 * _find_namespaces = re.compile('({[^}]+})').findall
 * 
 * cdef class ETXPath(XPath):             # <<<<<<<<<<<<<< 
 *     """Special XPath class that supports the ElementTree {uri} notation for
 *     namespaces.
 */

struct __pyx_obj_4lxml_5etree_ETXPath {
  struct __pyx_obj_4lxml_5etree_XPath __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":50
 * # XSLT document loaders
 * 
 * cdef class _XSLTResolverContext(_ResolverContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* _c_style_doc
 *     cdef _BaseParser _parser
 */

struct __pyx_obj_4lxml_5etree__XSLTResolverContext {
  struct __pyx_obj_4lxml_5etree__ResolverContext __pyx_base;
  xmlDoc *_c_style_doc;
  struct __pyx_obj_4lxml_5etree__BaseParser *_parser;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":169
 * # XSLT file/network access control
 * 
 * cdef class XSLTAccessControl:             # <<<<<<<<<<<<<< 
 *     """Access control for XSLT: reading/writing files, directories and network
 *     I/O.  Access to a type of resource is granted or denied by passing any of
 */

struct __pyx_obj_4lxml_5etree_XSLTAccessControl {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *__pyx_vtab;
  xsltSecurityPrefs *_prefs;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":226
 * 
 * 
 * cdef class _XSLTContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef xslt.xsltTransformContext* _xsltCtxt
 *     def __init__(self, namespaces, extensions, enable_regexp):
 */

struct __pyx_obj_4lxml_5etree__XSLTContext {
  struct __pyx_obj_4lxml_5etree__BaseContext __pyx_base;
  xsltTransformContext *_xsltCtxt;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":254
 * 
 * 
 * cdef class XSLT:             # <<<<<<<<<<<<<< 
 *     """Turn a document into an XSLT object.
 * 
 */

struct __pyx_obj_4lxml_5etree_XSLT {
  PyObject_HEAD
  struct __pyx_vtabstruct_4lxml_5etree_XSLT *__pyx_vtab;
  struct __pyx_obj_4lxml_5etree__XSLTContext *_context;
  xsltStylesheet *_c_style;
  struct __pyx_obj_4lxml_5etree__XSLTResolverContext *_xslt_resolver_context;
  struct __pyx_obj_4lxml_5etree_XSLTAccessControl *_access_control;
  struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":494
 *     cdef XSLT NEW_XSLT "PY_NEW" (object t)
 * 
 * cdef class _XSLTResultTree(_ElementTree):             # <<<<<<<<<<<<<< 
 *     cdef XSLT _xslt
 *     cdef _Document _profile
 */

struct __pyx_obj_4lxml_5etree__XSLTResultTree {
  struct LxmlElementTree __pyx_base;
  struct __pyx_obj_4lxml_5etree_XSLT *_xslt;
  struct LxmlDocument *_profile;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":601
 *     return __findStylesheetByID(doc, id=id)
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):             # <<<<<<<<<<<<<< 
 *     def parseXSL(self, parser=None):
 *         """Try to parse the stylesheet referenced by this PI and return an
 */

struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction {
  struct __pyx_obj_4lxml_5etree_PIBase __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2340
 *     pass
 * 
 * cdef class _Validator:             # <<<<<<<<<<<<<< 
 *     "Base class for XML validators."
 *     cdef _ErrorLog _error_log
 */

struct __pyx_obj_4lxml_5etree__Validator {
  PyObject_HEAD
  struct __pyx_obj_4lxml_5etree__ErrorLog *_error_log;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":22
 * # DTD
 * 
 * cdef class DTD(_Validator):             # <<<<<<<<<<<<<< 
 *     """A DTD validator.
 * 
 */

struct __pyx_obj_4lxml_5etree_DTD {
  struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
  xmlDtd *_c_dtd;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":22
 * # RelaxNG
 * 
 * cdef class RelaxNG(_Validator):             # <<<<<<<<<<<<<< 
 *     """Turn a document into a Relax NG validator.
 *     Can also load from filesystem directly given file object or filename.
 */

struct __pyx_obj_4lxml_5etree_RelaxNG {
  struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
  xmlRelaxNG *_c_schema;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":22
 * # XMLSchema
 * 
 * cdef class XMLSchema(_Validator):             # <<<<<<<<<<<<<< 
 *     """Turn a document into an XML Schema validator.
 *     """
 */

struct __pyx_obj_4lxml_5etree_XMLSchema {
  struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
  xmlSchema *_c_schema;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":68
 * # Schematron
 * 
 * cdef class Schematron(_Validator):             # <<<<<<<<<<<<<< 
 *     """A Schematron validator.
 * 
 */

struct __pyx_obj_4lxml_5etree_Schematron {
  struct __pyx_obj_4lxml_5etree__Validator __pyx_base;
  xmlSchematron *_c_schema;
};


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":177
 * 
 * # class for temporary storage of Python references
 * cdef class _TempStore:             # <<<<<<<<<<<<<< 
 *     cdef object _storage
 *     def __init__(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__TempStore {
  int (*add)(struct __pyx_obj_4lxml_5etree__TempStore *,PyObject *);
  int (*clear)(struct __pyx_obj_4lxml_5etree__TempStore *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":177
 * 
 * # class for temporary storage of Python references
 * cdef class _TempStore:             # <<<<<<<<<<<<<< 
 *     cdef object _storage
 *     def __init__(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__TempStore *__pyx_vtabptr_4lxml_5etree__TempStore;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":191
 * 
 * # class for temporarily storing exceptions raised in extensions
 * cdef class _ExceptionContext:             # <<<<<<<<<<<<<< 
 *     cdef object _exc_info
 *     cdef void clear(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext {
  void (*clear)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
  void (*_store_raised)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
  void (*_store_exception)(struct __pyx_obj_4lxml_5etree__ExceptionContext *,PyObject *);
  int (*_has_raised)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
  int (*_raise_if_stored)(struct __pyx_obj_4lxml_5etree__ExceptionContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":191
 * 
 * # class for temporarily storing exceptions raised in extensions
 * cdef class _ExceptionContext:             # <<<<<<<<<<<<<< 
 *     cdef object _exc_info
 *     cdef void clear(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *__pyx_vtabptr_4lxml_5etree__ExceptionContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":216
 * 
 * 
 * cdef class QName:             # <<<<<<<<<<<<<< 
 *     """QName wrapper.
 * 
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":529
 * 
 * 
 * cdef class _BaseParser:             # <<<<<<<<<<<<<< 
 *     cdef ElementClassLookup _class_lookup
 *     cdef _ResolverRegistry _resolvers
 */

struct __pyx_vtabstruct_4lxml_5etree__BaseParser {
  struct __pyx_obj_4lxml_5etree__ParserContext *(*_getParserContext)(struct __pyx_obj_4lxml_5etree__BaseParser *);
  struct __pyx_obj_4lxml_5etree__ParserContext *(*_getPushParserContext)(struct __pyx_obj_4lxml_5etree__BaseParser *);
  struct __pyx_obj_4lxml_5etree__ParserContext *(*_createContext)(struct __pyx_obj_4lxml_5etree__BaseParser *,PyObject *);
  xmlParserCtxt *(*_newParserCtxt)(struct __pyx_obj_4lxml_5etree__BaseParser *);
  xmlParserCtxt *(*_newPushParserCtxt)(struct __pyx_obj_4lxml_5etree__BaseParser *);
  struct __pyx_obj_4lxml_5etree__BaseParser *(*_copy)(struct __pyx_obj_4lxml_5etree__BaseParser *);
  xmlDoc *(*_parseUnicodeDoc)(struct __pyx_obj_4lxml_5etree__BaseParser *,PyObject *,char *);
  xmlDoc *(*_parseDoc)(struct __pyx_obj_4lxml_5etree__BaseParser *,char *,Py_ssize_t,char *);
  xmlDoc *(*_parseDocFromFile)(struct __pyx_obj_4lxml_5etree__BaseParser *,char *);
  xmlDoc *(*_parseDocFromFilelike)(struct __pyx_obj_4lxml_5etree__BaseParser *,PyObject *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":529
 * 
 * 
 * cdef class _BaseParser:             # <<<<<<<<<<<<<< 
 *     cdef ElementClassLookup _class_lookup
 *     cdef _ResolverRegistry _resolvers
 */
static struct __pyx_vtabstruct_4lxml_5etree__BaseParser *__pyx_vtabptr_4lxml_5etree__BaseParser;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":256
 * 
 * 
 * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<< 
 *     """Internal base class to reference a libxml document.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree__Document {
  PyObject *(*getroot)(struct LxmlDocument *);
  PyObject *(*getdoctype)(struct LxmlDocument *);
  PyObject *(*getxmlinfo)(struct LxmlDocument *);
  PyObject *(*getURL)(struct LxmlDocument *);
  PyObject *(*buildNewPrefix)(struct LxmlDocument *);
  xmlNs *(*_findOrBuildNodeNs)(struct LxmlDocument *,xmlNode *,char *,char *);
  int (*_setNodeNs)(struct LxmlDocument *,xmlNode *,char *);
  int (*_setNodeNamespaces)(struct LxmlDocument *,xmlNode *,PyObject *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":256
 * 
 * 
 * cdef public class _Document [ type LxmlDocumentType, object LxmlDocument ]:             # <<<<<<<<<<<<<< 
 *     """Internal base class to reference a libxml document.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree__Document *__pyx_vtabptr_4lxml_5etree__Document;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":439
 * 
 * 
 * cdef class DocInfo:             # <<<<<<<<<<<<<< 
 *     "Document information provided by parser and DTD."
 *     cdef _Document _doc
 */

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":512
 * 
 * 
 * cdef public class _Element [ type LxmlElementType, object LxmlElement ]:             # <<<<<<<<<<<<<< 
 *     """Element class.  References a document object and a libxml node.
 * 
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1249
 * 
 * 
 * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<< 
 *     cdef int _raiseImmutable(self) except -1:
 *         raise TypeError("this element does not have children or attributes")
 */

struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement {
  int (*_raiseImmutable)(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1249
 * 
 * 
 * cdef class __ContentOnlyElement(_Element):             # <<<<<<<<<<<<<< 
 *     cdef int _raiseImmutable(self) except -1:
 *         raise TypeError("this element does not have children or attributes")
 */
static struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1311
 *         return []
 * 
 * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__Comment {
  struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1311
 *         return []
 * 
 * cdef class _Comment(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__Comment *__pyx_vtabptr_4lxml_5etree__Comment;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1319
 *         return "<!--%s-->" % self.text
 *     
 * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction {
  struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1319
 *         return "<!--%s-->" % self.text
 *     
 * cdef class _ProcessingInstruction(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1341
 *             return "<?%s?>" % self.target
 * 
 * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__Entity {
  struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1341
 *             return "<?%s?>" % self.target
 * 
 * cdef class _Entity(__ContentOnlyElement):             # <<<<<<<<<<<<<< 
 *     property tag:
 *         def __get__(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__Entity *__pyx_vtabptr_4lxml_5etree__Entity;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTreeType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1360
 * 
 * 
 * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<< 
 *                                  object LxmlElementTree ]:
 *     cdef _Document _doc
 */

struct __pyx_vtabstruct_4lxml_5etree__ElementTree {
  PyObject *(*_assertHasRoot)(struct LxmlElementTree *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1360
 * 
 * 
 * cdef public class _ElementTree [ type LxmlElementTreeType,             # <<<<<<<<<<<<<< 
 *                                  object LxmlElementTree ]:
 *     cdef _Document _doc
 */
static struct __pyx_vtabstruct_4lxml_5etree__ElementTree *__pyx_vtabptr_4lxml_5etree__ElementTree;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1670
 * 
 * 
 * cdef class _Attrib:             # <<<<<<<<<<<<<< 
 *     cdef _Element _element
 *     def __init__(self, _Element element not None):
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1794
 *         return python.PyObject_RichCompare(one, other, op)
 * 
 * cdef class _AttribIterator:             # <<<<<<<<<<<<<< 
 *     """Attribute iterator - for internal use only!
 *     """
 */

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1835
 * 
 * 
 * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<< 
 *                                        type LxmlElementTagMatcherType ]:
 *     cdef object _pystrings
 */

struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher {
  PyObject *(*_initTagMatch)(struct LxmlElementTagMatcher *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1835
 * 
 * 
 * cdef public class _ElementTagMatcher [ object LxmlElementTagMatcher,             # <<<<<<<<<<<<<< 
 *                                        type LxmlElementTagMatcherType ]:
 *     cdef object _pystrings
 */
static struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementIteratorType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1863
 *                 self._name = NULL
 * 
 * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<< 
 *     object LxmlElementIterator, type LxmlElementIteratorType ]:
 *     # we keep Python references here to control GC
 */

struct __pyx_vtabstruct_4lxml_5etree__ElementIterator {
  struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_base;
  void (*_storeNext)(struct LxmlElementIterator *,struct LxmlElement *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1863
 *                 self._name = NULL
 * 
 * cdef public class _ElementIterator(_ElementTagMatcher) [             # <<<<<<<<<<<<<< 
 *     object LxmlElementIterator, type LxmlElementIteratorType ]:
 *     # we keep Python references here to control GC
 */
static struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *__pyx_vtabptr_4lxml_5etree__ElementIterator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1895
 *         return current_node
 * 
 * cdef class ElementChildIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):
 */

struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator {
  struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1895
 *         return current_node
 * 
 * cdef class ElementChildIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):
 */
static struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator *__pyx_vtabptr_4lxml_5etree_ElementChildIterator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1916
 *             self._node = _elementFactory(node._doc, c_node)
 * 
 * cdef class SiblingsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     """Iterates over the siblings of an element.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator {
  struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1916
 *             self._node = _elementFactory(node._doc, c_node)
 * 
 * cdef class SiblingsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     """Iterates over the siblings of an element.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator *__pyx_vtabptr_4lxml_5etree_SiblingsIterator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1929
 *         self._storeNext(node)
 * 
 * cdef class AncestorsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):
 */

struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator {
  struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1929
 *         self._storeNext(node)
 * 
 * cdef class AncestorsIterator(_ElementIterator):             # <<<<<<<<<<<<<< 
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):
 */
static struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator *__pyx_vtabptr_4lxml_5etree_AncestorsIterator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1936
 *         self._storeNext(node)
 * 
 * cdef class ElementDepthFirstIterator(_ElementTagMatcher):             # <<<<<<<<<<<<<< 
 *     """Iterates over an element and its sub-elements in document order (depth
 *     first pre-order).  Note that this also includes comments, entities and
 */

struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator {
  struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_base;
  xmlNode *(*_nextNodeAnyTag)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *,xmlNode *);
  xmlNode *(*_nextNodeMatchTag)(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *,xmlNode *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1936
 *         self._storeNext(node)
 * 
 * cdef class ElementDepthFirstIterator(_ElementTagMatcher):             # <<<<<<<<<<<<<< 
 *     """Iterates over an element and its sub-elements in document order (depth
 *     first pre-order).  Note that this also includes comments, entities and
 */
static struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator *__pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2003
 *         return NULL
 * 
 * cdef class ElementTextIterator:             # <<<<<<<<<<<<<< 
 *     """Iterates over the text content of a subtree.
 * 
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":35
 * # Logging classes
 * 
 * cdef class _LogEntry:             # <<<<<<<<<<<<<< 
 *     cdef readonly object domain
 *     cdef readonly object type
 */

struct __pyx_vtabstruct_4lxml_5etree__LogEntry {
  PyObject *(*_setError)(struct __pyx_obj_4lxml_5etree__LogEntry *,xmlError *);
  PyObject *(*_setGeneric)(struct __pyx_obj_4lxml_5etree__LogEntry *,int,int,int,int,PyObject *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":35
 * # Logging classes
 * 
 * cdef class _LogEntry:             # <<<<<<<<<<<<<< 
 *     cdef readonly object domain
 *     cdef readonly object type
 */
static struct __pyx_vtabstruct_4lxml_5etree__LogEntry *__pyx_vtabptr_4lxml_5etree__LogEntry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":87
 *             return ErrorLevels._getName(self.level, "unknown")
 * 
 * cdef class _BaseErrorLog:             # <<<<<<<<<<<<<< 
 *     cdef _LogEntry _first_error
 *     cdef readonly object last_error
 */

struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog {
  void (*_receive)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *,xmlError *);
  void (*_receiveGeneric)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *,int,int,int,int,PyObject *,PyObject *);
  PyObject *(*_buildParseException)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *,PyObject *,PyObject *);
  PyObject *(*_buildExceptionMessage)(struct __pyx_obj_4lxml_5etree__BaseErrorLog *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":87
 *             return ErrorLevels._getName(self.level, "unknown")
 * 
 * cdef class _BaseErrorLog:             # <<<<<<<<<<<<<< 
 *     cdef _LogEntry _first_error
 *     cdef readonly object last_error
 */
static struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":170
 *         return message
 * 
 * cdef class _ListErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     "Immutable base version of a list based error log."
 *     cdef object _entries
 */

struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog {
  struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":170
 *         return message
 * 
 * cdef class _ListErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     "Immutable base version of a list based error log."
 *     cdef object _entries
 */
static struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog *__pyx_vtabptr_4lxml_5etree__ListErrorLog;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":274
 *         return self.filter_from_level(ErrorLevels.WARNING)
 * 
 * cdef class _ErrorLog(_ListErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)
 */

struct __pyx_vtabstruct_4lxml_5etree__ErrorLog {
  struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog __pyx_base;
  void (*connect)(struct __pyx_obj_4lxml_5etree__ErrorLog *);
  void (*disconnect)(struct __pyx_obj_4lxml_5etree__ErrorLog *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":274
 *         return self.filter_from_level(ErrorLevels.WARNING)
 * 
 * cdef class _ErrorLog(_ListErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)
 */
static struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *__pyx_vtabptr_4lxml_5etree__ErrorLog;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":304
 *         python.PyList_Append(self._entries, entry)
 * 
 * cdef class _DomainErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)
 */

struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog {
  struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":304
 *         python.PyList_Append(self._entries, entry)
 * 
 * cdef class _DomainErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)
 */
static struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog *__pyx_vtabptr_4lxml_5etree__DomainErrorLog;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":313
 *             _ErrorLog.receive(self, entry)
 * 
 * cdef class _RotatingErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     cdef int _max_len
 *     def __init__(self, max_len):
 */

struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog {
  struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":313
 *             _ErrorLog.receive(self, entry)
 * 
 * cdef class _RotatingErrorLog(_ErrorLog):             # <<<<<<<<<<<<<< 
 *     cdef int _max_len
 *     def __init__(self, max_len):
 */
static struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog *__pyx_vtabptr_4lxml_5etree__RotatingErrorLog;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":325
 *         python.PyList_Append(entries, entry)
 * 
 * cdef class PyErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     """A global error log that connects to the Python stdlib logging package.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog {
  struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":325
 *         python.PyList_Append(entries, entry)
 * 
 * cdef class PyErrorLog(_BaseErrorLog):             # <<<<<<<<<<<<<< 
 *     """A global error log that connects to the Python stdlib logging package.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog *__pyx_vtabptr_4lxml_5etree_PyErrorLog;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementBaseType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":6
 * # Custom Element classes
 * 
 * cdef public class ElementBase(_Element) [ type LxmlElementBaseType,             # <<<<<<<<<<<<<< 
 *                                           object LxmlElementBase ]:
 *     """All custom Element classes must inherit from this one.
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":17
 *     """
 * 
 * cdef class CommentBase(_Comment):             # <<<<<<<<<<<<<< 
 *     """All custom Comment classes must inherit from this one.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_CommentBase {
  struct __pyx_vtabstruct_4lxml_5etree__Comment __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":17
 *     """
 * 
 * cdef class CommentBase(_Comment):             # <<<<<<<<<<<<<< 
 *     """All custom Comment classes must inherit from this one.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_CommentBase *__pyx_vtabptr_4lxml_5etree_CommentBase;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":27
 *     """
 * 
 * cdef class PIBase(_ProcessingInstruction):             # <<<<<<<<<<<<<< 
 *     """All custom Processing Instruction classes must inherit from this one.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_PIBase {
  struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":27
 *     """
 * 
 * cdef class PIBase(_ProcessingInstruction):             # <<<<<<<<<<<<<< 
 *     """All custom Processing Instruction classes must inherit from this one.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_PIBase *__pyx_vtabptr_4lxml_5etree_PIBase;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":37
 *     """
 * 
 * cdef class EntityBase(_Entity):             # <<<<<<<<<<<<<< 
 *     """All custom Entity classes must inherit from this one.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_EntityBase {
  struct __pyx_vtabstruct_4lxml_5etree__Entity __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":37
 *     """
 * 
 * cdef class EntityBase(_Entity):             # <<<<<<<<<<<<<< 
 *     """All custom Entity classes must inherit from this one.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_EntityBase *__pyx_vtabptr_4lxml_5etree_EntityBase;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementClassLookupType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":54
 * 
 * # class to store element class lookup functions
 * cdef public class ElementClassLookup [ type LxmlElementClassLookupType,             # <<<<<<<<<<<<<< 
 *                                        object LxmlElementClassLookup ]:
 *     """Superclass of Element class lookups.
 */

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":62
 *         self._lookup_function = NULL # use default lookup
 * 
 * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<< 
 *          [ type LxmlFallbackElementClassLookupType,
 *            object LxmlFallbackElementClassLookup ]:
 */

struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup {
  PyObject *(*_callFallback)(struct LxmlFallbackElementClassLookup *,PyObject *,xmlNode *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":62
 *         self._lookup_function = NULL # use default lookup
 * 
 * cdef public class FallbackElementClassLookup(ElementClassLookup) \             # <<<<<<<<<<<<<< 
 *          [ type LxmlFallbackElementClassLookupType,
 *            object LxmlFallbackElementClassLookup ]:
 */
static struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":91
 * # Custom Element class lookup schemes
 * 
 * cdef class ElementDefaultClassLookup(ElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup scheme that always returns the default Element
 *     class.
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":171
 *         assert 0, "Unknown node type: %s" % c_node.type
 * 
 * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Checks an attribute of an Element and looks up the value in a class
 *     dictionary.  
 */

struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup {
  struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":171
 *         assert 0, "Unknown node type: %s" % c_node.type
 * 
 * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Checks an attribute of an Element and looks up the value in a class
 *     dictionary.  
 */
static struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":215
 * 
 * 
 * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on the XML parser.
 *     """
 */

struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup {
  struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":215
 * 
 * 
 * cdef class ParserBasedElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on the XML parser.
 *     """
 */
static struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup *__pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":231
 * 
 * 
 * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on a subclass method.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup {
  struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":231
 * 
 * 
 * cdef class CustomElementClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup based on a subclass method.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup *__pyx_vtabptr_4lxml_5etree_CustomElementClassLookup;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":14
 * 
 * 
 * cdef class _NamespaceRegistry:             # <<<<<<<<<<<<<< 
 *     "Dictionary-like namespace registry"
 *     cdef object _ns_uri
 */

struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry {
  PyObject *(*_get)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *,PyObject *);
  PyObject *(*_getForString)(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *,char *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":14
 * 
 * 
 * cdef class _NamespaceRegistry:             # <<<<<<<<<<<<<< 
 *     "Dictionary-like namespace registry"
 *     cdef object _ns_uri
 */
static struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":77
 *         python.PyDict_Clear(self._entries)
 * 
 * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):
 */

struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry {
  struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":77
 *         python.PyDict_Clear(self._entries)
 * 
 * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):
 */
static struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":91
 * 
 * 
 * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup scheme that searches the Element class in the
 *     Namespace registry.
 */

struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup {
  struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":91
 * 
 * 
 * cdef class ElementNamespaceClassLookup(FallbackElementClassLookup):             # <<<<<<<<<<<<<< 
 *     """Element class lookup scheme that searches the Element class in the
 *     Namespace registry.
 */
static struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup *__pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":173
 *         return registry
 * 
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     def __setitem__(self, name, item):
 *         if not callable(item):
 */

struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry {
  struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":173
 *         return registry
 * 
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     def __setitem__(self, name, item):
 *         if not callable(item):
 */
static struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":186
 *         return "FunctionNamespace(%r)" % self._ns_uri
 * 
 * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     cdef object _prefix
 *     cdef object _prefix_utf
 */

struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry {
  struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":186
 *         return "FunctionNamespace(%r)" % self._ns_uri
 * 
 * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):             # <<<<<<<<<<<<<< 
 *     cdef object _prefix
 *     cdef object _prefix_utf
 */
static struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry *__pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":9
 *     PARSER_DATA_FILE
 * 
 * cdef class _InputDocument:             # <<<<<<<<<<<<<< 
 *     cdef _InputDocumentDataType _type
 *     cdef object _data_bytes
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":15
 *     cdef object _file
 * 
 * cdef class Resolver:             # <<<<<<<<<<<<<< 
 *     "This is the base class of all resolvers."
 *     def resolve(self, system_url, public_id, context):
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":78
 *         return doc_ref
 * 
 * cdef class _ResolverRegistry:             # <<<<<<<<<<<<<< 
 *     cdef object _resolvers
 *     cdef Resolver _default_resolver
 */

struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry {
  struct __pyx_obj_4lxml_5etree__ResolverRegistry *(*_copy)(struct __pyx_obj_4lxml_5etree__ResolverRegistry *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":78
 *         return doc_ref
 * 
 * cdef class _ResolverRegistry:             # <<<<<<<<<<<<<< 
 *     cdef object _resolvers
 *     cdef Resolver _default_resolver
 */
static struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry *__pyx_vtabptr_4lxml_5etree__ResolverRegistry;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":120
 *         return repr(self._resolvers)
 * 
 * cdef class _ResolverContext(_ExceptionContext):             # <<<<<<<<<<<<<< 
 *     cdef _ResolverRegistry _resolvers
 *     cdef _TempStore _storage
 */

struct __pyx_vtabstruct_4lxml_5etree__ResolverContext {
  struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":120
 *         return repr(self._resolvers)
 * 
 * cdef class _ResolverContext(_ExceptionContext):             # <<<<<<<<<<<<<< 
 *     cdef _ResolverRegistry _resolvers
 *     cdef _TempStore _storage
 */
static struct __pyx_vtabstruct_4lxml_5etree__ResolverContext *__pyx_vtabptr_4lxml_5etree__ResolverContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":26
 *     pass
 * 
 * cdef class _ParserDictionaryContext:             # <<<<<<<<<<<<<< 
 *     # Global parser context to share the string dictionary.
 *     #
 */

struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext {
  void (*initMainParserContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
  struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *(*_findThreadParserContext)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
  void (*setDefaultParser)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,struct __pyx_obj_4lxml_5etree__BaseParser *);
  struct __pyx_obj_4lxml_5etree__BaseParser *(*getDefaultParser)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *);
  xmlDict *(*_getThreadDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,xmlDict *);
  void (*initThreadDictRef)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,xmlDict **);
  void (*initParserDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,xmlParserCtxt *);
  void (*initXPathParserDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,xmlXPathContext *);
  void (*initDocDict)(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *,xmlDoc *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":26
 *     pass
 * 
 * cdef class _ParserDictionaryContext:             # <<<<<<<<<<<<<< 
 *     # Global parser context to share the string dictionary.
 *     #
 */
static struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *__pyx_vtabptr_4lxml_5etree__ParserDictionaryContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":205
 * ############################################################
 * 
 * cdef class _FileReaderContext:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef object _encoding
 */

struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext {
  xmlParserInput *(*_createParserInput)(struct __pyx_obj_4lxml_5etree__FileReaderContext *,xmlParserCtxt *);
  xmlDoc *(*_readDoc)(struct __pyx_obj_4lxml_5etree__FileReaderContext *,xmlParserCtxt *,int);
  xmlDtd *(*_readDtd)(struct __pyx_obj_4lxml_5etree__FileReaderContext *);
  int (*copyToBuffer)(struct __pyx_obj_4lxml_5etree__FileReaderContext *,char *,int);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":205
 * ############################################################
 * 
 * cdef class _FileReaderContext:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef object _encoding
 */
static struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *__pyx_vtabptr_4lxml_5etree__FileReaderContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":379
 * cdef class _TargetParserContext(_SaxParserContext)
 * 
 * cdef class _ParserContext(_ResolverContext):             # <<<<<<<<<<<<<< 
 *     cdef _ErrorLog _error_log
 *     cdef xmlparser.xmlParserCtxt* _c_ctxt
 */

struct __pyx_vtabstruct_4lxml_5etree__ParserContext {
  struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_base;
  struct __pyx_obj_4lxml_5etree__ParserContext *(*_copy)(struct __pyx_obj_4lxml_5etree__ParserContext *);
  void (*_initParserContext)(struct __pyx_obj_4lxml_5etree__ParserContext *,xmlParserCtxt *);
  void (*_resetParserContext)(struct __pyx_obj_4lxml_5etree__ParserContext *);
  int (*prepare)(struct __pyx_obj_4lxml_5etree__ParserContext *);
  int (*cleanup)(struct __pyx_obj_4lxml_5etree__ParserContext *);
  PyObject *(*_handleParseResult)(struct __pyx_obj_4lxml_5etree__ParserContext *,struct __pyx_obj_4lxml_5etree__BaseParser *,xmlDoc *,PyObject *);
  xmlDoc *(*_handleParseResultDoc)(struct __pyx_obj_4lxml_5etree__ParserContext *,struct __pyx_obj_4lxml_5etree__BaseParser *,xmlDoc *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":379
 * cdef class _TargetParserContext(_SaxParserContext)
 * 
 * cdef class _ParserContext(_ResolverContext):             # <<<<<<<<<<<<<< 
 *     cdef _ErrorLog _error_log
 *     cdef xmlparser.xmlParserCtxt* _c_ctxt
 */
static struct __pyx_vtabstruct_4lxml_5etree__ParserContext *__pyx_vtabptr_4lxml_5etree__ParserContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1012
 *         return None
 * 
 * cdef class _SaxParserContext(_ParserContext):             # <<<<<<<<<<<<<< 
 *     """This class maps SAX2 events to method calls.
 *     """
 */

struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext {
  struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_base;
  void (*_setSaxParserTarget)(struct __pyx_obj_4lxml_5etree__SaxParserContext *,struct __pyx_obj_4lxml_5etree__SaxParserTarget *);
  void (*_handleSaxException)(struct __pyx_obj_4lxml_5etree__SaxParserContext *,xmlParserCtxt *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1012
 *         return None
 * 
 * cdef class _SaxParserContext(_ParserContext):             # <<<<<<<<<<<<<< 
 *     """This class maps SAX2 events to method calls.
 *     """
 */
static struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext *__pyx_vtabptr_4lxml_5etree__SaxParserContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":93
 * 
 * 
 * cdef class _TargetParserContext(_SaxParserContext):             # <<<<<<<<<<<<<< 
 *     """This class maps SAX2 events to the ET parser target interface.
 *     """
 */

struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext {
  struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext __pyx_base;
  int (*_setTarget)(struct __pyx_obj_4lxml_5etree__TargetParserContext *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":93
 * 
 * 
 * cdef class _TargetParserContext(_SaxParserContext):             # <<<<<<<<<<<<<< 
 *     """This class maps SAX2 events to the ET parser target interface.
 *     """
 */
static struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext *__pyx_vtabptr_4lxml_5etree__TargetParserContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":830
 * ############################################################
 * 
 * cdef class _FeedParser(_BaseParser):             # <<<<<<<<<<<<<< 
 *     cdef bint _feed_parser_running
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree__FeedParser {
  struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":830
 * ############################################################
 * 
 * cdef class _FeedParser(_BaseParser):             # <<<<<<<<<<<<<< 
 *     cdef bint _feed_parser_running
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree__FeedParser *__pyx_vtabptr_4lxml_5etree__FeedParser;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":996
 *     SAX_EVENT_COMMENT = 32
 * 
 * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<< 
 *     cdef int _sax_event_filter
 *     cdef int _sax_event_propagate
 */

struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget {
  PyObject *(*_handleSaxStart)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *,PyObject *,PyObject *);
  PyObject *(*_handleSaxEnd)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *);
  int (*_handleSaxData)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *);
  int (*_handleSaxDoctype)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *,PyObject *,PyObject *);
  PyObject *(*_handleSaxPi)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *,PyObject *);
  PyObject *(*_handleSaxComment)(struct __pyx_obj_4lxml_5etree__SaxParserTarget *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":996
 *     SAX_EVENT_COMMENT = 32
 * 
 * cdef class _SaxParserTarget:             # <<<<<<<<<<<<<< 
 *     cdef int _sax_event_filter
 *     cdef int _sax_event_propagate
 */
static struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1286
 * ############################################################
 * 
 * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     """Parser target that builds a tree.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder {
  struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_base;
  int (*_flush)(struct __pyx_obj_4lxml_5etree_TreeBuilder *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1286
 * ############################################################
 * 
 * cdef class TreeBuilder(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     """Parser target that builds a tree.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *__pyx_vtabptr_4lxml_5etree_TreeBuilder;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1415
 *     )
 * 
 * cdef class XMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The XML parser.  Parsers can be supplied as additional argument to
 *     various parse functions of the lxml API.  A default parser is always
 */

struct __pyx_vtabstruct_4lxml_5etree_XMLParser {
  struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1415
 *     )
 * 
 * cdef class XMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The XML parser.  Parsers can be supplied as additional argument to
 *     various parse functions of the lxml API.  A default parser is always
 */
static struct __pyx_vtabstruct_4lxml_5etree_XMLParser *__pyx_vtabptr_4lxml_5etree_XMLParser;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1479
 *                              target, None, encoding)
 * 
 * cdef class ETCompatXMLParser(XMLParser):             # <<<<<<<<<<<<<< 
 *     """An XML parser with an ElementTree compatible default setup.  See the
 *     XMLParser class for details.
 */

struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser {
  struct __pyx_vtabstruct_4lxml_5etree_XMLParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1479
 *                              target, None, encoding)
 * 
 * cdef class ETCompatXMLParser(XMLParser):             # <<<<<<<<<<<<<< 
 *     """An XML parser with an ElementTree compatible default setup.  See the
 *     XMLParser class for details.
 */
static struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser *__pyx_vtabptr_4lxml_5etree_ETCompatXMLParser;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1548
 *     )
 * 
 * cdef class HTMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The HTML parser.  This parser allows reading HTML into a normal XML
 *     tree.  By default, it can read broken (non well-formed) HTML, depending on
 */

struct __pyx_vtabstruct_4lxml_5etree_HTMLParser {
  struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1548
 *     )
 * 
 * cdef class HTMLParser(_FeedParser):             # <<<<<<<<<<<<<< 
 *     """The HTML parser.  This parser allows reading HTML into a normal XML
 *     tree.  By default, it can read broken (non well-formed) HTML, depending on
 */
static struct __pyx_vtabstruct_4lxml_5etree_HTMLParser *__pyx_vtabptr_4lxml_5etree_HTMLParser;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":13
 *         self.result = result
 * 
 * cdef class _PythonSaxParserTarget(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     cdef object _target_start
 *     cdef object _target_end
 */

struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget {
  struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":13
 *         self.result = result
 * 
 * cdef class _PythonSaxParserTarget(_SaxParserTarget):             # <<<<<<<<<<<<<< 
 *     cdef object _target_start
 *     cdef object _target_end
 */
static struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget *__pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":269
 * # output to file-like objects
 * 
 * cdef class _FilelikeWriter:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef _ExceptionContext _exc_context
 */

struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter {
  xmlOutputBuffer *(*_createOutputBuffer)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *,xmlCharEncodingHandler *);
  int (*write)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *,char *,int);
  int (*close)(struct __pyx_obj_4lxml_5etree__FilelikeWriter *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":269
 * # output to file-like objects
 * 
 * cdef class _FilelikeWriter:             # <<<<<<<<<<<<<< 
 *     cdef object _filelike
 *     cdef _ExceptionContext _exc_context
 */
static struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *__pyx_vtabptr_4lxml_5etree__FilelikeWriter;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":51
 *     return count
 * 
 * cdef class _IterparseContext(_ParserContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlparser.startElementNsSAX2Func _origSaxStart
 *     cdef xmlparser.endElementNsSAX2Func   _origSaxEnd
 */

struct __pyx_vtabstruct_4lxml_5etree__IterparseContext {
  struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_base;
  PyObject *(*_setEventFilter)(struct __pyx_obj_4lxml_5etree__IterparseContext *,PyObject *,PyObject *);
  int (*startNode)(struct __pyx_obj_4lxml_5etree__IterparseContext *,xmlNode *);
  int (*endNode)(struct __pyx_obj_4lxml_5etree__IterparseContext *,xmlNode *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":51
 *     return count
 * 
 * cdef class _IterparseContext(_ParserContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlparser.startElementNsSAX2Func _origSaxStart
 *     cdef xmlparser.endElementNsSAX2Func   _origSaxEnd
 */
static struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *__pyx_vtabptr_4lxml_5etree__IterparseContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":241
 *     origEnd(ctxt, name)
 * 
 * cdef class iterparse(_BaseParser):             # <<<<<<<<<<<<<< 
 *     """Incremental parser.  Parses XML into a tree and generates tuples
 *     (event, element) in a SAX-like fashion. ``event`` is any of 'start',
 */

struct __pyx_vtabstruct_4lxml_5etree_iterparse {
  struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":241
 *     origEnd(ctxt, name)
 * 
 * cdef class iterparse(_BaseParser):             # <<<<<<<<<<<<<< 
 *     """Incremental parser.  Parses XML into a tree and generates tuples
 *     (event, element) in a SAX-like fashion. ``event`` is any of 'start',
 */
static struct __pyx_vtabstruct_4lxml_5etree_iterparse *__pyx_vtabptr_4lxml_5etree_iterparse;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":398
 * 
 * 
 * cdef class iterwalk:             # <<<<<<<<<<<<<< 
 *     """A tree walker that generates events from an existing tree as if it was
 *     parsing XML data with ``iterparse()``.
 */

struct __pyx_vtabstruct_4lxml_5etree_iterwalk {
  void (*_setTagFilter)(struct __pyx_obj_4lxml_5etree_iterwalk *,PyObject *);
  int (*_start_node)(struct __pyx_obj_4lxml_5etree_iterwalk *,struct LxmlElement *);
  struct LxmlElement *(*_end_node)(struct __pyx_obj_4lxml_5etree_iterwalk *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":398
 * 
 * 
 * cdef class iterwalk:             # <<<<<<<<<<<<<< 
 *     """A tree walker that generates events from an existing tree as if it was
 *     parsing XML data with ``iterparse()``.
 */
static struct __pyx_vtabstruct_4lxml_5etree_iterwalk *__pyx_vtabptr_4lxml_5etree_iterwalk;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":51
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))
 * 
 * cdef class _IDDict:             # <<<<<<<<<<<<<< 
 *     """A dictionary-like proxy class that mapps ID attributes to elements.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree__IDDict {
  PyObject *(*_build_keys)(struct __pyx_obj_4lxml_5etree__IDDict *);
  PyObject *(*_build_items)(struct __pyx_obj_4lxml_5etree__IDDict *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":51
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))
 * 
 * cdef class _IDDict:             # <<<<<<<<<<<<<< 
 *     """A dictionary-like proxy class that mapps ID attributes to elements.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree__IDDict *__pyx_vtabptr_4lxml_5etree__IDDict;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":356
 * # EXSLT regexp implementation
 * 
 * cdef class _ExsltRegExp:             # <<<<<<<<<<<<<< 
 *     cdef object _compile_map
 *     def __init__(self):
 */

struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp {
  PyObject *(*_make_string)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *,PyObject *);
  PyObject *(*_compile)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *,PyObject *,PyObject *);
  PyObject *(*_register_in_context)(struct __pyx_obj_4lxml_5etree__ExsltRegExp *,struct __pyx_obj_4lxml_5etree__BaseContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":356
 * # EXSLT regexp implementation
 * 
 * cdef class _ExsltRegExp:             # <<<<<<<<<<<<<< 
 *     cdef object _compile_map
 *     def __init__(self):
 */
static struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *__pyx_vtabptr_4lxml_5etree__ExsltRegExp;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":31
 * # Base class for XSLT and XPath evaluation contexts: functions, namespaces, ...
 * 
 * cdef class _BaseContext:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _Document _doc
 */

struct __pyx_vtabstruct_4lxml_5etree__BaseContext {
  struct __pyx_obj_4lxml_5etree__BaseContext *(*_copy)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*_to_utf)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *);
  void (*_set_xpath_context)(struct __pyx_obj_4lxml_5etree__BaseContext *,xmlXPathContext *);
  PyObject *(*_register_context)(struct __pyx_obj_4lxml_5etree__BaseContext *,struct LxmlDocument *);
  PyObject *(*_cleanup_context)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*_release_context)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*addNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *,PyObject *);
  PyObject *(*registerNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *,PyObject *);
  PyObject *(*registerLocalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*registerGlobalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*unregisterGlobalNamespaces)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  void (*_unregisterNamespace)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *);
  void (*_addLocalExtensionFunction)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *,PyObject *,PyObject *);
  void (*registerGlobalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *,void *,__pyx_t_4lxml_5etree__register_function);
  void (*registerLocalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *,void *,__pyx_t_4lxml_5etree__register_function);
  PyObject *(*unregisterAllFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *,void *,__pyx_t_4lxml_5etree__register_function);
  PyObject *(*unregisterGlobalFunctions)(struct __pyx_obj_4lxml_5etree__BaseContext *,void *,__pyx_t_4lxml_5etree__register_function);
  PyObject *(*_find_cached_function)(struct __pyx_obj_4lxml_5etree__BaseContext *,char *,char *);
  PyObject *(*_release_temp_refs)(struct __pyx_obj_4lxml_5etree__BaseContext *);
  PyObject *(*_hold)(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":31
 * # Base class for XSLT and XPath evaluation contexts: functions, namespaces, ...
 * 
 * cdef class _BaseContext:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _Document _doc
 */
static struct __pyx_vtabstruct_4lxml_5etree__BaseContext *__pyx_vtabptr_4lxml_5etree__BaseContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":50
 * 
 * 
 * cdef class _XPathContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef object _variables
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 */

struct __pyx_vtabstruct_4lxml_5etree__XPathContext {
  struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_base;
  PyObject *(*set_context)(struct __pyx_obj_4lxml_5etree__XPathContext *,xmlXPathContext *);
  PyObject *(*register_context)(struct __pyx_obj_4lxml_5etree__XPathContext *,struct LxmlDocument *);
  PyObject *(*unregister_context)(struct __pyx_obj_4lxml_5etree__XPathContext *);
  PyObject *(*registerVariables)(struct __pyx_obj_4lxml_5etree__XPathContext *,PyObject *);
  PyObject *(*registerVariable)(struct __pyx_obj_4lxml_5etree__XPathContext *,PyObject *,PyObject *);
  void (*_registerVariable)(struct __pyx_obj_4lxml_5etree__XPathContext *,PyObject *,PyObject *);
  void (*_setupDict)(struct __pyx_obj_4lxml_5etree__XPathContext *,xmlXPathContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":50
 * 
 * 
 * cdef class _XPathContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef object _variables
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 */
static struct __pyx_vtabstruct_4lxml_5etree__XPathContext *__pyx_vtabptr_4lxml_5etree__XPathContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":100
 *     _XPATH_VERSION_WARNING_REQUIRED = 0
 * 
 * cdef class _XPathEvaluatorBase:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _XPathContext _context
 */

struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase {
  PyObject *(*set_context)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *,xmlXPathContext *);
  int (*_checkAbsolutePath)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *,char *);
  int (*_lock)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
  void (*_unlock)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
  PyObject *(*_raise_parse_error)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
  PyObject *(*_raise_eval_error)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *);
  PyObject *(*_handle_result)(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *,xmlXPathObject *,struct LxmlDocument *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":100
 *     _XPATH_VERSION_WARNING_REQUIRED = 0
 * 
 * cdef class _XPathEvaluatorBase:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlXPathContext* _xpathCtxt
 *     cdef _XPathContext _context
 */
static struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":207
 * 
 * 
 * cdef class XPathElementEvaluator(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an element.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator {
  struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":207
 * 
 * 
 * cdef class XPathElementEvaluator(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an element.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator *__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":276
 * 
 * 
 * cdef class XPathDocumentEvaluator(XPathElementEvaluator):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an ElementTree.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator {
  struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":276
 * 
 * 
 * cdef class XPathDocumentEvaluator(XPathElementEvaluator):             # <<<<<<<<<<<<<< 
 *     """Create an XPath evaluator for an ElementTree.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator *__pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":347
 * 
 * 
 * cdef class XPath(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """A compiled XPath expression that can be called on Elements and
 *     ElementTrees.
 */

struct __pyx_vtabstruct_4lxml_5etree_XPath {
  struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":347
 * 
 * 
 * cdef class XPath(_XPathEvaluatorBase):             # <<<<<<<<<<<<<< 
 *     """A compiled XPath expression that can be called on Elements and
 *     ElementTrees.
 */
static struct __pyx_vtabstruct_4lxml_5etree_XPath *__pyx_vtabptr_4lxml_5etree_XPath;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":414
 * _find_namespaces = re.compile('({[^}]+})').findall
 * 
 * cdef class ETXPath(XPath):             # <<<<<<<<<<<<<< 
 *     """Special XPath class that supports the ElementTree {uri} notation for
 *     namespaces.
 */

struct __pyx_vtabstruct_4lxml_5etree_ETXPath {
  struct __pyx_vtabstruct_4lxml_5etree_XPath __pyx_base;
  PyObject *(*_nsextract_path)(struct __pyx_obj_4lxml_5etree_ETXPath *,PyObject *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":414
 * _find_namespaces = re.compile('({[^}]+})').findall
 * 
 * cdef class ETXPath(XPath):             # <<<<<<<<<<<<<< 
 *     """Special XPath class that supports the ElementTree {uri} notation for
 *     namespaces.
 */
static struct __pyx_vtabstruct_4lxml_5etree_ETXPath *__pyx_vtabptr_4lxml_5etree_ETXPath;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":50
 * # XSLT document loaders
 * 
 * cdef class _XSLTResolverContext(_ResolverContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* _c_style_doc
 *     cdef _BaseParser _parser
 */

struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext {
  struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_base;
  struct __pyx_obj_4lxml_5etree__XSLTResolverContext *(*_copy)(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":50
 * # XSLT document loaders
 * 
 * cdef class _XSLTResolverContext(_ResolverContext):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* _c_style_doc
 *     cdef _BaseParser _parser
 */
static struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *__pyx_vtabptr_4lxml_5etree__XSLTResolverContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":169
 * # XSLT file/network access control
 * 
 * cdef class XSLTAccessControl:             # <<<<<<<<<<<<<< 
 *     """Access control for XSLT: reading/writing files, directories and network
 *     I/O.  Access to a type of resource is granted or denied by passing any of
 */

struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl {
  PyObject *(*_setAccess)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *,xsltSecurityOption,PyObject *);
  void (*_register_in_context)(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *,xsltTransformContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":169
 * # XSLT file/network access control
 * 
 * cdef class XSLTAccessControl:             # <<<<<<<<<<<<<< 
 *     """Access control for XSLT: reading/writing files, directories and network
 *     I/O.  Access to a type of resource is granted or denied by passing any of
 */
static struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl *__pyx_vtabptr_4lxml_5etree_XSLTAccessControl;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":226
 * 
 * 
 * cdef class _XSLTContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef xslt.xsltTransformContext* _xsltCtxt
 *     def __init__(self, namespaces, extensions, enable_regexp):
 */

struct __pyx_vtabstruct_4lxml_5etree__XSLTContext {
  struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_base;
  PyObject *(*register_context)(struct __pyx_obj_4lxml_5etree__XSLTContext *,xsltTransformContext *,struct LxmlDocument *);
  PyObject *(*free_context)(struct __pyx_obj_4lxml_5etree__XSLTContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":226
 * 
 * 
 * cdef class _XSLTContext(_BaseContext):             # <<<<<<<<<<<<<< 
 *     cdef xslt.xsltTransformContext* _xsltCtxt
 *     def __init__(self, namespaces, extensions, enable_regexp):
 */
static struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *__pyx_vtabptr_4lxml_5etree__XSLTContext;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":254
 * 
 * 
 * cdef class XSLT:             # <<<<<<<<<<<<<< 
 *     """Turn a document into an XSLT object.
 * 
 */

struct __pyx_vtabstruct_4lxml_5etree_XSLT {
  xmlDoc *(*_run_transform)(struct __pyx_obj_4lxml_5etree_XSLT *,struct LxmlDocument *,xmlDoc *,PyObject *,struct __pyx_obj_4lxml_5etree__XSLTContext *,xsltTransformContext *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":254
 * 
 * 
 * cdef class XSLT:             # <<<<<<<<<<<<<< 
 *     """Turn a document into an XSLT object.
 * 
 */
static struct __pyx_vtabstruct_4lxml_5etree_XSLT *__pyx_vtabptr_4lxml_5etree_XSLT;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":494
 *     cdef XSLT NEW_XSLT "PY_NEW" (object t)
 * 
 * cdef class _XSLTResultTree(_ElementTree):             # <<<<<<<<<<<<<< 
 *     cdef XSLT _xslt
 *     cdef _Document _profile
 */

struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree {
  struct __pyx_vtabstruct_4lxml_5etree__ElementTree __pyx_base;
  PyObject *(*_saveToStringAndSize)(struct __pyx_obj_4lxml_5etree__XSLTResultTree *,char **,int *);
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":494
 *     cdef XSLT NEW_XSLT "PY_NEW" (object t)
 * 
 * cdef class _XSLTResultTree(_ElementTree):             # <<<<<<<<<<<<<< 
 *     cdef XSLT _xslt
 *     cdef _Document _profile
 */
static struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree *__pyx_vtabptr_4lxml_5etree__XSLTResultTree;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":601
 *     return __findStylesheetByID(doc, id=id)
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):             # <<<<<<<<<<<<<< 
 *     def parseXSL(self, parser=None):
 *         """Try to parse the stylesheet referenced by this PI and return an
 */

struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction {
  struct __pyx_vtabstruct_4lxml_5etree_PIBase __pyx_base;
};

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":601
 *     return __findStylesheetByID(doc, id=id)
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):             # <<<<<<<<<<<<<< 
 *     def parseXSL(self, parser=None):
 *         """Try to parse the stylesheet referenced by this PI and return an
 */
static struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction *__pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction;


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2340
 *     pass
 * 
 * cdef class _Validator:             # <<<<<<<<<<<<<< 
 *     "Base class for XML validators."
 *     cdef _ErrorLog _error_log
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":22
 * # DTD
 * 
 * cdef class DTD(_Validator):             # <<<<<<<<<<<<<< 
 *     """A DTD validator.
 * 
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":22
 * # RelaxNG
 * 
 * cdef class RelaxNG(_Validator):             # <<<<<<<<<<<<<< 
 *     """Turn a document into a Relax NG validator.
 *     Can also load from filesystem directly given file object or filename.
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":22
 * # XMLSchema
 * 
 * cdef class XMLSchema(_Validator):             # <<<<<<<<<<<<<< 
 *     """Turn a document into an XML Schema validator.
 *     """
 */


/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":68
 * # Schematron
 * 
 * cdef class Schematron(_Validator):             # <<<<<<<<<<<<<< 
 *     """A Schematron validator.
 * 
 */

static PyTypeObject *__pyx_ptype_4lxml_5etree__TempStore = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ExceptionContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_QName = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseParser = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Document = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_DocInfo = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Element = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree___ContentOnlyElement = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Comment = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ProcessingInstruction = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Entity = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementTree = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Attrib = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__AttribIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementTagMatcher = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ElementIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementChildIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_SiblingsIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_AncestorsIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementTextIterator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__LogEntry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ListErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__DomainErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__RotatingErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_PyErrorLog = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementBase = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_CommentBase = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_PIBase = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_EntityBase = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_FallbackElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_CustomElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__NamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__InputDocument = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_Resolver = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ResolverRegistry = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ResolverContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ParserDictionaryContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__FileReaderContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ParserContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__SaxParserContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__TargetParserContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__FeedParser = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__SaxParserTarget = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_TreeBuilder = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XMLParser = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ETCompatXMLParser = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_HTMLParser = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__PythonSaxParserTarget = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__FilelikeWriter = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__IterparseContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_iterparse = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_iterwalk = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__IDDict = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__ExsltRegExp = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__BaseContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XPathEvaluatorBase = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XPathElementEvaluator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XPath = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_ETXPath = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTResolverContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XSLTAccessControl = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTContext = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XSLT = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTResultTree = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree__Validator = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_DTD = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_RelaxNG = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_XMLSchema = 0;
static PyTypeObject *__pyx_ptype_4lxml_5etree_Schematron = 0;
static PyObject *__pyx_v_4lxml_5etree_set;
static PyObject *__pyx_v_4lxml_5etree_os_path_join;
static PyObject *__pyx_v_4lxml_5etree__elementpath;
static PyObject *__pyx_v_4lxml_5etree_sys;
static PyObject *__pyx_v_4lxml_5etree_re;
static PyObject *__pyx_v_4lxml_5etree_ITER_EMPTY;
static PyObject *__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
static int __pyx_v_4lxml_5etree___DEBUG;
static int __pyx_v_4lxml_5etree___MAX_LOG_SIZE;
static PyObject *__pyx_v_4lxml_5etree__FILENAME_ENCODING;
static char *__pyx_v_4lxml_5etree__C_FILENAME_ENCODING;
static PyObject *__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES;
static PyObject *__pyx_v_4lxml_5etree__LxmlError;
static PyObject *__pyx_v_4lxml_5etree__initError;
static int __pyx_v_4lxml_5etree__LIBXML_VERSION_INT;
static PyThread_type_lock __pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK;
static PyObject *__pyx_v_4lxml_5etree___RE_XML_ENCODING;
static PyObject *__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING;
static PyObject *__pyx_v_4lxml_5etree___HAS_XML_ENCODING;
static struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG;
static PyObject *__pyx_v_4lxml_5etree___ERROR_LEVELS;
static PyObject *__pyx_v_4lxml_5etree___ERROR_DOMAINS;
static PyObject *__pyx_v_4lxml_5etree___ERROR_TYPES;
static _element_class_lookup_function __pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS;
static PyObject *__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE;
static struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP;
static PyObject *__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES;
static struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT;
static char *__pyx_v_4lxml_5etree__UNICODE_ENCODING;
static xmlExternalEntityLoader __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER;
static int __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;
static struct __pyx_obj_4lxml_5etree_XMLParser *__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER;
static int __pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS;
static struct __pyx_obj_4lxml_5etree_HTMLParser *__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER;
static PyObject *__pyx_v_4lxml_5etree_inspect_getargspec;
static PyObject *__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE;
static PyObject *__pyx_v_4lxml_5etree__find_id_attributes;
static PyObject *__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS;
static PyObject *__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS;
static int __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED;
static PyObject *__pyx_v_4lxml_5etree__replace_strings;
static PyObject *__pyx_v_4lxml_5etree__find_namespaces;
static xsltDocLoaderFunc __pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER;
static PyObject *__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES;
static PyObject *__pyx_v_4lxml_5etree__RE_PI_HREF;
static PyObject *__pyx_v_4lxml_5etree__FIND_PI_HREF;
static PyObject *__pyx_v_4lxml_5etree__REPLACE_PI_HREF;
static struct __pyx_obj_4lxml_5etree_XPath *__pyx_v_4lxml_5etree___findStylesheetByID;
static PyObject *__pyx_k57;
static PyObject *__pyx_k58;
static PyObject *__pyx_k59;
static PyObject *__pyx_k60;
static PyObject *__pyx_k61;
static PyObject *__pyx_k62;
static PyObject *__pyx_k63;
static PyObject *__pyx_k64;
static PyObject *__pyx_k65;
static PyObject *__pyx_k66;
static PyObject *__pyx_k67;
static PyObject *__pyx_k68;
static PyObject *__pyx_k69;
static PyObject *__pyx_k70;
static PyObject *__pyx_k71;
static PyObject *__pyx_k72;
static PyObject *__pyx_k73;
static PyObject *__pyx_k74;
static PyObject *__pyx_k75;
static PyObject *__pyx_k76;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k77;
static PyObject *__pyx_k78;
static PyObject *__pyx_k80;
static PyObject *__pyx_k81;
static PyObject *__pyx_k82;
static PyObject *__pyx_k83;
static PyObject *__pyx_k84;
static PyObject *__pyx_k85;
static PyObject *__pyx_k86;
static PyObject *__pyx_k87;
static PyObject *__pyx_k88;
static PyObject *__pyx_k89;
static PyObject *__pyx_k90;
static PyObject *__pyx_k91;
static PyObject *__pyx_k92;
static PyObject *__pyx_k93;
static PyObject *__pyx_k94;
static PyObject *__pyx_k95;
static PyObject *__pyx_k96;
static PyObject *__pyx_k97;
static PyObject *__pyx_k98;
static PyObject *__pyx_k99;
static PyObject *__pyx_k100;
static PyObject *__pyx_k101;
static PyObject *__pyx_k102;
static PyObject *__pyx_k103;
static PyObject *__pyx_k104;
static PyObject *__pyx_k105;
static struct LxmlElement *__pyx_k106;
static PyObject *__pyx_k107;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k108;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k109;
static PyObject *__pyx_k110;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k111;
static PyObject *__pyx_k112;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k113;
static PyObject *__pyx_k114;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k115;
static PyObject *__pyx_k116;
static PyObject *__pyx_k117;
static PyObject *__pyx_k119;
static PyObject *__pyx_k120;
static PyObject *__pyx_k121;
static PyObject *__pyx_k123;
static PyObject *__pyx_k124;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k125;
static PyObject *__pyx_k127;
static struct LxmlElementClassLookup *__pyx_k146;
static PyObject *__pyx_k147;
static PyObject *__pyx_k148;
static PyObject *__pyx_k149;
static PyObject *__pyx_k150;
static struct LxmlElementClassLookup *__pyx_k151;
static struct LxmlElementClassLookup *__pyx_k152;
static struct LxmlElementClassLookup *__pyx_k153;
static struct LxmlElementClassLookup *__pyx_k154;
static struct LxmlElementClassLookup *__pyx_k155;
static struct LxmlElementClassLookup *__pyx_k160;
static PyObject *__pyx_k161;
static struct __pyx_obj_4lxml_5etree_Resolver *__pyx_k162;
static struct LxmlElementClassLookup *__pyx_k169;
static struct LxmlElementClassLookup *__pyx_k170;
static PyObject *__pyx_k171;
static PyObject *__pyx_k172;
static PyObject *__pyx_k173;
static PyObject *__pyx_k174;
static PyObject *__pyx_k175;
static PyObject *__pyx_k176;
static PyObject *__pyx_k177;
static PyObject *__pyx_k178;
static PyObject *__pyx_k179;
static PyObject *__pyx_k180;
static PyObject *__pyx_k181;
static PyObject *__pyx_k182;
static PyObject *__pyx_k183;
static PyObject *__pyx_k184;
static PyObject *__pyx_k185;
static PyObject *__pyx_k186;
static PyObject *__pyx_k187;
static PyObject *__pyx_k188;
static PyObject *__pyx_k189;
static PyObject *__pyx_k190;
static PyObject *__pyx_k191;
static PyObject *__pyx_k192;
static PyObject *__pyx_k193;
static PyObject *__pyx_k194;
static PyObject *__pyx_k195;
static PyObject *__pyx_k196;
static PyObject *__pyx_k197;
static PyObject *__pyx_k198;
static PyObject *__pyx_k199;
static PyObject *__pyx_k200;
static PyObject *__pyx_k201;
static PyObject *__pyx_k202;
static struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_k203;
static PyObject *__pyx_k204;
static PyObject *__pyx_k205;
static PyObject *__pyx_k206;
static PyObject *__pyx_k207;
static PyObject *__pyx_k208;
static PyObject *__pyx_k209;
static PyObject *__pyx_k210;
static PyObject *__pyx_k211;
static PyObject *__pyx_k215;
static PyObject *__pyx_k217;
static PyObject *__pyx_k218;
static PyObject *__pyx_k219;
static PyObject *__pyx_k220;
static PyObject *__pyx_k221;
static PyObject *__pyx_k222;
static PyObject *__pyx_k223;
static PyObject *__pyx_k224;
static PyObject *__pyx_k225;
static PyObject *__pyx_k226;
static PyObject *__pyx_k227;
static PyObject *__pyx_k229;
static PyObject *__pyx_k230;
static PyObject *__pyx_k231;
static PyObject *__pyx_k240;
static PyObject *__pyx_k241;
static PyObject *__pyx_k243;
static PyObject *__pyx_k245;
static PyObject *__pyx_k247;
static PyObject *__pyx_k248;
static PyObject *__pyx_k249;
static PyObject *__pyx_k250;
static PyObject *__pyx_k251;
static PyObject *__pyx_k252;
static PyObject *__pyx_k253;
static PyObject *__pyx_k254;
static PyObject *__pyx_k255;
static PyObject *__pyx_k256;
static PyObject *__pyx_k257;
static PyObject *__pyx_k258;
static PyObject *__pyx_k261;
static PyObject *__pyx_k262;
static PyObject *__pyx_k273;
static PyObject *__pyx_k274;
static PyObject *__pyx_k275;
static PyObject *__pyx_k276;
static PyObject *__pyx_k277;
static PyObject *__pyx_k278;
static PyObject *__pyx_k279;
static PyObject *__pyx_k280;
static PyObject *__pyx_k281;
static PyObject *__pyx_k282;
static PyObject *__pyx_k285;
static PyObject *__pyx_k286;
static PyObject *__pyx_k295;
static PyObject *__pyx_k296;
static PyObject *__pyx_k303;
static PyObject *__pyx_k304;
static PyObject *__pyx_k311;
static PyObject *__pyx_k312;
static PyObject *__pyx_k319;
static PyObject *__pyx_k320;
static PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocument *,xmlNode *); /*proto*/
static struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct LxmlDocument *,struct LxmlElement *); /*proto*/
static struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlDocument *,struct LxmlElement *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlElement *,int); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *,PyObject *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *,char *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *,char *,char *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *,char *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree_getProxy(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree_hasProxy(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__registerProxy(struct LxmlElement *); /*proto*/
static int __pyx_f_4lxml_5etree__unregisterProxy(struct LxmlElement *); /*proto*/
static void __pyx_f_4lxml_5etree__releaseProxy(struct LxmlElement *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__destroyFakeDoc(xmlDoc *,xmlDoc *); /*proto*/
static int __pyx_f_4lxml_5etree_attemptDeallocation(xmlNode *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree_getDeallocationTop(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree_canDeallocateChildNodes(xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__copyParentNamespaces(xmlNode *,xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree_displayNode(xmlNode *,PyObject *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__documentOf(PyObject *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOf(PyObject *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree__makeElement(PyObject *,xmlDoc *,struct LxmlDocument *,struct __pyx_obj_4lxml_5etree__BaseParser *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
static struct LxmlElement *__pyx_f_4lxml_5etree__makeSubElement(struct LxmlElement *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__initNodeAttributes(xmlNode *,struct LxmlDocument *,PyObject *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *,xmlAttr *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *,char *,char *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__getAttributeValue(struct LxmlElement *,PyObject *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *,PyObject *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__delAttributeFromNsName(xmlNode *,char *,char *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *,int); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__hasEncodingDeclaration(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__stripDeclaration(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__hasText(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__hasTail(xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__removeText(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__setNodeText(xmlNode *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__setTailText(xmlNode *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__hasChild(xmlNode *); /*proto*/
static Py_ssize_t __pyx_f_4lxml_5etree__countElements(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__findChildSlice(PySliceObject *,xmlNode *,xmlNode **,Py_ssize_t *,Py_ssize_t *); /*proto*/
static int __pyx_f_4lxml_5etree__isFullSlice(PySliceObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__findChild(xmlNode *,Py_ssize_t); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__findChildForwards(xmlNode *,Py_ssize_t); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__findChildBackwards(xmlNode *,Py_ssize_t); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__textNodeOrSkip(xmlNode *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__nextElement(xmlNode *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__previousElement(xmlNode *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__parentElement(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__tagMatches(xmlNode *,char *,char *); /*proto*/
static int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__moveTail(xmlNode *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__copyTail(xmlNode *,xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__deleteSlice(struct LxmlDocument *,xmlNode *,Py_ssize_t,Py_ssize_t); /*proto*/
static int __pyx_f_4lxml_5etree__replaceSlice(struct LxmlElement *,xmlNode *,Py_ssize_t,Py_ssize_t,int,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *,struct LxmlElement *); /*proto*/
static int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *,struct LxmlElement *); /*proto*/
static int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *,struct LxmlElement *); /*proto*/
static int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *,struct LxmlElement *); /*proto*/
static int __pyx_f_4lxml_5etree_isutf8(char *); /*proto*/
static int __pyx_f_4lxml_5etree_isutf8py(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree_funicode(char *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__getNsTag(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__pyXmlNameIsValid(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__pyHtmlNameIsValid(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__xmlNameIsValid(char *); /*proto*/
static int __pyx_f_4lxml_5etree__htmlNameIsValid(char *); /*proto*/
static int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__namespacedName(xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(char *,char *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *); /*proto*/
static void __pyx_f_4lxml_5etree__nullGenericErrorFunc(void *,char *,...); /*proto*/
static void __pyx_f_4lxml_5etree__initThreadLogging(void); /*proto*/
static void __pyx_f_4lxml_5etree_connectErrorLog(void *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree___copyGlobalErrorLog(void); /*proto*/
static void __pyx_f_4lxml_5etree__forwardError(void *,xmlError *); /*proto*/
static void __pyx_f_4lxml_5etree__receiveError(void *,xmlError *); /*proto*/
static void __pyx_f_4lxml_5etree__receiveXSLTError(void *,char *,...); /*proto*/
static void __pyx_f_4lxml_5etree___initErrorConstants(void); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *,struct LxmlDocument *,xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *,struct LxmlDocument *,xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *,struct LxmlDocument *,xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *,struct LxmlDocument *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_lookup_function,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *,struct LxmlDocument *,xmlNode *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__iter_ns_extension_functions(void); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__find_extension(PyObject *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__initResolverContext(struct __pyx_obj_4lxml_5etree__ResolverContext *,struct __pyx_obj_4lxml_5etree__ResolverRegistry *); /*proto*/
static int __pyx_f_4lxml_5etree__checkThreadDict(xmlDict *); /*proto*/
static void __pyx_f_4lxml_5etree__setupPythonUnicode(void); /*proto*/
static char *__pyx_f_4lxml_5etree__findEncodingName(char *,int); /*proto*/
static int __pyx_f_4lxml_5etree__readFilelikeParser(void *,char *,int); /*proto*/
static xmlParserInput *__pyx_f_4lxml_5etree__parser_resolve_from_python(char *,char *,xmlParserCtxt *,int *); /*proto*/
static xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(char *,char *,xmlParserCtxt *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__initParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *,struct __pyx_obj_4lxml_5etree__ResolverRegistry *,xmlParserCtxt *); /*proto*/
static int __pyx_f_4lxml_5etree__raiseParseError(xmlParserCtxt *,PyObject *,struct __pyx_obj_4lxml_5etree__ErrorLog *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__handleParseResult(struct __pyx_obj_4lxml_5etree__ParserContext *,xmlParserCtxt *,xmlDoc *,PyObject *,int); /*proto*/
static int __pyx_f_4lxml_5etree__htmlCtxtResetPush(xmlParserCtxt *,char *,int,char *,int); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxStart(void *,char *,char *,char *,int,char **,int,int,char **); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *,char *,char **); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxEnd(void *,char *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxData(void *,char *,int); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxDoctype(void *,char *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxPI(void *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__handleSaxComment(void *,char *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *,PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFile(PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFilelike(PyObject *,PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__newDoc(void); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__copyDoc(xmlDoc *,int); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__copyDocRoot(xmlDoc *,xmlNode *); /*proto*/
static xmlNode *__pyx_f_4lxml_5etree__copyNodeToDoc(xmlNode *,xmlDoc *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocumentFromURL(PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__parseMemoryDocument(PyObject *,PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static struct LxmlDocument *__pyx_f_4lxml_5etree__parseFilelikeDocument(PyObject *,PyObject *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static int __pyx_f_4lxml_5etree__findOutputMethod(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__textToString(xmlNode *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__tostring(struct LxmlElement *,PyObject *,PyObject *,int,int,int); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__tounicode(struct LxmlElement *,PyObject *,int,int); /*proto*/
static void __pyx_f_4lxml_5etree__writeNodeToBuffer(xmlOutputBuffer *,xmlNode *,char *,int,int,int,int); /*proto*/
static void __pyx_f_4lxml_5etree__writeDeclarationToBuffer(xmlOutputBuffer *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__writeDtdToBuffer(xmlOutputBuffer *,xmlDoc *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__writeTail(xmlOutputBuffer *,xmlNode *,char *,int); /*proto*/
static void __pyx_f_4lxml_5etree__writePrevSiblings(xmlOutputBuffer *,xmlNode *,char *,int); /*proto*/
static void __pyx_f_4lxml_5etree__writeNextSiblings(xmlOutputBuffer *,xmlNode *,char *,int); /*proto*/
static int __pyx_f_4lxml_5etree__writeFilelikeWriter(void *,char *,int); /*proto*/
static int __pyx_f_4lxml_5etree__closeFilelikeWriter(void *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__tofilelike(PyObject *,struct LxmlElement *,PyObject *,PyObject *,int,int,int); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *,struct LxmlElement *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__dumpToFile(PyObject *,xmlNode *,int); /*proto*/
static int __pyx_f_4lxml_5etree__buildIterparseEventFilter(PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__countNsDefs(xmlNode *); /*proto*/
static int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *,PyObject *); /*proto*/
static void __pyx_f_4lxml_5etree__pushSaxStartEvent(xmlParserCtxt *,xmlNode *); /*proto*/
static void __pyx_f_4lxml_5etree__pushSaxEndEvent(xmlParserCtxt *,xmlNode *); /*proto*/
static startElementNsSAX2Func __pyx_f_4lxml_5etree__getOrigStart(xmlParserCtxt *); /*proto*/
static startElementSAXFunc __pyx_f_4lxml_5etree__getOrigStartNoNs(xmlParserCtxt *); /*proto*/
static endElementNsSAX2Func __pyx_f_4lxml_5etree__getOrigEnd(xmlParserCtxt *); /*proto*/
static endElementSAXFunc __pyx_f_4lxml_5etree__getOrigEndNoNs(xmlParserCtxt *); /*proto*/
static void __pyx_f_4lxml_5etree__iterparseSaxStart(void *,char *,char *,char *,int,char **,int,int,char **); /*proto*/
static void __pyx_f_4lxml_5etree__iterparseSaxEnd(void *,char *,char *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__iterparseSaxStartNoNs(void *,char *,char **); /*proto*/
static void __pyx_f_4lxml_5etree__iterparseSaxEndNoNs(void *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__collectIdHashItemDict(void *,void *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__collectIdHashItemList(void *,void *,char *); /*proto*/
static void __pyx_f_4lxml_5etree__collectIdHashKeys(void *,void *,char *); /*proto*/
static xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__unwrapXPathObject(xmlXPathObject *,struct LxmlDocument *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__createNodeSetResult(xmlXPathObject *,struct LxmlDocument *); /*proto*/
static void __pyx_f_4lxml_5etree__freeXPathObject(xmlXPathObject *); /*proto*/
static void __pyx_f_4lxml_5etree__extension_function_call(struct __pyx_obj_4lxml_5etree__BaseContext *,PyObject *,xmlXPathParserContext *,int); /*proto*/
static void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *,int); /*proto*/
static int __pyx_f_4lxml_5etree__register_xpath_function(void *,PyObject *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__unregister_xpath_function(void *,PyObject *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__initXSLTResolverContext(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *,struct __pyx_obj_4lxml_5etree__BaseParser *); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__xslt_resolve_from_python(char *,void *,int,int *); /*proto*/
static void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(char *,void *,xsltLoadType); /*proto*/
static xmlDoc *__pyx_f_4lxml_5etree__xslt_doc_loader(char *,xmlDict *,int,void *,xsltLoadType); /*proto*/
static int __pyx_f_4lxml_5etree__register_xslt_function(void *,PyObject *,PyObject *); /*proto*/
static int __pyx_f_4lxml_5etree__unregister_xslt_function(void *,PyObject *,PyObject *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__xsltResultTreeFactory(struct LxmlDocument *,struct __pyx_obj_4lxml_5etree_XSLT *,struct LxmlDocument *); /*proto*/
static void __pyx_f_4lxml_5etree_initTransformDict(xsltTransformContext *); /*proto*/
static PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *,PyObject *); /*proto*/
static xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *); /*proto*/
static struct __pyx_obj_4lxml_5etree_DTD *__pyx_f_4lxml_5etree__dtdFactory(xmlDtd *); /*proto*/
DL_EXPORT(struct LxmlElement) *deepcopyNodeToDocument(struct LxmlDocument *,xmlNode *); /*proto*/
DL_EXPORT(struct LxmlElementTree) *elementTreeFactory(struct LxmlElement *); /*proto*/
DL_EXPORT(struct LxmlElementTree) *newElementTree(struct LxmlElement *,PyObject *); /*proto*/
DL_EXPORT(struct LxmlElement) *elementFactory(struct LxmlDocument *,xmlNode *); /*proto*/
DL_EXPORT(struct LxmlElement) *makeElement(PyObject *,struct LxmlDocument *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
DL_EXPORT(struct LxmlElement) *makeSubElement(struct LxmlElement *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *); /*proto*/
DL_EXPORT(void) setElementClassLookupFunction(_element_class_lookup_function,PyObject *); /*proto*/
DL_EXPORT(PyObject) *lookupDefaultElementClass(PyObject *,PyObject *,xmlNode *); /*proto*/
DL_EXPORT(PyObject) *lookupNamespaceElementClass(PyObject *,PyObject *,xmlNode *); /*proto*/
DL_EXPORT(PyObject) *callLookupFallback(struct LxmlFallbackElementClassLookup *,struct LxmlDocument *,xmlNode *); /*proto*/
DL_EXPORT(int) tagMatches(xmlNode *,char *,char *); /*proto*/
DL_EXPORT(struct LxmlDocument) *documentOrRaise(PyObject *); /*proto*/
DL_EXPORT(struct LxmlElement) *rootNodeOrRaise(PyObject *); /*proto*/
DL_EXPORT(int) hasText(xmlNode *); /*proto*/
DL_EXPORT(int) hasTail(xmlNode *); /*proto*/
DL_EXPORT(PyObject) *textOf(xmlNode *); /*proto*/
DL_EXPORT(PyObject) *tailOf(xmlNode *); /*proto*/
DL_EXPORT(int) setNodeText(xmlNode *,PyObject *); /*proto*/
DL_EXPORT(int) setTailText(xmlNode *,PyObject *); /*proto*/
DL_EXPORT(PyObject) *attributeValue(xmlNode *,xmlAttr *); /*proto*/
DL_EXPORT(PyObject) *attributeValueFromNsName(xmlNode *,char *,char *); /*proto*/
DL_EXPORT(PyObject) *getAttributeValue(struct LxmlElement *,PyObject *,PyObject *); /*proto*/
DL_EXPORT(PyObject) *iterattributes(struct LxmlElement *,int); /*proto*/
DL_EXPORT(PyObject) *collectAttributes(xmlNode *,int); /*proto*/
DL_EXPORT(int) setAttributeValue(struct LxmlElement *,PyObject *,PyObject *); /*proto*/
DL_EXPORT(int) delAttribute(struct LxmlElement *,PyObject *); /*proto*/
DL_EXPORT(int) delAttributeFromNsName(xmlNode *,char *,char *); /*proto*/
DL_EXPORT(int) hasChild(xmlNode *); /*proto*/
DL_EXPORT(xmlNode) *findChild(xmlNode *,Py_ssize_t); /*proto*/
DL_EXPORT(xmlNode) *findChildForwards(xmlNode *,Py_ssize_t); /*proto*/
DL_EXPORT(xmlNode) *findChildBackwards(xmlNode *,Py_ssize_t); /*proto*/
DL_EXPORT(xmlNode) *nextElement(xmlNode *); /*proto*/
DL_EXPORT(xmlNode) *previousElement(xmlNode *); /*proto*/
DL_EXPORT(void) appendChild(struct LxmlElement *,struct LxmlElement *); /*proto*/
DL_EXPORT(PyObject) *pyunicode(char *); /*proto*/
DL_EXPORT(PyObject) *utf8(PyObject *); /*proto*/
DL_EXPORT(PyObject) *getNsTag(PyObject *); /*proto*/
DL_EXPORT(PyObject) *namespacedName(xmlNode *); /*proto*/
DL_EXPORT(PyObject) *namespacedNameFromNsName(char *,char *); /*proto*/
DL_EXPORT(void) iteratorStoreNext(struct LxmlElementIterator *,struct LxmlElement *); /*proto*/
DL_EXPORT(void) initTagMatch(struct LxmlElementTagMatcher *,PyObject *); /*proto*/
DL_EXPORT(xmlNs) *findOrBuildNodeNsPrefix(struct LxmlDocument *,xmlNode *,char *,char *); /*proto*/


/* Implementation of lxml.etree */

static char __pyx_k1[] = "Returns the name of the root node as defined by the DOCTYPE.";
static char __pyx_k2[] = "Returns the public ID of the DOCTYPE.";
static char __pyx_k3[] = "Returns the system ID of the DOCTYPE.";
static char __pyx_k4[] = "Returns the XML version as declared by the document.";
static char __pyx_k5[] = "Returns the encoding name as declared by the document.";
static char __pyx_k6[] = "Returns the source URL of the document (or None if unknown).";
static char __pyx_k7[] = "Returns a DOCTYPE declaration string for the document.";
static char __pyx_k8[] = "Returns a DTD validator based on the internal subset of the document.";
static char __pyx_k9[] = "Returns a DTD validator based on the external subset of the document.";
static char __pyx_k10[] = "Element tag\n        ";
static char __pyx_k11[] = "Element attribute dictionary. Where possible, use get(), set(),\n        keys(), values() and items() to access element attributes.\n        ";
static char __pyx_k12[] = "Text before the first subelement. This is either a string or \n        the value None, if there was no text.\n        ";
static char __pyx_k13[] = "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        ";
static char __pyx_k14[] = "Namespace prefix or None.\n        ";
static char __pyx_k15[] = "Original line number as found by the parser or None if unknown.\n        ";
static char __pyx_k16[] = "Namespace prefix->URI mapping known in the context of this Element.\n        ";
static char __pyx_k17[] = "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        ";
static char __pyx_k18[] = "The parser that was used to parse the document in this ElementTree.\n        ";
static char __pyx_k19[] = "Namespace prefix for extension functions.";
static char __pyx_k20[] = "The error log of the last parser run.\n        ";
static char __pyx_k21[] = "The version of the underlying XML parser.";
static char __pyx_k22[] = "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        ";
static char __pyx_k23[] = "The error log of the last (or current) parser run.\n        ";
static char __pyx_k24[] = "Return an ElementTree with profiling data for the stylesheet run.\n        ";
static char __pyx_k28[] = "os.path";
static char __pyx_k34[] = "http://www.w3.org/1999/xhtml";
static char __pyx_k36[] = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
static char __pyx_k38[] = "http://schemas.xmlsoap.org/wsdl/";
static char __pyx_k40[] = "http://www.w3.org/2001/XMLSchema";
static char __pyx_k42[] = "http://www.w3.org/2001/XMLSchema-instance";
static char __pyx_k44[] = "http://purl.org/dc/elements/1.1/";
static char __pyx_k48[] = "Main exception base class for lxml.  All other exceptions inherit from\n    this one.\n    \nMain exception base class for lxml.  All other exceptions inherit from\n    this one.\n    ";
static char __pyx_k50[] = "Base class for all syntax errors.\n    \nBase class for all syntax errors.\n    ";
static char __pyx_k52[] = "Error during XInclude processing.\n    \nError during XInclude processing.\n    ";
static char __pyx_k54[] = "Error during C14N serialisation.\n    \nError during C14N serialisation.\n    ";
static char __pyx_k55[] = "[0-9]+";
static char __pyx_k56[] = "Unknown libxml2 version:";
static char __pyx_k126[] = "^(\\s*<\\?\\s*xml[^>]+)\\s+encoding\\s*=\\s*\"[^\"]*\"\\s*";
static char __pyx_k129[] = "Libxml2 error levels\nLibxml2 error levels";
static char __pyx_k131[] = "Libxml2 error domains\nLibxml2 error domains";
static char __pyx_k133[] = "Libxml2 error types\nLibxml2 error types";
static char __pyx_k134[] = "NONE=0\nWARNING=1\nERROR=2\nFATAL=3\n";
static char __pyx_k135[] = "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\n";
static char __pyx_k136[] = "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";
static char __pyx_k137[] = "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\nNS_ERR_XML_NAMESPACE=200\nNS_ERR_UNDEFINED_NAMESPACE=201\nNS_ERR_QNAME=202\nNS_ERR_ATTRIBUTE_REDEFINED=203\nNS_ERR_EMPTY=204\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\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\nRNGP_ATTRIBUTE_EMPTY=1004\nRNGP_ATTRIBUTE_NOOP=1005\nRNGP_CHOICE_CONTENT=1006\nRNGP_CHOICE_EMPTY=1007\n";
static char __pyx_k138[] = "RNGP_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\nRNGP_PAT_DATA_EXCEPT_ONEMORE=1075\nRNGP_PAT_DATA_EXCEPT_REF=1076\nRNGP_PAT_DATA_EXCEPT_TEXT=1077\nRNGP_PAT_LIST_ATTR=1078\n";
static char __pyx_k139[] = "RNGP_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\nSAVE_NOT_UTF8=1400\nSAVE_CHAR_INVALID=1401\nSAVE_NO_DOCTYPE=1402\nSAVE_UNKNOWN_ENCODING=1403\nREGEXP_COMPILE_ERROR=1450\n";
static char __pyx_k140[] = "IO_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\nSCHEMAP_EXTENSION_NO_BASE=1707\nSCHEMAP_FACET_NO_VALUE=1708\nSCHEMAP_FAILED_BUILD_IMPORT=1709\nSCHEMAP_GROUP_NONAME_NOREF=1710\n";
static char __pyx_k141[] = "SCHEMAP_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\nSCHEMAP_DEF_AND_PREFIX=1768\nSCHEMAP_UNKNOWN_INCLUDE_CHILD=1769\nSCHEMAP_INCLUDE_SCHEMA_NOT_URI=1770\nSCHEMAP_INCLUDE_SCHEMA_NO_URI=1771\n";
static char __pyx_k142[] = "SCHEMAP_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\nSCHEMAV_CVC_MINLENGTH_VALID=1831\nSCHEMAV_CVC_MAXLENGTH_VALID=1832\nSCHEMAV_CVC_MININCLUSIVE_VALID=1833\nSCHEMAV_CVC_MAXINCLUSIVE_VALID=1834\n";
static char __pyx_k143[] = "SCHEMAV_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\nSCHEMAP_SRC_RESOLVE=3004\nSCHEMAP_SRC_RESTRICTION_BASE_OR_SIMPLETYPE=3005\nSCHEMAP_SRC_LIST_ITEMTYPE_OR_SIMPLETYPE=3006\n";
static char __pyx_k144[] = "SCHEMAP_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\nSCHEMAP_CVC_SIMPLE_TYPE=3062\nSCHEMAP_COS_CT_EXTENDS_1_1=3063\nSCHEMAP_SRC_IMPORT_1_1=3064\nSCHEMAP_SRC_IMPORT_1_2=3065\n";
static char __pyx_k145[] = "SCHEMAP_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\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\nI18N_NO_OUTPUT=6004\nCHECK_=6005\nCHECK_X=6006\n";
static char __pyx_k157[] = "Base class of lxml registry errors.\n    \nBase class of lxml registry errors.\n    ";
static char __pyx_k159[] = "Error registering a namespace extension.\n    \nError registering a namespace extension.\n    ";
static char __pyx_k164[] = "Syntax error while parsing an XML document.\n\n    For compatibility with ElementTree 1.3 and later.\n    \nSyntax error while parsing an XML document.\n\n    For compatibility with ElementTree 1.3 and later.\n    ";
static char __pyx_k166[] = "Syntax error while parsing an XML document.\n    \nSyntax error while parsing an XML document.\n    ";
static char __pyx_k168[] = "Internal lxml parser error.\n    \nInternal lxml parser error.\n    ";
static char __pyx_k233[] = "Base class of all XPath errors.\n    \nBase class of all XPath errors.\n    ";
static char __pyx_k235[] = "Error during XPath evaluation.\n    \nError during XPath evaluation.\n    ";
static char __pyx_k237[] = "Internal error looking up an XPath extension function.\n    \nInternal error looking up an XPath extension function.\n    ";
static char __pyx_k239[] = "Error handling an XPath result.\n    \nError handling an XPath result.\n    ";
static char __pyx_k242[] = "";
static char __pyx_k244[] = "";
static char __pyx_k259[] = "(\"[^\"]*\")|(\'[^\']*\')";
static char __pyx_k260[] = "({[^}]+})";
static char __pyx_k264[] = "Base class of all XSLT errors.\n    \nBase class of all XSLT errors.\n    ";
static char __pyx_k266[] = "Error parsing a stylesheet document.\n    \nError parsing a stylesheet document.\n    ";
static char __pyx_k268[] = "Error running an XSL transformation.\n    \nError running an XSL transformation.\n    ";
static char __pyx_k270[] = "Error serialising an XSLT result.\n    \nError serialising an XSLT result.\n    ";
static char __pyx_k272[] = "Error registering an XSLT extension.\n    \nError registering an XSLT extension.\n    ";
static char __pyx_k283[] = "\\s+(\\w+)\\s*=\\s*[\"\\']([^\"\\']+)[\"\\']";
static char __pyx_k284[] = "\\s+href\\s*=\\s*[\"\\']([^\"\\']+)[\"\\']";
static char __pyx_k288[] = "Validation error.  Raised by all document validators when their\n    ``assertValid(tree)`` method fails.\n    \nValidation error.  Raised by all document validators when their\n    ``assertValid(tree)`` method fails.\n    ";
static char __pyx_k290[] = "Base class for DTD errors.\n    \nBase class for DTD errors.\n    ";
static char __pyx_k292[] = "Error while parsing a DTD.\n    \nError while parsing a DTD.\n    ";
static char __pyx_k294[] = "Error while validating an XML document with a DTD.\n    \nError while validating an XML document with a DTD.\n    ";
static char __pyx_k298[] = "Base class for RelaxNG errors.\n    \nBase class for RelaxNG errors.\n    ";
static char __pyx_k300[] = "Error while parsing an XML document as RelaxNG.\n    \nError while parsing an XML document as RelaxNG.\n    ";
static char __pyx_k302[] = "Error while validating an XML document with a RelaxNG schema.\n    \nError while validating an XML document with a RelaxNG schema.\n    ";
static char __pyx_k306[] = "Base class of all XML Schema errors\n    \nBase class of all XML Schema errors\n    ";
static char __pyx_k308[] = "Error while parsing an XML document as XML Schema.\n    \nError while parsing an XML document as XML Schema.\n    ";
static char __pyx_k310[] = "Error while validating an XML document with an XML Schema.\n    \nError while validating an XML document with an XML Schema.\n    ";
static char __pyx_k314[] = "Base class of all Schematron errors.\n    \nBase class of all Schematron errors.\n    ";
static char __pyx_k316[] = "Error while parsing an XML document as Schematron schema.\n    \nError while parsing an XML document as Schematron schema.\n    ";
static char __pyx_k318[] = "Error while validating an XML document with a Schematron schema.\n    \nError while validating an XML document with a Schematron schema.\n    ";

static PyObject *__pyx_num_0;
static PyObject *__pyx_num_32768;

static PyObject *__pyx_n___init__;
static PyObject *__pyx_n___str__;
static PyObject *__pyx_n___hash__;
static PyObject *__pyx_n___richcmp__;
static PyObject *__pyx_n___dealloc__;
static PyObject *__pyx_n__init;
static PyObject *__pyx_n___setitem__;
static PyObject *__pyx_n___delitem__;
static PyObject *__pyx_n___deepcopy__;
static PyObject *__pyx_n___copy__;
static PyObject *__pyx_n_set;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_addnext;
static PyObject *__pyx_n_addprevious;
static PyObject *__pyx_n_extend;
static PyObject *__pyx_n_clear;
static PyObject *__pyx_n_insert;
static PyObject *__pyx_n_remove;
static PyObject *__pyx_n_replace;
static PyObject *__pyx_n___repr__;
static PyObject *__pyx_n___getitem__;
static PyObject *__pyx_n___len__;
static PyObject *__pyx_n___nonzero__;
static PyObject *__pyx_n___contains__;
static PyObject *__pyx_n___iter__;
static PyObject *__pyx_n___reversed__;
static PyObject *__pyx_n_index;
static PyObject *__pyx_n_get;
static PyObject *__pyx_n_keys;
static PyObject *__pyx_n_values;
static PyObject *__pyx_n_items;
static PyObject *__pyx_n_getchildren;
static PyObject *__pyx_n_getparent;
static PyObject *__pyx_n_getnext;
static PyObject *__pyx_n_getprevious;
static PyObject *__pyx_n_itersiblings;
static PyObject *__pyx_n_iterancestors;
static PyObject *__pyx_n_iterdescendants;
static PyObject *__pyx_n_iterchildren;
static PyObject *__pyx_n_getroottree;
static PyObject *__pyx_n_getiterator;
static PyObject *__pyx_n_iter;
static PyObject *__pyx_n_itertext;
static PyObject *__pyx_n_makeelement;
static PyObject *__pyx_n_find;
static PyObject *__pyx_n_findtext;
static PyObject *__pyx_n_findall;
static PyObject *__pyx_n_iterfind;
static PyObject *__pyx_n_xpath;
static PyObject *__pyx_n___setslice__;
static PyObject *__pyx_n_parse;
static PyObject *__pyx_n__setroot;
static PyObject *__pyx_n_getroot;
static PyObject *__pyx_n_write;
static PyObject *__pyx_n_getpath;
static PyObject *__pyx_n_xslt;
static PyObject *__pyx_n_relaxng;
static PyObject *__pyx_n_xmlschema;
static PyObject *__pyx_n_xinclude;
static PyObject *__pyx_n_write_c14n;
static PyObject *__pyx_n_update;
static PyObject *__pyx_n_pop;
static PyObject *__pyx_n_iterkeys;
static PyObject *__pyx_n_itervalues;
static PyObject *__pyx_n_iteritems;
static PyObject *__pyx_n_has_key;
static PyObject *__pyx_n___next__;
static PyObject *__pyx_n_copy;
static PyObject *__pyx_n_filter_domains;
static PyObject *__pyx_n_filter_types;
static PyObject *__pyx_n_filter_levels;
static PyObject *__pyx_n_filter_from_level;
static PyObject *__pyx_n_filter_from_fatals;
static PyObject *__pyx_n_filter_from_errors;
static PyObject *__pyx_n_filter_from_warnings;
static PyObject *__pyx_n_receive;
static PyObject *__pyx_n_log;
static PyObject *__pyx_n_setFallback;
static PyObject *__pyx_n_lookup;
static PyObject *__pyx_n_get_namespace;
static PyObject *__pyx_n_resolve;
static PyObject *__pyx_n_resolve_empty;
static PyObject *__pyx_n_resolve_string;
static PyObject *__pyx_n_resolve_filename;
static PyObject *__pyx_n_resolve_file;
static PyObject *__pyx_n_add;
static PyObject *__pyx_n_setElementClassLookup;
static PyObject *__pyx_n_set_element_class_lookup;
static PyObject *__pyx_n_feed;
static PyObject *__pyx_n_close;
static PyObject *__pyx_n_data;
static PyObject *__pyx_n_start;
static PyObject *__pyx_n_end;
static PyObject *__pyx_n_pi;
static PyObject *__pyx_n_comment;
static PyObject *__pyx_n___cmp__;
static PyObject *__pyx_n_test;
static PyObject *__pyx_n_match;
static PyObject *__pyx_n_evaluate;
static PyObject *__pyx_n_registerNamespace;
static PyObject *__pyx_n_registerNamespaces;
static PyObject *__pyx_n___call__;
static PyObject *__pyx_n_apply;
static PyObject *__pyx_n_tostring;
static PyObject *__pyx_n___unicode__;
static PyObject *__pyx_n_parseXSL;
static PyObject *__pyx_n_validate;
static PyObject *__pyx_n_assertValid;
static PyObject *__pyx_n_assert_;
static PyObject *__pyx_n___builtin__;
static PyObject *__pyx_n_AttributeError;
static PyObject *__pyx_n_sets;
static PyObject *__pyx_n_Set;
static PyObject *__pyx_n_join;
static PyObject *__pyx_n__elementpath;
static PyObject *__pyx_n_sys;
static PyObject *__pyx_n_re;
static PyObject *__pyx_n_DEBUG;
static PyObject *__pyx_n_getfilesystemencoding;
static PyObject *__pyx_n_getdefaultencoding;
static PyObject *__pyx_n_ascii;
static PyObject *__pyx_n_html;
static PyObject *__pyx_n_rdf;
static PyObject *__pyx_n_wsdl;
static PyObject *__pyx_n_xs;
static PyObject *__pyx_n_xsi;
static PyObject *__pyx_n_dc;
static PyObject *__pyx_n_Error;
static PyObject *__pyx_n_Exception;
static PyObject *__pyx_n_LxmlError;
static PyObject *__pyx_n__superError;
static PyObject *__pyx_n_LxmlSyntaxError;
static PyObject *__pyx_n_SyntaxError;
static PyObject *__pyx_n_XIncludeError;
static PyObject *__pyx_n_C14NError;
static PyObject *__pyx_n_group;
static PyObject *__pyx_n_LIBXML_VERSION;
static PyObject *__pyx_n_LIBXML_COMPILED_VERSION;
static PyObject *__pyx_n_LXML_VERSION;
static PyObject *__pyx_n___version__;
static PyObject *__pyx_n_xml;
static PyObject *__pyx_n_ProcessingInstruction;
static PyObject *__pyx_n_PI;
static PyObject *__pyx_n_compile;
static PyObject *__pyx_n_U;
static PyObject *__pyx_n_sub;
static PyObject *__pyx_n_ErrorLevels;
static PyObject *__pyx_n_ErrorDomains;
static PyObject *__pyx_n_ErrorTypes;
static PyObject *__pyx_n_LxmlRegistryError;
static PyObject *__pyx_n_NamespaceRegistryError;
static PyObject *__pyx_n_ParseError;
static PyObject *__pyx_n_XMLSyntaxError;
static PyObject *__pyx_n_ParserError;
static PyObject *__pyx_n_inspect;
static PyObject *__pyx_n_getargspec;
static PyObject *__pyx_n__TargetParserResult;
static PyObject *__pyx_n_XPathError;
static PyObject *__pyx_n_XPathEvalError;
static PyObject *__pyx_n_XPathFunctionError;
static PyObject *__pyx_n_XPathResultError;
static PyObject *__pyx_n_XPathSyntaxError;
static PyObject *__pyx_n_XSLTError;
static PyObject *__pyx_n_XSLTParseError;
static PyObject *__pyx_n_XSLTApplyError;
static PyObject *__pyx_n_XSLTSaveError;
static PyObject *__pyx_n_XSLTExtensionError;
static PyObject *__pyx_n_LIBXSLT_COMPILED_VERSION;
static PyObject *__pyx_n_LIBXSLT_VERSION;
static PyObject *__pyx_n_DocumentInvalid;
static PyObject *__pyx_n_DTDError;
static PyObject *__pyx_n_DTDParseError;
static PyObject *__pyx_n_DTDValidateError;
static PyObject *__pyx_n_RelaxNGError;
static PyObject *__pyx_n_RelaxNGParseError;
static PyObject *__pyx_n_RelaxNGValidateError;
static PyObject *__pyx_n_XMLSchemaError;
static PyObject *__pyx_n_XMLSchemaParseError;
static PyObject *__pyx_n_XMLSchemaValidateError;
static PyObject *__pyx_n_SchematronError;
static PyObject *__pyx_n_SchematronParseError;
static PyObject *__pyx_n_SchematronValidateError;

static PyObject *__pyx_k28p;
static PyObject *__pyx_k34p;
static PyObject *__pyx_k36p;
static PyObject *__pyx_k38p;
static PyObject *__pyx_k40p;
static PyObject *__pyx_k42p;
static PyObject *__pyx_k44p;
static PyObject *__pyx_k48p;
static PyObject *__pyx_k50p;
static PyObject *__pyx_k52p;
static PyObject *__pyx_k54p;
static PyObject *__pyx_k55p;
static PyObject *__pyx_k56p;
static PyObject *__pyx_k126p;
static PyObject *__pyx_k129p;
static PyObject *__pyx_k131p;
static PyObject *__pyx_k133p;
static PyObject *__pyx_k134p;
static PyObject *__pyx_k135p;
static PyObject *__pyx_k136p;
static PyObject *__pyx_k137p;
static PyObject *__pyx_k138p;
static PyObject *__pyx_k139p;
static PyObject *__pyx_k140p;
static PyObject *__pyx_k141p;
static PyObject *__pyx_k142p;
static PyObject *__pyx_k143p;
static PyObject *__pyx_k144p;
static PyObject *__pyx_k145p;
static PyObject *__pyx_k157p;
static PyObject *__pyx_k159p;
static PyObject *__pyx_k164p;
static PyObject *__pyx_k166p;
static PyObject *__pyx_k168p;
static PyObject *__pyx_k233p;
static PyObject *__pyx_k235p;
static PyObject *__pyx_k237p;
static PyObject *__pyx_k239p;
static PyObject *__pyx_k242p;
static PyObject *__pyx_k244p;
static PyObject *__pyx_k259p;
static PyObject *__pyx_k260p;
static PyObject *__pyx_k264p;
static PyObject *__pyx_k266p;
static PyObject *__pyx_k268p;
static PyObject *__pyx_k270p;
static PyObject *__pyx_k272p;
static PyObject *__pyx_k283p;
static PyObject *__pyx_k284p;
static PyObject *__pyx_k288p;
static PyObject *__pyx_k290p;
static PyObject *__pyx_k292p;
static PyObject *__pyx_k294p;
static PyObject *__pyx_k298p;
static PyObject *__pyx_k300p;
static PyObject *__pyx_k302p;
static PyObject *__pyx_k306p;
static PyObject *__pyx_k308p;
static PyObject *__pyx_k310p;
static PyObject *__pyx_k314p;
static PyObject *__pyx_k316p;
static PyObject *__pyx_k318p;

static PyObject *__pyx_builtin_AttributeError;
static PyObject *__pyx_builtin_Exception;
static PyObject *__pyx_builtin_SyntaxError;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":96
 *     this one.
 *     """
 *     def __init__(self, *args):             # <<<<<<<<<<<<<< 
 *         _initError(self, *args)
 *         self.error_log = __copyGlobalErrorLog()
 */

static PyObject *__pyx_n_error_log;

static PyObject *__pyx_pf_4lxml_5etree_9LxmlError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4lxml_5etree_9LxmlError___init__ = {"__init__", (PyCFunction)__pyx_pf_4lxml_5etree_9LxmlError___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pf_4lxml_5etree_9LxmlError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"self",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_self))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_args);
  return NULL;
}
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":97
 *     """
 *     def __init__(self, *args):
 *         _initError(self, *args)             # <<<<<<<<<<<<<< 
 *         self.error_log = __copyGlobalErrorLog()
 * 
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":97
 *     """
 *     def __init__(self, *args):
 *         _initError(self, *args)             # <<<<<<<<<<<<<< 
 *         self.error_log = __copyGlobalErrorLog()
 * 
 */
__pyx_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyObject_CallObject(__pyx_v_4lxml_5etree__initError, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":98
 *     def __init__(self, *args):
 *         _initError(self, *args)
 *         self.error_log = __copyGlobalErrorLog()             # <<<<<<<<<<<<<< 
 * 
 * cdef object _LxmlError
 */
__pyx_2 = __pyx_f_4lxml_5etree___copyGlobalErrorLog(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":98
 *     def __init__(self, *args):
 *         _initError(self, *args)
 *         self.error_log = __copyGlobalErrorLog()             # <<<<<<<<<<<<<< 
 * 
 * cdef object _LxmlError
 */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_error_log, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.LxmlError.__init__");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF(__pyx_v_self);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":103
 * _LxmlError = LxmlError
 * 
 * def _superError(obj, *args):             # <<<<<<<<<<<<<< 
 *     super(_LxmlError, obj).__init__(*args)
 * 
 */

static PyObject *__pyx_n_super;

static PyObject *__pyx_builtin_super;

static PyObject *__pyx_pf_4lxml_5etree__superError(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree__superError(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_obj = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"obj",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_obj))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_args);
  return NULL;
}
Py_INCREF(__pyx_v_obj);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":104
 * 
 * def _superError(obj, *args):
 *     super(_LxmlError, obj).__init__(*args)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _initError
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_INCREF(__pyx_v_4lxml_5etree__LxmlError);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_4lxml_5etree__LxmlError);
Py_INCREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_obj);
__pyx_2 = PyObject_CallObject(__pyx_builtin_super, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":104
 * 
 * def _superError(obj, *args):
 *     super(_LxmlError, obj).__init__(*args)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _initError
 */
__pyx_2 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._superError");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF(__pyx_v_obj);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":132
 * 
 * # version information
 * cdef __unpackDottedVersion(version):             # <<<<<<<<<<<<<< 
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]
 */

static PyObject *__pyx_num_4;
static PyObject *__pyx_num_neg_300;
static PyObject *__pyx_num_neg_200;
static PyObject *__pyx_num_neg_100;

static PyObject *__pyx_n_split;
static PyObject *__pyx_n_ValueError;
static PyObject *__pyx_n_startswith;
static PyObject *__pyx_n_dev;
static PyObject *__pyx_n_alpha;
static PyObject *__pyx_n_beta;

static PyObject *__pyx_k321p;
static PyObject *__pyx_k322p;
static PyObject *__pyx_k323p;

static PyObject *__pyx_builtin_ValueError;

static char __pyx_k321[] = "-";
static char __pyx_k322[] = ".";
static char __pyx_k323[] = ".";

static  PyObject *__pyx_f_4lxml_5etree___unpackDottedVersion(PyObject *__pyx_v_version) {
PyObject *__pyx_v_version_list;
PyObject *__pyx_v_l;
PyObject *__pyx_v_item;
PyObject *__pyx_v_count;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
int __pyx_5;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
PyObject *__pyx_8 = 0;
PyObject *__pyx_9 = 0;
int __pyx_10;
Py_INCREF(__pyx_v_version);
__pyx_v_version_list = Py_None; Py_INCREF(Py_None);
__pyx_v_l = Py_None; Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);
__pyx_v_count = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":133
 * # version information
 * cdef __unpackDottedVersion(version):
 *     version_list = []             # <<<<<<<<<<<<<< 
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]
 *     for item in l:
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
Py_DECREF(__pyx_v_version_list);
__pyx_v_version_list = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_version, __pyx_n_replace); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_INCREF(__pyx_k321p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k321p);
Py_INCREF(__pyx_k322p);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_k322p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_split); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_INCREF(__pyx_k323p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k323p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_INCREF(__pyx_num_0);
PyList_SET_ITEM(__pyx_1, 0, __pyx_num_0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_2 = PyNumber_Multiply(__pyx_1, __pyx_num_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyNumber_Add(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":134
 * cdef __unpackDottedVersion(version):
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]             # <<<<<<<<<<<<<< 
 *     for item in l:
 *         try:
 */
__pyx_3 = PySequence_GetSlice(__pyx_1, 0, 4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_l);
__pyx_v_l = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":135
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]
 *     for item in l:             # <<<<<<<<<<<<<< 
 *         try:
 *             item = int(item)
 */
if (PyList_CheckExact(__pyx_v_l)) { __pyx_4 = 0; __pyx_2 = __pyx_v_l; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_v_l); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":135
 *     version_list = []
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]
 *     for item in l:             # <<<<<<<<<<<<<< 
 *         try:
 *             item = int(item)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_1 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_1); }
  else {
    __pyx_1 = PyIter_Next(__pyx_2);
    if (!__pyx_1) {
      break;
    }
  }
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":136
 *     l = (version.replace('-', '.').split('.') + [0]*4)[:4]
 *     for item in l:
 *         try:             # <<<<<<<<<<<<<< 
 *             item = int(item)
 *         except ValueError:
 */
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":137
 *     for item in l:
 *         try:
 *             item = int(item)             # <<<<<<<<<<<<<< 
 *         except ValueError:
 *             if item.startswith('dev'):
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L4;}
    Py_INCREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_item);
    __pyx_1 = PyObject_CallObject(((PyObject*)&PyInt_Type), __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; goto __pyx_L4;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_item);
    __pyx_v_item = __pyx_1;
    __pyx_1 = 0;
  }
  goto __pyx_L5;
  __pyx_L4:;
  Py_XDECREF(__pyx_3); __pyx_3 = 0;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":138
 *         try:
 *             item = int(item)
 *         except ValueError:             # <<<<<<<<<<<<<< 
 *             if item.startswith('dev'):
 *                 count = item[3:]
 */
  __pyx_5 = PyErr_ExceptionMatches(__pyx_builtin_ValueError);
  if (__pyx_5) {
    __Pyx_AddTraceback("lxml.etree.__unpackDottedVersion");
    if (__Pyx_GetException(&__pyx_3, &__pyx_1, &__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":139
 *             item = int(item)
 *         except ValueError:
 *             if item.startswith('dev'):             # <<<<<<<<<<<<<< 
 *                 count = item[3:]
 *                 item = -300
 */
    __pyx_7 = PyObject_GetAttr(__pyx_v_item, __pyx_n_startswith); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":139
 *             item = int(item)
 *         except ValueError:
 *             if item.startswith('dev'):             # <<<<<<<<<<<<<< 
 *                 count = item[3:]
 *                 item = -300
 */
    __pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
    Py_INCREF(__pyx_n_dev);
    PyTuple_SET_ITEM(__pyx_8, 0, __pyx_n_dev);
    __pyx_9 = PyObject_CallObject(__pyx_7, __pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    __pyx_10 = __Pyx_PyObject_IsTrue(__pyx_9); if (unlikely(__pyx_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
    Py_DECREF(__pyx_9); __pyx_9 = 0;
    if (__pyx_10) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":140
 *         except ValueError:
 *             if item.startswith('dev'):
 *                 count = item[3:]             # <<<<<<<<<<<<<< 
 *                 item = -300
 *             elif item.startswith('alpha'):
 */
      __pyx_7 = PySequence_GetSlice(__pyx_v_item, 3, PY_SSIZE_T_MAX); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
      Py_DECREF(__pyx_v_count);
      __pyx_v_count = __pyx_7;
      __pyx_7 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":141
 *             if item.startswith('dev'):
 *                 count = item[3:]
 *                 item = -300             # <<<<<<<<<<<<<< 
 *             elif item.startswith('alpha'):
 *                 count = item[5:]
 */
      Py_INCREF(__pyx_num_neg_300);
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_num_neg_300;
      goto __pyx_L6;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":142
 *                 count = item[3:]
 *                 item = -300
 *             elif item.startswith('alpha'):             # <<<<<<<<<<<<<< 
 *                 count = item[5:]
 *                 item = -200
 */
    __pyx_8 = PyObject_GetAttr(__pyx_v_item, __pyx_n_startswith); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":142
 *                 count = item[3:]
 *                 item = -300
 *             elif item.startswith('alpha'):             # <<<<<<<<<<<<<< 
 *                 count = item[5:]
 *                 item = -200
 */
    __pyx_9 = PyTuple_New(1); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
    Py_INCREF(__pyx_n_alpha);
    PyTuple_SET_ITEM(__pyx_9, 0, __pyx_n_alpha);
    __pyx_7 = PyObject_CallObject(__pyx_8, __pyx_9); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    Py_DECREF(__pyx_9); __pyx_9 = 0;
    __pyx_10 = __Pyx_PyObject_IsTrue(__pyx_7); if (unlikely(__pyx_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    if (__pyx_10) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":143
 *                 item = -300
 *             elif item.startswith('alpha'):
 *                 count = item[5:]             # <<<<<<<<<<<<<< 
 *                 item = -200
 *             elif item.startswith('beta'):
 */
      __pyx_8 = PySequence_GetSlice(__pyx_v_item, 5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; goto __pyx_L1;}
      Py_DECREF(__pyx_v_count);
      __pyx_v_count = __pyx_8;
      __pyx_8 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":144
 *             elif item.startswith('alpha'):
 *                 count = item[5:]
 *                 item = -200             # <<<<<<<<<<<<<< 
 *             elif item.startswith('beta'):
 *                 count = item[4:]
 */
      Py_INCREF(__pyx_num_neg_200);
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_num_neg_200;
      goto __pyx_L6;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":145
 *                 count = item[5:]
 *                 item = -200
 *             elif item.startswith('beta'):             # <<<<<<<<<<<<<< 
 *                 count = item[4:]
 *                 item = -100
 */
    __pyx_9 = PyObject_GetAttr(__pyx_v_item, __pyx_n_startswith); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":145
 *                 count = item[5:]
 *                 item = -200
 *             elif item.startswith('beta'):             # <<<<<<<<<<<<<< 
 *                 count = item[4:]
 *                 item = -100
 */
    __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_INCREF(__pyx_n_beta);
    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_n_beta);
    __pyx_8 = PyObject_CallObject(__pyx_9, __pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_9); __pyx_9 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __pyx_10 = __Pyx_PyObject_IsTrue(__pyx_8); if (unlikely(__pyx_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    if (__pyx_10) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":146
 *                 item = -200
 *             elif item.startswith('beta'):
 *                 count = item[4:]             # <<<<<<<<<<<<<< 
 *                 item = -100
 *             else:
 */
      __pyx_9 = PySequence_GetSlice(__pyx_v_item, 4, PY_SSIZE_T_MAX); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L1;}
      Py_DECREF(__pyx_v_count);
      __pyx_v_count = __pyx_9;
      __pyx_9 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":147
 *             elif item.startswith('beta'):
 *                 count = item[4:]
 *                 item = -100             # <<<<<<<<<<<<<< 
 *             else:
 *                 count = 0
 */
      Py_INCREF(__pyx_num_neg_100);
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_num_neg_100;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":149
 *                 item = -100
 *             else:
 *                 count = 0             # <<<<<<<<<<<<<< 
 *             if count:
 *                 item = item + int(count)
 */
      Py_INCREF(__pyx_num_0);
      Py_DECREF(__pyx_v_count);
      __pyx_v_count = __pyx_num_0;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":150
 *             else:
 *                 count = 0
 *             if count:             # <<<<<<<<<<<<<< 
 *                 item = item + int(count)
 *         version_list.append(item)
 */
    __pyx_10 = __Pyx_PyObject_IsTrue(__pyx_v_count); if (unlikely(__pyx_10 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; goto __pyx_L1;}
    if (__pyx_10) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":151
 *                 count = 0
 *             if count:
 *                 item = item + int(count)             # <<<<<<<<<<<<<< 
 *         version_list.append(item)
 *     return tuple(version_list)
 */
      __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
      Py_INCREF(__pyx_v_count);
      PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_count);
      __pyx_8 = PyObject_CallObject(((PyObject*)&PyInt_Type), __pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_9 = PyNumber_Add(__pyx_v_item, __pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_9;
      __pyx_9 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    goto __pyx_L5;
  }
  goto __pyx_L1;
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":152
 *             if count:
 *                 item = item + int(count)
 *         version_list.append(item)             # <<<<<<<<<<<<<< 
 *     return tuple(version_list)
 * 
 */
  __pyx_7 = PyObject_GetAttr(__pyx_v_version_list, __pyx_n_append); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":152
 *             if count:
 *                 item = item + int(count)
 *         version_list.append(item)             # <<<<<<<<<<<<<< 
 *     return tuple(version_list)
 * 
 */
  __pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_INCREF(__pyx_v_item);
  PyTuple_SET_ITEM(__pyx_8, 0, __pyx_v_item);
  __pyx_9 = PyObject_CallObject(__pyx_7, __pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
  Py_DECREF(__pyx_7); __pyx_7 = 0;
  Py_DECREF(__pyx_8); __pyx_8 = 0;
  Py_DECREF(__pyx_9); __pyx_9 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":153
 *                 item = item + int(count)
 *         version_list.append(item)
 *     return tuple(version_list)             # <<<<<<<<<<<<<< 
 * 
 * cdef __unpackIntVersion(int c_version):
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
Py_INCREF(__pyx_v_version_list);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_version_list);
__pyx_1 = PyObject_CallObject(((PyObject*)&PyTuple_Type), __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
Py_XDECREF(__pyx_8);
Py_XDECREF(__pyx_9);
__Pyx_AddTraceback("lxml.etree.__unpackDottedVersion");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_version_list);
Py_DECREF(__pyx_v_l);
Py_DECREF(__pyx_v_item);
Py_DECREF(__pyx_v_count);
Py_DECREF(__pyx_v_version);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":155
 *     return tuple(version_list)
 * 
 * cdef __unpackIntVersion(int c_version):             # <<<<<<<<<<<<<< 
 *     return (
 *         ((c_version / (100*100)) % 100),
 */

static  PyObject *__pyx_f_4lxml_5etree___unpackIntVersion(int __pyx_v_c_version) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":157
 * cdef __unpackIntVersion(int c_version):
 *     return (
 *         ((c_version / (100*100)) % 100),             # <<<<<<<<<<<<<< 
 *         ((c_version / 100)       % 100),
 *         (c_version               % 100)
 */
__pyx_1 = PyInt_FromLong(((__pyx_v_c_version / (100 * 100)) % 100)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":158
 *     return (
 *         ((c_version / (100*100)) % 100),
 *         ((c_version / 100)       % 100),             # <<<<<<<<<<<<<< 
 *         (c_version               % 100)
 *         )
 */
__pyx_2 = PyInt_FromLong(((__pyx_v_c_version / 100) % 100)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":159
 *         ((c_version / (100*100)) % 100),
 *         ((c_version / 100)       % 100),
 *         (c_version               % 100)             # <<<<<<<<<<<<<< 
 *         )
 * 
 */
__pyx_3 = PyInt_FromLong((__pyx_v_c_version % 100)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_2);
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_3);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.__unpackIntVersion");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":179
 * cdef class _TempStore:
 *     cdef object _storage
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         self._storage = []
 * 
 */

static int __pyx_pf_4lxml_5etree_10_TempStore___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_10_TempStore___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":180
 *     cdef object _storage
 *     def __init__(self):
 *         self._storage = []             # <<<<<<<<<<<<<< 
 * 
 *     cdef int add(self, obj) except -1:
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":180
 *     cdef object _storage
 *     def __init__(self):
 *         self._storage = []             # <<<<<<<<<<<<<< 
 * 
 *     cdef int add(self, obj) except -1:
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_v_self)->_storage);
((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_v_self)->_storage = __pyx_1;
__pyx_1 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._TempStore.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":182
 *         self._storage = []
 * 
 *     cdef int add(self, obj) except -1:             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._storage, obj)
 *         return 0
 */

static  int __pyx_f_4lxml_5etree_10_TempStore_add(struct __pyx_obj_4lxml_5etree__TempStore *__pyx_v_self,PyObject *__pyx_v_obj) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_obj);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":183
 * 
 *     cdef int add(self, obj) except -1:
 *         python.PyList_Append(self._storage, obj)             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
__pyx_1 = PyList_Append(__pyx_v_self->_storage,__pyx_v_obj); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":184
 *     cdef int add(self, obj) except -1:
 *         python.PyList_Append(self._storage, obj)
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef int clear(self) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._TempStore.add");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_obj);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":186
 *         return 0
 * 
 *     cdef int clear(self) except -1:             # <<<<<<<<<<<<<< 
 *         del self._storage[:]
 *         return 0
 */

static  int __pyx_f_4lxml_5etree_10_TempStore_clear(struct __pyx_obj_4lxml_5etree__TempStore *__pyx_v_self) {
int __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":187
 * 
 *     cdef int clear(self) except -1:
 *         del self._storage[:]             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
if (PySequence_DelSlice(__pyx_v_self->_storage, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":188
 *     cdef int clear(self) except -1:
 *         del self._storage[:]
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 * # class for temporarily storing exceptions raised in extensions
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._TempStore.clear");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":193
 * cdef class _ExceptionContext:
 *     cdef object _exc_info
 *     cdef void clear(self):             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 * 
 */

static  void __pyx_f_4lxml_5etree_17_ExceptionContext_clear(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":194
 *     cdef object _exc_info
 *     cdef void clear(self):
 *         self._exc_info = None             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _store_raised(self):
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = Py_None;

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":196
 *         self._exc_info = None
 * 
 *     cdef void _store_raised(self):             # <<<<<<<<<<<<<< 
 *         self._exc_info = sys.exc_info()
 * 
 */

static PyObject *__pyx_n_exc_info;

static  void __pyx_f_4lxml_5etree_17_ExceptionContext__store_raised(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":197
 * 
 *     cdef void _store_raised(self):
 *         self._exc_info = sys.exc_info()             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _store_exception(self, exception):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_n_exc_info); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":197
 * 
 *     cdef void _store_raised(self):
 *         self._exc_info = sys.exc_info()             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _store_exception(self, exception):
 */
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = __pyx_2;
__pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("lxml.etree._ExceptionContext._store_raised");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":199
 *         self._exc_info = sys.exc_info()
 * 
 *     cdef void _store_exception(self, exception):             # <<<<<<<<<<<<<< 
 *         self._exc_info = (exception, None, None)
 * 
 */

static  void __pyx_f_4lxml_5etree_17_ExceptionContext__store_exception(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self,PyObject *__pyx_v_exception) {
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_exception);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":200
 * 
 *     cdef void _store_exception(self, exception):
 *         self._exc_info = (exception, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     cdef bint _has_raised(self):
 */
__pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; goto __pyx_L1;}
Py_INCREF(__pyx_v_exception);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_exception);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_1, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_1, 2, Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":200
 * 
 *     cdef void _store_exception(self, exception):
 *         self._exc_info = (exception, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     cdef bint _has_raised(self):
 */
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = __pyx_1;
__pyx_1 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree._ExceptionContext._store_exception");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_exception);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":202
 *         self._exc_info = (exception, None, None)
 * 
 *     cdef bint _has_raised(self):             # <<<<<<<<<<<<<< 
 *         return self._exc_info is not None
 * 
 */

static  int __pyx_f_4lxml_5etree_17_ExceptionContext__has_raised(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":203
 * 
 *     cdef bint _has_raised(self):
 *         return self._exc_info is not None             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _raise_if_stored(self) except -1:
 */
__pyx_1 = (__pyx_v_self->_exc_info != Py_None);
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":205
 *         return self._exc_info is not None
 * 
 *     cdef int _raise_if_stored(self) except -1:             # <<<<<<<<<<<<<< 
 *         if self._exc_info is None:
 *             return 0
 */

static  int __pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored(struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_self) {
PyObject *__pyx_v_type;
PyObject *__pyx_v_value;
PyObject *__pyx_v_traceback;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_type = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_traceback = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":206
 * 
 *     cdef int _raise_if_stored(self) except -1:
 *         if self._exc_info is None:             # <<<<<<<<<<<<<< 
 *             return 0
 *         type, value, traceback = self._exc_info
 */
__pyx_1 = (__pyx_v_self->_exc_info == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":207
 *     cdef int _raise_if_stored(self) except -1:
 *         if self._exc_info is None:
 *             return 0             # <<<<<<<<<<<<<< 
 *         type, value, traceback = self._exc_info
 *         self._exc_info = None
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
if (PyTuple_CheckExact(__pyx_v_self->_exc_info) && PyTuple_GET_SIZE(__pyx_v_self->_exc_info) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_exc_info, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_type);
  __pyx_v_type = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_exc_info, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_exc_info, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_traceback);
  __pyx_v_traceback = __pyx_3;
  __pyx_3 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_v_self->_exc_info); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_type);
  __pyx_v_type = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":208
 *         if self._exc_info is None:
 *             return 0
 *         type, value, traceback = self._exc_info             # <<<<<<<<<<<<<< 
 *         self._exc_info = None
 *         if value is None and traceback is None:
 */
  Py_DECREF(__pyx_v_traceback);
  __pyx_v_traceback = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":209
 *             return 0
 *         type, value, traceback = self._exc_info
 *         self._exc_info = None             # <<<<<<<<<<<<<< 
 *         if value is None and traceback is None:
 *             raise type
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":210
 *         type, value, traceback = self._exc_info
 *         self._exc_info = None
 *         if value is None and traceback is None:             # <<<<<<<<<<<<<< 
 *             raise type
 *         else:
 */
__pyx_1 = (__pyx_v_value == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":210
 *         type, value, traceback = self._exc_info
 *         self._exc_info = None
 *         if value is None and traceback is None:             # <<<<<<<<<<<<<< 
 *             raise type
 *         else:
 */
  __pyx_1 = (__pyx_v_traceback == Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":211
 *         self._exc_info = None
 *         if value is None and traceback is None:
 *             raise type             # <<<<<<<<<<<<<< 
 *         else:
 *             raise type, value, traceback
 */
  __Pyx_Raise(__pyx_v_type, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":213
 *             raise type
 *         else:
 *             raise type, value, traceback             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  __Pyx_Raise(__pyx_v_type, __pyx_v_value, __pyx_v_traceback);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; goto __pyx_L1;}
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ExceptionContext._raise_if_stored");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_type);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_traceback);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":228
 *     """
 *     cdef readonly object text
 *     def __init__(self, text_or_uri, tag=None):             # <<<<<<<<<<<<<< 
 *         if tag is not None:
 *             _tagValidOrRaise(_utf8(tag))
 */

static PyObject *__pyx_k327p;

static char __pyx_k327[] = "{%s}%s";

static int __pyx_pf_4lxml_5etree_5QName___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_5QName___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text_or_uri = 0;
PyObject *__pyx_v_tag = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"text_or_uri","tag",0};
__pyx_v_tag = __pyx_k57;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_text_or_uri, &__pyx_v_tag))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_text_or_uri);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":229
 *     cdef readonly object text
 *     def __init__(self, text_or_uri, tag=None):
 *         if tag is not None:             # <<<<<<<<<<<<<< 
 *             _tagValidOrRaise(_utf8(tag))
 *             text_or_uri = "{%s}%s" % (text_or_uri, tag)
 */
__pyx_1 = (__pyx_v_tag != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":230
 *     def __init__(self, text_or_uri, tag=None):
 *         if tag is not None:
 *             _tagValidOrRaise(_utf8(tag))             # <<<<<<<<<<<<<< 
 *             text_or_uri = "{%s}%s" % (text_or_uri, tag)
 *         else:
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
  __pyx_3 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_2); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":231
 *         if tag is not None:
 *             _tagValidOrRaise(_utf8(tag))
 *             text_or_uri = "{%s}%s" % (text_or_uri, tag)             # <<<<<<<<<<<<<< 
 *         else:
 *             if not _isString(text_or_uri):
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
  Py_INCREF(__pyx_v_text_or_uri);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_text_or_uri);
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_tag);
  __pyx_4 = PyNumber_Remainder(__pyx_k327p, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_text_or_uri);
  __pyx_v_text_or_uri = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":233
 *             text_or_uri = "{%s}%s" % (text_or_uri, tag)
 *         else:
 *             if not _isString(text_or_uri):             # <<<<<<<<<<<<<< 
 *                 text_or_uri = str(text_or_uri)
 *             tag = _getNsTag(text_or_uri)[1]
 */
  __pyx_1 = (!_isString(__pyx_v_text_or_uri));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":234
 *         else:
 *             if not _isString(text_or_uri):
 *                 text_or_uri = str(text_or_uri)             # <<<<<<<<<<<<<< 
 *             tag = _getNsTag(text_or_uri)[1]
 *             _tagValidOrRaise(tag)
 */
    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;}
    Py_INCREF(__pyx_v_text_or_uri);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_text_or_uri);
    __pyx_4 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_text_or_uri);
    __pyx_v_text_or_uri = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":235
 *             if not _isString(text_or_uri):
 *                 text_or_uri = str(text_or_uri)
 *             tag = _getNsTag(text_or_uri)[1]             # <<<<<<<<<<<<<< 
 *             _tagValidOrRaise(tag)
 *         self.text = text_or_uri
 */
  __pyx_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_text_or_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":235
 *             if not _isString(text_or_uri):
 *                 text_or_uri = str(text_or_uri)
 *             tag = _getNsTag(text_or_uri)[1]             # <<<<<<<<<<<<<< 
 *             _tagValidOrRaise(tag)
 *         self.text = text_or_uri
 */
  if (PyList_CheckExact(__pyx_2) && 0 <= 1 && 1 < PyList_GET_SIZE(__pyx_2)) {
    __pyx_5 = PyList_GET_ITEM(__pyx_2, 1); Py_INCREF(__pyx_5);
    } else if (PyTuple_CheckExact(__pyx_2) && 0 <= 1 && 1 < PyTuple_GET_SIZE(__pyx_2)) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_2, 1); Py_INCREF(__pyx_5);
    } else {
    __pyx_4 = PyInt_FromLong(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
    __pyx_5 = PyObject_GetItem(__pyx_2, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":236
 *                 text_or_uri = str(text_or_uri)
 *             tag = _getNsTag(text_or_uri)[1]
 *             _tagValidOrRaise(tag)             # <<<<<<<<<<<<<< 
 *         self.text = text_or_uri
 *     def __str__(self):
 */
  __pyx_3 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":237
 *             tag = _getNsTag(text_or_uri)[1]
 *             _tagValidOrRaise(tag)
 *         self.text = text_or_uri             # <<<<<<<<<<<<<< 
 *     def __str__(self):
 *         return self.text
 */
Py_INCREF(__pyx_v_text_or_uri);
Py_DECREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text = __pyx_v_text_or_uri;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.QName.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_text_or_uri);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":238
 *             _tagValidOrRaise(tag)
 *         self.text = text_or_uri
 *     def __str__(self):             # <<<<<<<<<<<<<< 
 *         return self.text
 *     def __hash__(self):
 */

static PyObject *__pyx_pf_4lxml_5etree_5QName___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_5QName___str__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":239
 *         self.text = text_or_uri
 *     def __str__(self):
 *         return self.text             # <<<<<<<<<<<<<< 
 *     def __hash__(self):
 *         return self.text.__hash__()
 */
Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text);
__pyx_r = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":240
 *     def __str__(self):
 *         return self.text
 *     def __hash__(self):             # <<<<<<<<<<<<<< 
 *         return self.text.__hash__()
 *     def __richcmp__(one, other, int op):
 */

static long __pyx_pf_4lxml_5etree_5QName___hash__(PyObject *__pyx_v_self); /*proto*/
static long __pyx_pf_4lxml_5etree_5QName___hash__(PyObject *__pyx_v_self) {
long __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
long __pyx_3;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":241
 *         return self.text
 *     def __hash__(self):
 *         return self.text.__hash__()             # <<<<<<<<<<<<<< 
 *     def __richcmp__(one, other, int op):
 *         if not _isString(one):
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_self)->text, __pyx_n___hash__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyInt_AsLong(__pyx_2); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 241; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.QName.__hash__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":242
 *     def __hash__(self):
 *         return self.text.__hash__()
 *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<< 
 *         if not _isString(one):
 *             one = str(one)
 */

static PyObject *__pyx_pf_4lxml_5etree_5QName___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_5QName___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_one);
Py_INCREF(__pyx_v_other);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":243
 *         return self.text.__hash__()
 *     def __richcmp__(one, other, int op):
 *         if not _isString(one):             # <<<<<<<<<<<<<< 
 *             one = str(one)
 *         if not _isString(other):
 */
__pyx_1 = (!_isString(__pyx_v_one));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":244
 *     def __richcmp__(one, other, int op):
 *         if not _isString(one):
 *             one = str(one)             # <<<<<<<<<<<<<< 
 *         if not _isString(other):
 *             other = str(other)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
  Py_INCREF(__pyx_v_one);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_one);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_one);
  __pyx_v_one = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":245
 *         if not _isString(one):
 *             one = str(one)
 *         if not _isString(other):             # <<<<<<<<<<<<<< 
 *             other = str(other)
 *         return python.PyObject_RichCompare(one, other, op)
 */
__pyx_1 = (!_isString(__pyx_v_other));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":246
 *             one = str(one)
 *         if not _isString(other):
 *             other = str(other)             # <<<<<<<<<<<<<< 
 *         return python.PyObject_RichCompare(one, other, op)
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_other);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_other);
  __pyx_v_other = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":247
 *         if not _isString(other):
 *             other = str(other)
 *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_one,__pyx_v_other,__pyx_v_op); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 247; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.QName.__richcmp__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_one);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":267
 *     cdef _BaseParser _parser
 *     
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         # if there are no more references to the document, it is safe
 *         # to clean the whole thing up, as all nodes have a reference to
 */

static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_9_Document___dealloc__(PyObject *__pyx_v_self) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":275
 *         #print <long>self._c_doc, self._c_doc.dict is __GLOBAL_PARSER_CONTEXT._c_dict
 *         #print <long>self._c_doc, canDeallocateChildNodes(<xmlNode*>self._c_doc)
 *         tree.xmlFreeDoc(self._c_doc)             # <<<<<<<<<<<<<< 
 *         #_deallocDocument(self._c_doc)
 * 
 */
xmlFreeDoc(((struct LxmlDocument *)__pyx_v_self)->_c_doc);

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":278
 *         #_deallocDocument(self._c_doc)
 * 
 *     cdef getroot(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         c_node = tree.xmlDocGetRootElement(self._c_doc)
 */

static  PyObject *__pyx_f_4lxml_5etree_9_Document_getroot(struct LxmlDocument *__pyx_v_self) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":280
 *     cdef getroot(self):
 *         cdef xmlNode* c_node
 *         c_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             return None
 */
__pyx_v_c_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":281
 *         cdef xmlNode* c_node
 *         c_node = tree.xmlDocGetRootElement(self._c_doc)
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             return None
 *         return _elementFactory(self, c_node)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":282
 *         c_node = tree.xmlDocGetRootElement(self._c_doc)
 *         if c_node is NULL:
 *             return None             # <<<<<<<<<<<<<< 
 *         return _elementFactory(self, c_node)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":283
 *         if c_node is NULL:
 *             return None
 *         return _elementFactory(self, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     cdef getdoctype(self):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 283; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Document.getroot");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":285
 *         return _elementFactory(self, c_node)
 * 
 *     cdef getdoctype(self):             # <<<<<<<<<<<<<< 
 *         cdef tree.xmlDtd* c_dtd
 *         cdef xmlNode* c_root_node
 */

static  PyObject *__pyx_f_4lxml_5etree_9_Document_getdoctype(struct LxmlDocument *__pyx_v_self) {
xmlDtd *__pyx_v_c_dtd;
xmlNode *__pyx_v_c_root_node;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_sys_url;
PyObject *__pyx_v_root_name;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_sys_url = Py_None; Py_INCREF(Py_None);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":288
 *         cdef tree.xmlDtd* c_dtd
 *         cdef xmlNode* c_root_node
 *         public_id = None             # <<<<<<<<<<<<<< 
 *         sys_url   = None
 *         c_dtd = self._c_doc.intSubset
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_public_id);
__pyx_v_public_id = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":289
 *         cdef xmlNode* c_root_node
 *         public_id = None
 *         sys_url   = None             # <<<<<<<<<<<<<< 
 *         c_dtd = self._c_doc.intSubset
 *         if c_dtd is not NULL:
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_sys_url);
__pyx_v_sys_url = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":290
 *         public_id = None
 *         sys_url   = None
 *         c_dtd = self._c_doc.intSubset             # <<<<<<<<<<<<<< 
 *         if c_dtd is not NULL:
 *             if c_dtd.ExternalID is not NULL:
 */
__pyx_v_c_dtd = __pyx_v_self->_c_doc->intSubset;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":291
 *         sys_url   = None
 *         c_dtd = self._c_doc.intSubset
 *         if c_dtd is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)
 */
__pyx_1 = (__pyx_v_c_dtd != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":292
 *         c_dtd = self._c_doc.intSubset
 *         if c_dtd is not NULL:
 *             if c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<< 
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if c_dtd.SystemID is not NULL:
 */
  __pyx_1 = (__pyx_v_c_dtd->ExternalID != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":293
 *         if c_dtd is not NULL:
 *             if c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<< 
 *             if c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 293; goto __pyx_L1;}
    Py_DECREF(__pyx_v_public_id);
    __pyx_v_public_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":294
 *             if c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<< 
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_dtd = self._c_doc.extSubset
 */
  __pyx_1 = (__pyx_v_c_dtd->SystemID != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":295
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<< 
 *         c_dtd = self._c_doc.extSubset
 *         if c_dtd is not NULL:
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; goto __pyx_L1;}
    Py_DECREF(__pyx_v_sys_url);
    __pyx_v_sys_url = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":296
 *             if c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_dtd = self._c_doc.extSubset             # <<<<<<<<<<<<<< 
 *         if c_dtd is not NULL:
 *             if not public_id and c_dtd.ExternalID is not NULL:
 */
__pyx_v_c_dtd = __pyx_v_self->_c_doc->extSubset;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":297
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_dtd = self._c_doc.extSubset
 *         if c_dtd is not NULL:             # <<<<<<<<<<<<<< 
 *             if not public_id and c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)
 */
__pyx_1 = (__pyx_v_c_dtd != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":298
 *         c_dtd = self._c_doc.extSubset
 *         if c_dtd is not NULL:
 *             if not public_id and c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<< 
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if not sys_url and c_dtd.SystemID is not NULL:
 */
  __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 298; goto __pyx_L1;}
  __pyx_1 = (!__pyx_3);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":298
 *         c_dtd = self._c_doc.extSubset
 *         if c_dtd is not NULL:
 *             if not public_id and c_dtd.ExternalID is not NULL:             # <<<<<<<<<<<<<< 
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if not sys_url and c_dtd.SystemID is not NULL:
 */
    __pyx_1 = (__pyx_v_c_dtd->ExternalID != NULL);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":299
 *         if c_dtd is not NULL:
 *             if not public_id and c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)             # <<<<<<<<<<<<<< 
 *             if not sys_url and c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->ExternalID); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; goto __pyx_L1;}
    Py_DECREF(__pyx_v_public_id);
    __pyx_v_public_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":300
 *             if not public_id and c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if not sys_url and c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<< 
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_sys_url); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; goto __pyx_L1;}
  __pyx_3 = (!__pyx_1);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":300
 *             if not public_id and c_dtd.ExternalID is not NULL:
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if not sys_url and c_dtd.SystemID is not NULL:             # <<<<<<<<<<<<<< 
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
 */
    __pyx_3 = (__pyx_v_c_dtd->SystemID != NULL);
  }
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":301
 *                 public_id = funicode(c_dtd.ExternalID)
 *             if not sys_url and c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)             # <<<<<<<<<<<<<< 
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
 *         if c_root_node is NULL:
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_dtd->SystemID); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; goto __pyx_L1;}
    Py_DECREF(__pyx_v_sys_url);
    __pyx_v_sys_url = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":302
 *             if not sys_url and c_dtd.SystemID is not NULL:
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)             # <<<<<<<<<<<<<< 
 *         if c_root_node is NULL:
 *             root_name = None
 */
__pyx_v_c_root_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":303
 *                 sys_url = funicode(c_dtd.SystemID)
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
 *         if c_root_node is NULL:             # <<<<<<<<<<<<<< 
 *             root_name = None
 *         else:
 */
__pyx_1 = (__pyx_v_c_root_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":304
 *         c_root_node = tree.xmlDocGetRootElement(self._c_doc)
 *         if c_root_node is NULL:
 *             root_name = None             # <<<<<<<<<<<<<< 
 *         else:
 *             root_name = funicode(c_root_node.name)
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = Py_None;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":306
 *             root_name = None
 *         else:
 *             root_name = funicode(c_root_node.name)             # <<<<<<<<<<<<<< 
 *         return (root_name, public_id, sys_url)
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_root_node->name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 306; goto __pyx_L1;}
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":307
 *         else:
 *             root_name = funicode(c_root_node.name)
 *         return (root_name, public_id, sys_url)             # <<<<<<<<<<<<<< 
 * 
 *     cdef getxmlinfo(self):
 */
__pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; goto __pyx_L1;}
Py_INCREF(__pyx_v_root_name);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_root_name);
Py_INCREF(__pyx_v_public_id);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_public_id);
Py_INCREF(__pyx_v_sys_url);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_sys_url);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Document.getdoctype");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_sys_url);
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":309
 *         return (root_name, public_id, sys_url)
 * 
 *     cdef getxmlinfo(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlDoc* c_doc
 *         c_doc = self._c_doc
 */

static  PyObject *__pyx_f_4lxml_5etree_9_Document_getxmlinfo(struct LxmlDocument *__pyx_v_self) {
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_v_version;
PyObject *__pyx_v_encoding;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_version = Py_None; Py_INCREF(Py_None);
__pyx_v_encoding = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":311
 *     cdef getxmlinfo(self):
 *         cdef xmlDoc* c_doc
 *         c_doc = self._c_doc             # <<<<<<<<<<<<<< 
 *         if c_doc.version is NULL:
 *             version = None
 */
__pyx_v_c_doc = __pyx_v_self->_c_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":312
 *         cdef xmlDoc* c_doc
 *         c_doc = self._c_doc
 *         if c_doc.version is NULL:             # <<<<<<<<<<<<<< 
 *             version = None
 *         else:
 */
__pyx_1 = (__pyx_v_c_doc->version == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":313
 *         c_doc = self._c_doc
 *         if c_doc.version is NULL:
 *             version = None             # <<<<<<<<<<<<<< 
 *         else:
 *             version = c_doc.version
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_version);
  __pyx_v_version = Py_None;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":315
 *             version = None
 *         else:
 *             version = c_doc.version             # <<<<<<<<<<<<<< 
 *         if c_doc.encoding is NULL:
 *             encoding = None
 */
  __pyx_2 = PyString_FromString(__pyx_v_c_doc->version); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; goto __pyx_L1;}
  Py_DECREF(__pyx_v_version);
  __pyx_v_version = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":316
 *         else:
 *             version = c_doc.version
 *         if c_doc.encoding is NULL:             # <<<<<<<<<<<<<< 
 *             encoding = None
 *         else:
 */
__pyx_1 = (__pyx_v_c_doc->encoding == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":317
 *             version = c_doc.version
 *         if c_doc.encoding is NULL:
 *             encoding = None             # <<<<<<<<<<<<<< 
 *         else:
 *             encoding = c_doc.encoding
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = Py_None;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":319
 *             encoding = None
 *         else:
 *             encoding = c_doc.encoding             # <<<<<<<<<<<<<< 
 *         return (version, encoding)
 * 
 */
  __pyx_2 = PyString_FromString(__pyx_v_c_doc->encoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 319; goto __pyx_L1;}
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":320
 *         else:
 *             encoding = c_doc.encoding
 *         return (version, encoding)             # <<<<<<<<<<<<<< 
 * 
 *     cdef getURL(self):
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; goto __pyx_L1;}
Py_INCREF(__pyx_v_version);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_version);
Py_INCREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_encoding);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Document.getxmlinfo");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_version);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":322
 *         return (version, encoding)
 * 
 *     cdef getURL(self):             # <<<<<<<<<<<<<< 
 *         if self._c_doc.URL is NULL:
 *             return None
 */

static  PyObject *__pyx_f_4lxml_5etree_9_Document_getURL(struct LxmlDocument *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":323
 * 
 *     cdef getURL(self):
 *         if self._c_doc.URL is NULL:             # <<<<<<<<<<<<<< 
 *             return None
 *         else:
 */
__pyx_1 = (__pyx_v_self->_c_doc->URL == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":324
 *     cdef getURL(self):
 *         if self._c_doc.URL is NULL:
 *             return None             # <<<<<<<<<<<<<< 
 *         else:
 *             return self._c_doc.URL
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":326
 *             return None
 *         else:
 *             return self._c_doc.URL             # <<<<<<<<<<<<<< 
 * 
 *     cdef buildNewPrefix(self):
 */
  __pyx_2 = PyString_FromString(__pyx_v_self->_c_doc->URL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Document.getURL");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":328
 *             return self._c_doc.URL
 * 
 *     cdef buildNewPrefix(self):             # <<<<<<<<<<<<<< 
 *         ns = python.PyString_FromFormat("ns%d", self._ns_counter)
 *         if self._prefix_tail is not None:
 */

static PyObject *__pyx_n_A;

static char __pyx_k328[] = "ns%d";

static  PyObject *__pyx_f_4lxml_5etree_9_Document_buildNewPrefix(struct LxmlDocument *__pyx_v_self) {
PyObject *__pyx_v_ns;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":329
 * 
 *     cdef buildNewPrefix(self):
 *         ns = python.PyString_FromFormat("ns%d", self._ns_counter)             # <<<<<<<<<<<<<< 
 *         if self._prefix_tail is not None:
 *             ns = ns + self._prefix_tail
 */
__pyx_1 = PyString_FromFormat(__pyx_k328,__pyx_v_self->_ns_counter); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":330
 *     cdef buildNewPrefix(self):
 *         ns = python.PyString_FromFormat("ns%d", self._ns_counter)
 *         if self._prefix_tail is not None:             # <<<<<<<<<<<<<< 
 *             ns = ns + self._prefix_tail
 *         self._ns_counter = self._ns_counter + 1
 */
__pyx_2 = (__pyx_v_self->_prefix_tail != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":331
 *         ns = python.PyString_FromFormat("ns%d", self._ns_counter)
 *         if self._prefix_tail is not None:
 *             ns = ns + self._prefix_tail             # <<<<<<<<<<<<<< 
 *         self._ns_counter = self._ns_counter + 1
 *         if self._ns_counter < 0:
 */
  __pyx_1 = PyNumber_Add(__pyx_v_ns, __pyx_v_self->_prefix_tail); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":332
 *         if self._prefix_tail is not None:
 *             ns = ns + self._prefix_tail
 *         self._ns_counter = self._ns_counter + 1             # <<<<<<<<<<<<<< 
 *         if self._ns_counter < 0:
 *             # overflow!
 */
__pyx_v_self->_ns_counter = (__pyx_v_self->_ns_counter + 1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":333
 *             ns = ns + self._prefix_tail
 *         self._ns_counter = self._ns_counter + 1
 *         if self._ns_counter < 0:             # <<<<<<<<<<<<<< 
 *             # overflow!
 *             self._ns_counter = 0
 */
__pyx_2 = (__pyx_v_self->_ns_counter < 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":335
 *         if self._ns_counter < 0:
 *             # overflow!
 *             self._ns_counter = 0             # <<<<<<<<<<<<<< 
 *             if self._prefix_tail is None:
 *                 self._prefix_tail = "A"
 */
  __pyx_v_self->_ns_counter = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":336
 *             # overflow!
 *             self._ns_counter = 0
 *             if self._prefix_tail is None:             # <<<<<<<<<<<<<< 
 *                 self._prefix_tail = "A"
 *             else:
 */
  __pyx_2 = (__pyx_v_self->_prefix_tail == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":337
 *             self._ns_counter = 0
 *             if self._prefix_tail is None:
 *                 self._prefix_tail = "A"             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._prefix_tail = self._prefix_tail + "A"
 */
    Py_INCREF(__pyx_n_A);
    Py_DECREF(__pyx_v_self->_prefix_tail);
    __pyx_v_self->_prefix_tail = __pyx_n_A;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":339
 *                 self._prefix_tail = "A"
 *             else:
 *                 self._prefix_tail = self._prefix_tail + "A"             # <<<<<<<<<<<<<< 
 *         return ns
 * 
 */
    __pyx_1 = PyNumber_Add(__pyx_v_self->_prefix_tail, __pyx_n_A); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":339
 *                 self._prefix_tail = "A"
 *             else:
 *                 self._prefix_tail = self._prefix_tail + "A"             # <<<<<<<<<<<<<< 
 *         return ns
 * 
 */
    Py_DECREF(__pyx_v_self->_prefix_tail);
    __pyx_v_self->_prefix_tail = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":340
 *             else:
 *                 self._prefix_tail = self._prefix_tail + "A"
 *         return ns             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,
 */
Py_INCREF(__pyx_v_ns);
__pyx_r = __pyx_v_ns;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Document.buildNewPrefix");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":342
 *         return ns
 * 
 *     cdef xmlNs* _findOrBuildNodeNs(self, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                                    char* c_href, char* c_prefix) except NULL:
 *         """Get or create namespace structure for a node.  Reuses the prefix if
 */

static PyObject *__pyx_k331p;

static char __pyx_k331[] = "invalid node type %d, expected %d";

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) {
xmlNs *__pyx_v_c_ns;
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_prefix;
xmlNs *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
long __pyx_5;
Py_INCREF(__pyx_v_self);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":350
 *         cdef xmlNs* c_doc_ns
 *         cdef python.PyObject* dict_result
 *         if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *             assert c_node.type == tree.XML_ELEMENT_NODE, \
 *                 "invalid node type %d, expected %d" % (
 */
__pyx_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
if (__pyx_1) {
  #ifndef PYREX_WITHOUT_ASSERTIONS

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":351
 *         cdef python.PyObject* dict_result
 *         if c_node.type != tree.XML_ELEMENT_NODE:
 *             assert c_node.type == tree.XML_ELEMENT_NODE, \             # <<<<<<<<<<<<<< 
 *                 "invalid node type %d, expected %d" % (
 *                 c_node.type, tree.XML_ELEMENT_NODE)
 */
  if (unlikely(!(__pyx_v_c_node->type == XML_ELEMENT_NODE))) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":353
 *             assert c_node.type == tree.XML_ELEMENT_NODE, \
 *                 "invalid node type %d, expected %d" % (
 *                 c_node.type, tree.XML_ELEMENT_NODE)             # <<<<<<<<<<<<<< 
 *         # look for existing ns
 *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
 */
    __pyx_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":353
 *             assert c_node.type == tree.XML_ELEMENT_NODE, \
 *                 "invalid node type %d, expected %d" % (
 *                 c_node.type, tree.XML_ELEMENT_NODE)             # <<<<<<<<<<<<<< 
 *         # look for existing ns
 *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
 */
    __pyx_3 = PyInt_FromLong(XML_ELEMENT_NODE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_2 = PyNumber_Remainder(__pyx_k331p, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    PyErr_SetObject(PyExc_AssertionError, __pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; goto __pyx_L1;}
  }
  #endif
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":355
 *                 c_node.type, tree.XML_ELEMENT_NODE)
 *         # look for existing ns
 *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)             # <<<<<<<<<<<<<< 
 *         if c_ns is not NULL:
 *             return c_ns
 */
__pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_self->_c_doc,__pyx_v_c_node,__pyx_v_c_href);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":356
 *         # look for existing ns
 *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
 *         if c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *             return c_ns
 * 
 */
__pyx_1 = (__pyx_v_c_ns != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":357
 *         c_ns = tree.xmlSearchNsByHref(self._c_doc, c_node, c_href)
 *         if c_ns is not NULL:
 *             return c_ns             # <<<<<<<<<<<<<< 
 * 
 *         if c_prefix is NULL:
 */
  __pyx_r = __pyx_v_c_ns;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":359
 *             return c_ns
 * 
 *         if c_prefix is NULL:             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItemString(
 *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
 */
__pyx_1 = (__pyx_v_c_prefix == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":361
 *         if c_prefix is NULL:
 *             dict_result = python.PyDict_GetItemString(
 *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)             # <<<<<<<<<<<<<< 
 *             if dict_result is not NULL:
 *                 c_prefix = _cstr(<object>dict_result)
 */
  __pyx_v_dict_result = PyDict_GetItemString(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES,__pyx_v_c_href);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":362
 *             dict_result = python.PyDict_GetItemString(
 *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
 *             if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_prefix = _cstr(<object>dict_result)
 * 
 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":363
 *                 _DEFAULT_NAMESPACE_PREFIXES, c_href)
 *             if dict_result is not NULL:
 *                 c_prefix = _cstr(<object>dict_result)             # <<<<<<<<<<<<<< 
 * 
 *         if c_prefix is NULL or \
 */
    __pyx_3 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_3);
    __pyx_v_c_prefix = _cstr(__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":365
 *                 c_prefix = _cstr(<object>dict_result)
 * 
 *         if c_prefix is NULL or \             # <<<<<<<<<<<<<< 
 *                tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
 *             # try to simulate ElementTree's namespace prefix creation
 */
__pyx_1 = (__pyx_v_c_prefix == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":366
 * 
 *         if c_prefix is NULL or \
 *                tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:             # <<<<<<<<<<<<<< 
 *             # try to simulate ElementTree's namespace prefix creation
 *             while 1:
 */
  __pyx_1 = (xmlSearchNs(__pyx_v_self->_c_doc,__pyx_v_c_node,__pyx_v_c_prefix) != NULL);
}
if (__pyx_1) {
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":368
 *                tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is not NULL:
 *             # try to simulate ElementTree's namespace prefix creation
 *             while 1:             # <<<<<<<<<<<<<< 
 *                 prefix = self.buildNewPrefix()
 *                 c_prefix = _cstr(prefix)
 */
    __pyx_5 = 1;
    if (!__pyx_5) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":369
 *             # try to simulate ElementTree's namespace prefix creation
 *             while 1:
 *                 prefix = self.buildNewPrefix()             # <<<<<<<<<<<<<< 
 *                 c_prefix = _cstr(prefix)
 *                 # make sure it's not used already
 */
    __pyx_4 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->buildNewPrefix(__pyx_v_self); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":370
 *             while 1:
 *                 prefix = self.buildNewPrefix()
 *                 c_prefix = _cstr(prefix)             # <<<<<<<<<<<<<< 
 *                 # make sure it's not used already
 *                 if tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is NULL:
 */
    __pyx_v_c_prefix = _cstr(__pyx_v_prefix);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":372
 *                 c_prefix = _cstr(prefix)
 *                 # make sure it's not used already
 *                 if tree.xmlSearchNs(self._c_doc, c_node, c_prefix) is NULL:             # <<<<<<<<<<<<<< 
 *                     break
 * 
 */
    __pyx_1 = (xmlSearchNs(__pyx_v_self->_c_doc,__pyx_v_c_node,__pyx_v_c_prefix) == NULL);
    if (__pyx_1) {
      goto __pyx_L8;
      goto __pyx_L9;
    }
    __pyx_L9:;
  }
  __pyx_L8:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":375
 *                     break
 * 
 *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)             # <<<<<<<<<<<<<< 
 *         if c_ns is NULL:
 *             python.PyErr_NoMemory()
 */
__pyx_v_c_ns = xmlNewNs(__pyx_v_c_node,__pyx_v_c_href,__pyx_v_c_prefix);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":376
 * 
 *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 *         if c_ns is NULL:             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 *         return c_ns
 */
__pyx_1 = (__pyx_v_c_ns == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":377
 *         c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 *         if c_ns is NULL:
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *         return c_ns
 * 
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":378
 *         if c_ns is NULL:
 *             python.PyErr_NoMemory()
 *         return c_ns             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _setNodeNs(self, xmlNode* c_node, char* href) except -1:
 */
__pyx_r = __pyx_v_c_ns;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Document._findOrBuildNodeNs");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":380
 *         return c_ns
 * 
 *     cdef int _setNodeNs(self, xmlNode* c_node, char* href) except -1:             # <<<<<<<<<<<<<< 
 *         "Lookup namespace structure and set it for the node."
 *         cdef xmlNs* c_ns
 */

static  int __pyx_f_4lxml_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx_v_self,xmlNode *__pyx_v_c_node,char *__pyx_v_href) {
xmlNs *__pyx_v_c_ns;
int __pyx_r;
xmlNs *__pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":383
 *         "Lookup namespace structure and set it for the node."
 *         cdef xmlNs* c_ns
 *         c_ns = self._findOrBuildNodeNs(c_node, href, NULL)             # <<<<<<<<<<<<<< 
 *         tree.xmlSetNs(c_node, c_ns)
 * 
 */
__pyx_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_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; goto __pyx_L1;}
__pyx_v_c_ns = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":384
 *         cdef xmlNs* c_ns
 *         c_ns = self._findOrBuildNodeNs(c_node, href, NULL)
 *         tree.xmlSetNs(c_node, c_ns)             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _setNodeNamespaces(self, xmlNode* c_node,
 */
xmlSetNs(__pyx_v_c_node,__pyx_v_c_ns);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Document._setNodeNs");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":386
 *         tree.xmlSetNs(c_node, c_ns)
 * 
 *     cdef int _setNodeNamespaces(self, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                                 object node_ns_utf, object nsmap) except -1:
 *         """Lookup current namespace prefixes, then set namespace structure for
 */

static  int __pyx_f_4lxml_5etree_9_Document__setNodeNamespaces(struct LxmlDocument *__pyx_v_self,xmlNode *__pyx_v_c_node,PyObject *__pyx_v_node_ns_utf,PyObject *__pyx_v_nsmap) {
xmlNs *__pyx_v_c_ns;
xmlDoc *__pyx_v_c_doc;
char *__pyx_v_c_prefix;
char *__pyx_v_c_href;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_href;
PyObject *__pyx_v_href_utf;
PyObject *__pyx_v_prefix_utf;
int __pyx_r;
int __pyx_1;
int __pyx_2;
int __pyx_3;
Py_ssize_t __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
PyObject *__pyx_8 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_node_ns_utf);
Py_INCREF(__pyx_v_nsmap);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_href = Py_None; Py_INCREF(Py_None);
__pyx_v_href_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":397
 *         cdef char*   c_prefix
 *         cdef char*   c_href
 *         if not nsmap:             # <<<<<<<<<<<<<< 
 *             if node_ns_utf is not None:
 *                 self._setNodeNs(c_node, _cstr(node_ns_utf))
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_nsmap); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":398
 *         cdef char*   c_href
 *         if not nsmap:
 *             if node_ns_utf is not None:             # <<<<<<<<<<<<<< 
 *                 self._setNodeNs(c_node, _cstr(node_ns_utf))
 *             return 0
 */
  __pyx_1 = (__pyx_v_node_ns_utf != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":399
 *         if not nsmap:
 *             if node_ns_utf is not None:
 *                 self._setNodeNs(c_node, _cstr(node_ns_utf))             # <<<<<<<<<<<<<< 
 *             return 0
 * 
 */
    __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->_setNodeNs(__pyx_v_self,__pyx_v_c_node,_cstr(__pyx_v_node_ns_utf)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":400
 *             if node_ns_utf is not None:
 *                 self._setNodeNs(c_node, _cstr(node_ns_utf))
 *             return 0             # <<<<<<<<<<<<<< 
 * 
 *         c_doc  = self._c_doc
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":402
 *             return 0
 * 
 *         c_doc  = self._c_doc             # <<<<<<<<<<<<<< 
 *         for prefix, href in nsmap.items():
 *             href_utf = _utf8(href)
 */
__pyx_v_c_doc = __pyx_v_self->_c_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
__pyx_5 = PyObject_GetAttr(__pyx_v_nsmap, __pyx_n_items); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
__pyx_6 = PyObject_CallObject(__pyx_5, 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyList_CheckExact(__pyx_6)) { __pyx_4 = 0; __pyx_5 = __pyx_6; Py_INCREF(__pyx_5); }
else { __pyx_5 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;} }
Py_DECREF(__pyx_6); __pyx_6 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
  if (PyList_CheckExact(__pyx_5)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_6 = PyList_GET_ITEM(__pyx_5, __pyx_4++); Py_INCREF(__pyx_6); }
  else {
    __pyx_6 = PyIter_Next(__pyx_5);
    if (!__pyx_6) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_6) && PyTuple_GET_SIZE(__pyx_6) == 2) {
    __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 0);
    Py_INCREF(__pyx_8);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_8;
    __pyx_8 = 0;
    __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 1);
    Py_INCREF(__pyx_8);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_8;
    __pyx_8 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
  }
  else {
    __pyx_7 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_8;
    __pyx_8 = 0;
    __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":403
 * 
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():             # <<<<<<<<<<<<<< 
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_8;
    __pyx_8 = 0;
    if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 403; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":404
 *         c_doc  = self._c_doc
 *         for prefix, href in nsmap.items():
 *             href_utf = _utf8(href)             # <<<<<<<<<<<<<< 
 *             c_href = _cstr(href_utf)
 *             if prefix is not None and prefix:
 */
  __pyx_8 = __pyx_f_4lxml_5etree__utf8(__pyx_v_href); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 404; goto __pyx_L1;}
  Py_DECREF(__pyx_v_href_utf);
  __pyx_v_href_utf = __pyx_8;
  __pyx_8 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":405
 *         for prefix, href in nsmap.items():
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)             # <<<<<<<<<<<<<< 
 *             if prefix is not None and prefix:
 *                 prefix_utf = _utf8(prefix)
 */
  __pyx_v_c_href = _cstr(__pyx_v_href_utf);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":406
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 *             if prefix is not None and prefix:             # <<<<<<<<<<<<<< 
 *                 prefix_utf = _utf8(prefix)
 *                 c_prefix = _cstr(prefix_utf)
 */
  __pyx_2 = (__pyx_v_prefix != Py_None);
  __pyx_6 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; goto __pyx_L1;}
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; goto __pyx_L1;}
  if (__pyx_1) {
    Py_DECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":406
 *             href_utf = _utf8(href)
 *             c_href = _cstr(href_utf)
 *             if prefix is not None and prefix:             # <<<<<<<<<<<<<< 
 *                 prefix_utf = _utf8(prefix)
 *                 c_prefix = _cstr(prefix_utf)
 */
    __pyx_6 = __pyx_v_prefix;
    Py_INCREF(__pyx_6);
  }
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 406; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":407
 *             c_href = _cstr(href_utf)
 *             if prefix is not None and prefix:
 *                 prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<< 
 *                 c_prefix = _cstr(prefix_utf)
 *             else:
 */
    __pyx_7 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix_utf);
    __pyx_v_prefix_utf = __pyx_7;
    __pyx_7 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":408
 *             if prefix is not None and prefix:
 *                 prefix_utf = _utf8(prefix)
 *                 c_prefix = _cstr(prefix_utf)             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_prefix = NULL
 */
    __pyx_v_c_prefix = _cstr(__pyx_v_prefix_utf);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":410
 *                 c_prefix = _cstr(prefix_utf)
 *             else:
 *                 c_prefix = NULL             # <<<<<<<<<<<<<< 
 *             # add namespace with prefix if ns is not already known
 *             c_ns = tree.xmlSearchNsByHref(c_doc, c_node, c_href)
 */
    __pyx_v_c_prefix = NULL;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":412
 *                 c_prefix = NULL
 *             # add namespace with prefix if ns is not already known
 *             c_ns = tree.xmlSearchNsByHref(c_doc, c_node, c_href)             # <<<<<<<<<<<<<< 
 *             if c_ns is NULL:
 *                 c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 */
  __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_c_doc,__pyx_v_c_node,__pyx_v_c_href);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":413
 *             # add namespace with prefix if ns is not already known
 *             c_ns = tree.xmlSearchNsByHref(c_doc, c_node, c_href)
 *             if c_ns is NULL:             # <<<<<<<<<<<<<< 
 *                 c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 *             if href_utf == node_ns_utf:
 */
  __pyx_1 = (__pyx_v_c_ns == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":414
 *             c_ns = tree.xmlSearchNsByHref(c_doc, c_node, c_href)
 *             if c_ns is NULL:
 *                 c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)             # <<<<<<<<<<<<<< 
 *             if href_utf == node_ns_utf:
 *                 tree.xmlSetNs(c_node, c_ns)
 */
    __pyx_v_c_ns = xmlNewNs(__pyx_v_c_node,__pyx_v_c_href,__pyx_v_c_prefix);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":415
 *             if c_ns is NULL:
 *                 c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 *             if href_utf == node_ns_utf:             # <<<<<<<<<<<<<< 
 *                 tree.xmlSetNs(c_node, c_ns)
 *                 node_ns_utf = None
 */
  __pyx_8 = PyObject_RichCompare(__pyx_v_href_utf, __pyx_v_node_ns_utf, Py_EQ); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_8); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
  Py_DECREF(__pyx_8); __pyx_8 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":416
 *                 c_ns = tree.xmlNewNs(c_node, c_href, c_prefix)
 *             if href_utf == node_ns_utf:
 *                 tree.xmlSetNs(c_node, c_ns)             # <<<<<<<<<<<<<< 
 *                 node_ns_utf = None
 * 
 */
    xmlSetNs(__pyx_v_c_node,__pyx_v_c_ns);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":417
 *             if href_utf == node_ns_utf:
 *                 tree.xmlSetNs(c_node, c_ns)
 *                 node_ns_utf = None             # <<<<<<<<<<<<<< 
 * 
 *         if node_ns_utf is not None:
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_node_ns_utf);
    __pyx_v_node_ns_utf = Py_None;
    goto __pyx_L8;
  }
  __pyx_L8:;
}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":419
 *                 node_ns_utf = None
 * 
 *         if node_ns_utf is not None:             # <<<<<<<<<<<<<< 
 *             self._setNodeNs(c_node, _cstr(node_ns_utf))
 *         return 0
 */
__pyx_1 = (__pyx_v_node_ns_utf != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":420
 * 
 *         if node_ns_utf is not None:
 *             self._setNodeNs(c_node, _cstr(node_ns_utf))             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->__pyx_vtab)->_setNodeNs(__pyx_v_self,__pyx_v_c_node,_cstr(__pyx_v_node_ns_utf)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":421
 *         if node_ns_utf is not None:
 *             self._setNodeNs(c_node, _cstr(node_ns_utf))
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef extern from "etree_defs.h":
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
Py_XDECREF(__pyx_8);
__Pyx_AddTraceback("lxml.etree._Document._setNodeNamespaces");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_href);
Py_DECREF(__pyx_v_href_utf);
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_node_ns_utf);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":427
 *     cdef _Document NEW_DOCUMENT "PY_NEW" (object t)
 * 
 * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *     cdef _Document result
 *     result = NEW_DOCUMENT(_Document)
 */

static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentFactory(xmlDoc *__pyx_v_c_doc,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
struct LxmlDocument *__pyx_v_result;
struct LxmlDocument *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_parser);
__pyx_v_result = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":429
 * cdef _Document _documentFactory(xmlDoc* c_doc, _BaseParser parser):
 *     cdef _Document result
 *     result = NEW_DOCUMENT(_Document)             # <<<<<<<<<<<<<< 
 *     result._c_doc = c_doc
 *     result._ns_counter = 0
 */
__pyx_1 = ((PyObject *)PY_NEW(((PyObject*)__pyx_ptype_4lxml_5etree__Document))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 429; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":430
 *     cdef _Document result
 *     result = NEW_DOCUMENT(_Document)
 *     result._c_doc = c_doc             # <<<<<<<<<<<<<< 
 *     result._ns_counter = 0
 *     result._prefix_tail = None
 */
__pyx_v_result->_c_doc = __pyx_v_c_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":431
 *     result = NEW_DOCUMENT(_Document)
 *     result._c_doc = c_doc
 *     result._ns_counter = 0             # <<<<<<<<<<<<<< 
 *     result._prefix_tail = None
 *     if parser is None:
 */
__pyx_v_result->_ns_counter = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":432
 *     result._c_doc = c_doc
 *     result._ns_counter = 0
 *     result._prefix_tail = None             # <<<<<<<<<<<<<< 
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_result->_prefix_tail);
__pyx_v_result->_prefix_tail = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":433
 *     result._ns_counter = 0
 *     result._prefix_tail = None
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     result._parser = parser
 */
__pyx_2 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":434
 *     result._prefix_tail = None
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *     result._parser = parser
 *     return result
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":435
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     result._parser = parser             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_parser));
Py_DECREF(((PyObject *)__pyx_v_result->_parser));
__pyx_v_result->_parser = __pyx_v_parser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":436
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     result._parser = parser
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._documentFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":442
 *     "Document information provided by parser and DTD."
 *     cdef _Document _doc
 *     def __init__(self, tree):             # <<<<<<<<<<<<<< 
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 */

static PyObject *__pyx_k332p;

static char __pyx_k332[] = "Could not find root node";

static int __pyx_pf_4lxml_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_7DocInfo___init__[] = "Create a DocInfo object for an ElementTree object or root Element.";
static int __pyx_pf_4lxml_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tree = 0;
PyObject *__pyx_v_root_name;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_url;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"tree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_tree))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tree);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_url = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":444
 *     def __init__(self, tree):
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)             # <<<<<<<<<<<<<< 
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_tree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":444
 *     def __init__(self, tree):
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)             # <<<<<<<<<<<<<< 
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc));
((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":445
 *         "Create a DocInfo object for an ElementTree object or root Element."
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":446
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Could not find root node"
 * 
 */
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_root_name); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
__pyx_3 = __Pyx_PyBool_FromLong((!__pyx_4)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
if (__pyx_4) {
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":446
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Could not find root node"
 * 
 */
  __pyx_3 = __pyx_v_public_id;
  Py_INCREF(__pyx_3);
  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
  if (!__pyx_4) {
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":446
 *         self._doc = _documentOrRaise(tree)
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Could not find root node"
 * 
 */
    __pyx_3 = __pyx_v_system_url;
    Py_INCREF(__pyx_3);
  }
}
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 446; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":447
 *         root_name, public_id, system_url = self._doc.getdoctype()
 *         if not root_name and (public_id or system_url):
 *             raise ValueError, "Could not find root node"             # <<<<<<<<<<<<<< 
 * 
 *     property root_name:
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k332p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 447; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":451
 *     property root_name:
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return root_name
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_root_name;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_url;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_url = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":452
 *         "Returns the name of the root node as defined by the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return root_name
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":453
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return root_name             # <<<<<<<<<<<<<< 
 * 
 *     property public_id:
 */
Py_INCREF(__pyx_v_root_name);
__pyx_r = __pyx_v_root_name;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.root_name.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":457
 *     property public_id:
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return public_id
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_root_name;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_url;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_url = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":458
 *         "Returns the public ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return public_id
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":459
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return public_id             # <<<<<<<<<<<<<< 
 * 
 *     property system_url:
 */
Py_INCREF(__pyx_v_public_id);
__pyx_r = __pyx_v_public_id;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.public_id.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":463
 *     property system_url:
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return system_url
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_root_name;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_url;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_url = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":464
 *         "Returns the system ID of the DOCTYPE."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             return system_url
 * 
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":465
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             return system_url             # <<<<<<<<<<<<<< 
 * 
 *     property xml_version:
 */
Py_INCREF(__pyx_v_system_url);
__pyx_r = __pyx_v_system_url;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.system_url.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":469
 *     property xml_version:
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             xml_version, encoding = self._doc.getxmlinfo()
 *             return xml_version
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_xml_version;
PyObject *__pyx_v_encoding;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_xml_version = Py_None; Py_INCREF(Py_None);
__pyx_v_encoding = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":470
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return xml_version
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":470
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return xml_version
 * 
 */
  Py_DECREF(__pyx_v_xml_version);
  __pyx_v_xml_version = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":470
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return xml_version
 * 
 */
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":470
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return xml_version
 * 
 */
  Py_DECREF(__pyx_v_xml_version);
  __pyx_v_xml_version = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":470
 *         "Returns the XML version as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return xml_version
 * 
 */
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 470; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":471
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()
 *             return xml_version             # <<<<<<<<<<<<<< 
 * 
 *     property encoding:
 */
Py_INCREF(__pyx_v_xml_version);
__pyx_r = __pyx_v_xml_version;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.xml_version.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_xml_version);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":475
 *     property encoding:
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             xml_version, encoding = self._doc.getxmlinfo()
 *             return encoding
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_xml_version;
PyObject *__pyx_v_encoding;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_xml_version = Py_None; Py_INCREF(Py_None);
__pyx_v_encoding = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":476
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return encoding
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":476
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return encoding
 * 
 */
  Py_DECREF(__pyx_v_xml_version);
  __pyx_v_xml_version = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":476
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return encoding
 * 
 */
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":476
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return encoding
 * 
 */
  Py_DECREF(__pyx_v_xml_version);
  __pyx_v_xml_version = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":476
 *         "Returns the encoding name as declared by the document."
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()             # <<<<<<<<<<<<<< 
 *             return encoding
 * 
 */
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 476; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":477
 *         def __get__(self):
 *             xml_version, encoding = self._doc.getxmlinfo()
 *             return encoding             # <<<<<<<<<<<<<< 
 * 
 *     property URL:
 */
Py_INCREF(__pyx_v_encoding);
__pyx_r = __pyx_v_encoding;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.encoding.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_xml_version);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":481
 *     property URL:
 *         "Returns the source URL of the document (or None if unknown)."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return self._doc.getURL()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":482
 *         "Returns the source URL of the document (or None if unknown)."
 *         def __get__(self):
 *             return self._doc.getURL()             # <<<<<<<<<<<<<< 
 * 
 *     property doctype:
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->__pyx_vtab)->getURL(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 482; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.DocInfo.URL.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":486
 *     property doctype:
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             if public_id:
 */

static PyObject *__pyx_k333p;
static PyObject *__pyx_k334p;
static PyObject *__pyx_k335p;
static PyObject *__pyx_k336p;

static char __pyx_k333[] = "<!DOCTYPE %s PUBLIC \"%s\" \"%s\">";
static char __pyx_k334[] = "<!DOCTYPE %s PUBLIC \"%s\">";
static char __pyx_k335[] = "<!DOCTYPE %s SYSTEM \"%s\">";
static char __pyx_k336[] = "";

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_root_name;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_url;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
__pyx_v_root_name = Py_None; Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_url = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 3) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 2);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_public_id);
  __pyx_v_public_id = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":487
 *         "Returns a DOCTYPE declaration string for the document."
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()             # <<<<<<<<<<<<<< 
 *             if public_id:
 *                 if system_url:
 */
  Py_DECREF(__pyx_v_system_url);
  __pyx_v_system_url = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":488
 *         def __get__(self):
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             if public_id:             # <<<<<<<<<<<<<< 
 *                 if system_url:
 *                     return '<!DOCTYPE %s PUBLIC "%s" "%s">' % (
 */
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_public_id); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":489
 *             root_name, public_id, system_url = self._doc.getdoctype()
 *             if public_id:
 *                 if system_url:             # <<<<<<<<<<<<<< 
 *                     return '<!DOCTYPE %s PUBLIC "%s" "%s">' % (
 *                         root_name, public_id, system_url)
 */
  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":491
 *                 if system_url:
 *                     return '<!DOCTYPE %s PUBLIC "%s" "%s">' % (
 *                         root_name, public_id, system_url)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     return '<!DOCTYPE %s PUBLIC "%s">' % (
 */
    __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
    Py_INCREF(__pyx_v_root_name);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_root_name);
    Py_INCREF(__pyx_v_public_id);
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_public_id);
    Py_INCREF(__pyx_v_system_url);
    PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_system_url);
    __pyx_1 = PyNumber_Remainder(__pyx_k333p, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":494
 *                 else:
 *                     return '<!DOCTYPE %s PUBLIC "%s">' % (
 *                         root_name, public_id)             # <<<<<<<<<<<<<< 
 *             elif system_url:
 *                 return '<!DOCTYPE %s SYSTEM "%s">' % (
 */
    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; goto __pyx_L1;}
    Py_INCREF(__pyx_v_root_name);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_root_name);
    Py_INCREF(__pyx_v_public_id);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_public_id);
    __pyx_3 = PyNumber_Remainder(__pyx_k334p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":495
 *                     return '<!DOCTYPE %s PUBLIC "%s">' % (
 *                         root_name, public_id)
 *             elif system_url:             # <<<<<<<<<<<<<< 
 *                 return '<!DOCTYPE %s SYSTEM "%s">' % (
 *                     root_name, system_url)
 */
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_system_url); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 495; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":497
 *             elif system_url:
 *                 return '<!DOCTYPE %s SYSTEM "%s">' % (
 *                     root_name, system_url)             # <<<<<<<<<<<<<< 
 *             else:
 *                 return ""
 */
  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; goto __pyx_L1;}
  Py_INCREF(__pyx_v_root_name);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_root_name);
  Py_INCREF(__pyx_v_system_url);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_system_url);
  __pyx_2 = PyNumber_Remainder(__pyx_k335p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":499
 *                     root_name, system_url)
 *             else:
 *                 return ""             # <<<<<<<<<<<<<< 
 * 
 *     property internalDTD:
 */
  Py_INCREF(__pyx_k336p);
  __pyx_r = __pyx_k336p;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.DocInfo.doctype.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root_name);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":503
 *     property internalDTD:
 *         "Returns a DTD validator based on the internal subset of the document."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return _dtdFactory(self._doc._c_doc.intSubset)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":504
 *         "Returns a DTD validator based on the internal subset of the document."
 *         def __get__(self):
 *             return _dtdFactory(self._doc._c_doc.intSubset)             # <<<<<<<<<<<<<< 
 * 
 *     property externalDTD:
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->intSubset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.DocInfo.internalDTD.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":508
 *     property externalDTD:
 *         "Returns a DTD validator based on the external subset of the document."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return _dtdFactory(self._doc._c_doc.extSubset)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":509
 *         "Returns a DTD validator based on the external subset of the document."
 *         def __get__(self):
 *             return _dtdFactory(self._doc._c_doc.extSubset)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__dtdFactory(((struct __pyx_obj_4lxml_5etree_DocInfo *)__pyx_v_self)->_doc->_c_doc->extSubset)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.DocInfo.externalDTD.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":524
 *     cdef object _attrib
 * 
 *     def _init(self):             # <<<<<<<<<<<<<< 
 *         """Called after object initialisation.  Custom subclasses may override
 *         this if they recursively call _init() in the superclasses.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element__init[] = "Called after object initialisation.  Custom subclasses may override\n        this if they recursively call _init() in the superclasses.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":529
 *         """
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         #print "trying to free node:", <int>self._c_node
 *         #displayNode(self._c_node, 0)
 */

static void __pyx_pf_4lxml_5etree_8_Element___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_8_Element___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":532
 *         #print "trying to free node:", <int>self._c_node
 *         #displayNode(self._c_node, 0)
 *         if self._c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             _unregisterProxy(self)
 *             attemptDeallocation(self._c_node)
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":533
 *         #displayNode(self._c_node, 0)
 *         if self._c_node is not NULL:
 *             _unregisterProxy(self)             # <<<<<<<<<<<<<< 
 *             attemptDeallocation(self._c_node)
 *         _releaseProxy(self)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__unregisterProxy(((struct LxmlElement *)__pyx_v_self)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 533; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":534
 *         if self._c_node is not NULL:
 *             _unregisterProxy(self)
 *             attemptDeallocation(self._c_node)             # <<<<<<<<<<<<<< 
 *         _releaseProxy(self)
 * 
 */
  __pyx_f_4lxml_5etree_attemptDeallocation(((struct LxmlElement *)__pyx_v_self)->_c_node);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":535
 *             _unregisterProxy(self)
 *             attemptDeallocation(self._c_node)
 *         _releaseProxy(self)             # <<<<<<<<<<<<<< 
 * 
 *     # MANIPULATORS
 */
__pyx_f_4lxml_5etree__releaseProxy(((struct LxmlElement *)__pyx_v_self));

goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.__dealloc__");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":539
 *     # MANIPULATORS
 * 
 *     def __setitem__(self, x, value):             # <<<<<<<<<<<<<< 
 *         """Replaces the given subelement index or slice.
 *         """
 */

static PyObject *__pyx_n_IndexError;

static PyObject *__pyx_k337p;
static PyObject *__pyx_k338p;

static PyObject *__pyx_builtin_IndexError;

static char __pyx_k337[] = "cannot assign None";
static char __pyx_k338[] = "list index out of range";

static int __pyx_pf_4lxml_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element___setitem__[] = "Replaces the given subelement index or slice.\n        ";
static int __pyx_pf_4lxml_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_value) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_v_c_next;
struct LxmlElement *__pyx_v_element;
int __pyx_v_left_to_right;
Py_ssize_t __pyx_v_slicelength;
Py_ssize_t __pyx_v_step;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_ssize_t __pyx_5;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
Py_INCREF(__pyx_v_value);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":547
 *         cdef bint left_to_right
 *         cdef Py_ssize_t slicelength, step
 *         if value is None:             # <<<<<<<<<<<<<< 
 *             raise ValueError("cannot assign None")
 *         if python.PySlice_Check(x):
 */
__pyx_1 = (__pyx_v_value == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":548
 *         cdef Py_ssize_t slicelength, step
 *         if value is None:
 *             raise ValueError("cannot assign None")             # <<<<<<<<<<<<<< 
 *         if python.PySlice_Check(x):
 *             # slice assignment
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
  Py_INCREF(__pyx_k337p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k337p);
  __pyx_3 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 548; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":549
 *         if value is None:
 *             raise ValueError("cannot assign None")
 *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<< 
 *             # slice assignment
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 */
__pyx_1 = PySlice_Check(__pyx_v_x);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":551
 *         if python.PySlice_Check(x):
 *             # slice assignment
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *             if step > 0:
 *                 left_to_right = 1
 */
  if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_6python_slice)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":551
 *         if python.PySlice_Check(x):
 *             # slice assignment
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *             if step > 0:
 *                 left_to_right = 1
 */
  __pyx_4 = __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_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 551; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":552
 *             # slice assignment
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *             if step > 0:             # <<<<<<<<<<<<<< 
 *                 left_to_right = 1
 *             else:
 */
  __pyx_1 = (__pyx_v_step > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":553
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *             if step > 0:
 *                 left_to_right = 1             # <<<<<<<<<<<<<< 
 *             else:
 *                 left_to_right = 0
 */
    __pyx_v_left_to_right = 1;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":555
 *                 left_to_right = 1
 *             else:
 *                 left_to_right = 0             # <<<<<<<<<<<<<< 
 *                 step = -step
 *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
 */
    __pyx_v_left_to_right = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":556
 *             else:
 *                 left_to_right = 0
 *                 step = -step             # <<<<<<<<<<<<<< 
 *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
 *             return
 */
    __pyx_v_step = (-__pyx_v_step);
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":557
 *                 left_to_right = 0
 *                 step = -step
 *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)             # <<<<<<<<<<<<<< 
 *             return
 *         else:
 */
  __pyx_4 = __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_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 557; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":558
 *                 step = -step
 *             _replaceSlice(self, c_node, slicelength, step, left_to_right, value)
 *             return             # <<<<<<<<<<<<<< 
 *         else:
 *             # otherwise: normal item assignment
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":561
 *         else:
 *             # otherwise: normal item assignment
 *             element = value             # <<<<<<<<<<<<<< 
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:
 */
  if (!__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; goto __pyx_L1;}
  Py_INCREF(__pyx_v_value);
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElement *)__pyx_v_value);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":562
 *             # otherwise: normal item assignment
 *             element = value
 *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"
 */
  __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 562; goto __pyx_L1;}
  __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_5);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":563
 *             element = value
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 raise IndexError, "list index out of range"
 *             c_next = element._c_node.next
 */
  __pyx_1 = (__pyx_v_c_node == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":564
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"             # <<<<<<<<<<<<<< 
 *             c_next = element._c_node.next
 *             _removeText(c_node.next)
 */
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_k338p, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":565
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"
 *             c_next = element._c_node.next             # <<<<<<<<<<<<<< 
 *             _removeText(c_node.next)
 *             tree.xmlReplaceNode(c_node, element._c_node)
 */
  __pyx_v_c_next = __pyx_v_element->_c_node->next;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":566
 *                 raise IndexError, "list index out of range"
 *             c_next = element._c_node.next
 *             _removeText(c_node.next)             # <<<<<<<<<<<<<< 
 *             tree.xmlReplaceNode(c_node, element._c_node)
 *             _moveTail(c_next, element._c_node)
 */
  __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":567
 *             c_next = element._c_node.next
 *             _removeText(c_node.next)
 *             tree.xmlReplaceNode(c_node, element._c_node)             # <<<<<<<<<<<<<< 
 *             _moveTail(c_next, element._c_node)
 *             moveNodeToDocument(self._doc, element._c_node)
 */
  xmlReplaceNode(__pyx_v_c_node,__pyx_v_element->_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":568
 *             _removeText(c_node.next)
 *             tree.xmlReplaceNode(c_node, element._c_node)
 *             _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<< 
 *             moveNodeToDocument(self._doc, element._c_node)
 *             if not attemptDeallocation(c_node):
 */
  __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_element->_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":569
 *             tree.xmlReplaceNode(c_node, element._c_node)
 *             _moveTail(c_next, element._c_node)
 *             moveNodeToDocument(self._doc, element._c_node)             # <<<<<<<<<<<<<< 
 *             if not attemptDeallocation(c_node):
 *                 moveNodeToDocument(self._doc, c_node)
 */
  __pyx_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_element->_c_node); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":570
 *             _moveTail(c_next, element._c_node)
 *             moveNodeToDocument(self._doc, element._c_node)
 *             if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<< 
 *                 moveNodeToDocument(self._doc, c_node)
 * 
 */
  __pyx_1 = (!__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_node));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":571
 *             moveNodeToDocument(self._doc, element._c_node)
 *             if not attemptDeallocation(c_node):
 *                 moveNodeToDocument(self._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __delitem__(self, x):
 */
    __pyx_4 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 571; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.__setitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_x);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":573
 *                 moveNodeToDocument(self._doc, c_node)
 * 
 *     def __delitem__(self, x):             # <<<<<<<<<<<<<< 
 *         """Deletes the given subelement or a slice.
 *         """
 */

static int __pyx_pf_4lxml_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element___delitem__[] = "Deletes the given subelement or a slice.\n        ";
static int __pyx_pf_4lxml_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_v_c_next;
Py_ssize_t __pyx_v_index;
Py_ssize_t __pyx_v_step;
Py_ssize_t __pyx_v_slicelength;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":579
 *         cdef xmlNode* c_next
 *         cdef Py_ssize_t index, step, slicelength
 *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<< 
 *             # slice deletion
 *             if _isFullSlice(<python.slice>x):
 */
__pyx_1 = PySlice_Check(__pyx_v_x);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":581
 *         if python.PySlice_Check(x):
 *             # slice deletion
 *             if _isFullSlice(<python.slice>x):             # <<<<<<<<<<<<<< 
 *                 c_node = self._c_node.children
 *                 if c_node is not NULL:
 */
  __pyx_1 = __pyx_f_4lxml_5etree__isFullSlice(((PySliceObject *)__pyx_v_x));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":582
 *             # slice deletion
 *             if _isFullSlice(<python.slice>x):
 *                 c_node = self._c_node.children             # <<<<<<<<<<<<<< 
 *                 if c_node is not NULL:
 *                     if not _isElement(c_node):
 */
    __pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->children;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":583
 *             if _isFullSlice(<python.slice>x):
 *                 c_node = self._c_node.children
 *                 if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *                     if not _isElement(c_node):
 *                         c_node = _nextElement(c_node)
 */
    __pyx_1 = (__pyx_v_c_node != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":584
 *                 c_node = self._c_node.children
 *                 if c_node is not NULL:
 *                     if not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *                         c_node = _nextElement(c_node)
 *                     while c_node is not NULL:
 */
      __pyx_1 = (!_isElement(__pyx_v_c_node));
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":585
 *                 if c_node is not NULL:
 *                     if not _isElement(c_node):
 *                         c_node = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *                     while c_node is not NULL:
 *                         c_next = _nextElement(c_node)
 */
        __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":586
 *                     if not _isElement(c_node):
 *                         c_node = _nextElement(c_node)
 *                     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *                         c_next = _nextElement(c_node)
 *                         _removeNode(self._doc, c_node)
 */
      while (1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":586
 *                     if not _isElement(c_node):
 *                         c_node = _nextElement(c_node)
 *                     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *                         c_next = _nextElement(c_node)
 *                         _removeNode(self._doc, c_node)
 */
        __pyx_1 = (__pyx_v_c_node != NULL);
        if (!__pyx_1) break;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":587
 *                         c_node = _nextElement(c_node)
 *                     while c_node is not NULL:
 *                         c_next = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *                         _removeNode(self._doc, c_node)
 *                         c_node = c_next
 */
        __pyx_v_c_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":588
 *                     while c_node is not NULL:
 *                         c_next = _nextElement(c_node)
 *                         _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *                         c_node = c_next
 *             else:
 */
        __pyx_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":589
 *                         c_next = _nextElement(c_node)
 *                         _removeNode(self._doc, c_node)
 *                         c_node = c_next             # <<<<<<<<<<<<<< 
 *             else:
 *                 _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 */
        __pyx_v_c_node = __pyx_v_c_next;
      }
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":591
 *                         c_node = c_next
 *             else:
 *                 _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *                 _deleteSlice(self._doc, c_node, slicelength, step)
 *         else:
 */
    if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_6python_slice)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":591
 *                         c_node = c_next
 *             else:
 *                 _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *                 _deleteSlice(self._doc, c_node, slicelength, step)
 *         else:
 */
    __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":592
 *             else:
 *                 _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *                 _deleteSlice(self._doc, c_node, slicelength, step)             # <<<<<<<<<<<<<< 
 *         else:
 *             # item deletion
 */
    __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; goto __pyx_L1;}
  }
  __pyx_L3:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":595
 *         else:
 *             # item deletion
 *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 raise IndexError, index
 */
  __pyx_3 = __pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; goto __pyx_L1;}
  __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":596
 *             # item deletion
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 raise IndexError, index
 *             _removeText(c_node.next)
 */
  __pyx_1 = (__pyx_v_c_node == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":597
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:
 *                 raise IndexError, index             # <<<<<<<<<<<<<< 
 *             _removeText(c_node.next)
 *             _removeNode(self._doc, c_node)
 */
    __pyx_4 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; goto __pyx_L1;}
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_4, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; goto __pyx_L1;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":598
 *             if c_node is NULL:
 *                 raise IndexError, index
 *             _removeText(c_node.next)             # <<<<<<<<<<<<<< 
 *             _removeNode(self._doc, c_node)
 * 
 */
  __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":599
 *                 raise IndexError, index
 *             _removeText(c_node.next)
 *             _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __deepcopy__(self, memo):
 */
  __pyx_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Element.__delitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_x);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":601
 *             _removeNode(self._doc, c_node)
 * 
 *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<< 
 *         return self.__copy__()
 *         
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_memo);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":602
 * 
 *     def __deepcopy__(self, memo):
 *         return self.__copy__()             # <<<<<<<<<<<<<< 
 *         
 *     def __copy__(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___copy__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.__deepcopy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_memo);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":604
 *         return self.__copy__()
 *         
 *     def __copy__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlDoc* c_doc
 *         cdef xmlNode* c_node
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *unused) {
xmlDoc *__pyx_v_c_doc;
xmlNode *__pyx_v_c_node;
struct LxmlDocument *__pyx_v_new_doc;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
xmlDoc *__pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
__pyx_v_new_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":608
 *         cdef xmlNode* c_node
 *         cdef _Document new_doc
 *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive             # <<<<<<<<<<<<<< 
 *         new_doc = _documentFactory(c_doc, self._doc._parser)
 *         root = new_doc.getroot()
 */
__pyx_1 = __pyx_f_4lxml_5etree__copyDocRoot(((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc,((struct LxmlElement *)__pyx_v_self)->_c_node); if (unlikely(__pyx_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":609
 *         cdef _Document new_doc
 *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
 *         new_doc = _documentFactory(c_doc, self._doc._parser)             # <<<<<<<<<<<<<< 
 *         root = new_doc.getroot()
 *         if root is not None:
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,((struct LxmlElement *)__pyx_v_self)->_doc->_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_new_doc));
__pyx_v_new_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":610
 *         c_doc = _copyDocRoot(self._doc._c_doc, self._c_node) # recursive
 *         new_doc = _documentFactory(c_doc, self._doc._parser)
 *         root = new_doc.getroot()             # <<<<<<<<<<<<<< 
 *         if root is not None:
 *             return root
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_new_doc->__pyx_vtab)->getroot(__pyx_v_new_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 610; goto __pyx_L1;}
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":611
 *         new_doc = _documentFactory(c_doc, self._doc._parser)
 *         root = new_doc.getroot()
 *         if root is not None:             # <<<<<<<<<<<<<< 
 *             return root
 *         # Comment/PI
 */
__pyx_3 = (__pyx_v_root != Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":612
 *         root = new_doc.getroot()
 *         if root is not None:
 *             return root             # <<<<<<<<<<<<<< 
 *         # Comment/PI
 *         c_node = c_doc.children
 */
  Py_INCREF(__pyx_v_root);
  __pyx_r = __pyx_v_root;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":614
 *             return root
 *         # Comment/PI
 *         c_node = c_doc.children             # <<<<<<<<<<<<<< 
 *         while c_node is not NULL and c_node.type != self._c_node.type:
 *             c_node = c_node.next
 */
__pyx_v_c_node = __pyx_v_c_doc->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":615
 *         # Comment/PI
 *         c_node = c_doc.children
 *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<< 
 *             c_node = c_node.next
 *         if c_node is NULL:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":615
 *         # Comment/PI
 *         c_node = c_doc.children
 *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<< 
 *             c_node = c_node.next
 *         if c_node is NULL:
 */
  __pyx_3 = (__pyx_v_c_node != NULL);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":615
 *         # Comment/PI
 *         c_node = c_doc.children
 *         while c_node is not NULL and c_node.type != self._c_node.type:             # <<<<<<<<<<<<<< 
 *             c_node = c_node.next
 *         if c_node is NULL:
 */
    __pyx_3 = (__pyx_v_c_node->type != ((struct LxmlElement *)__pyx_v_self)->_c_node->type);
  }
  if (!__pyx_3) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":616
 *         c_node = c_doc.children
 *         while c_node is not NULL and c_node.type != self._c_node.type:
 *             c_node = c_node.next             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             return None
 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":617
 *         while c_node is not NULL and c_node.type != self._c_node.type:
 *             c_node = c_node.next
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             return None
 *         return _elementFactory(new_doc, c_node)
 */
__pyx_3 = (__pyx_v_c_node == NULL);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":618
 *             c_node = c_node.next
 *         if c_node is NULL:
 *             return None             # <<<<<<<<<<<<<< 
 *         return _elementFactory(new_doc, c_node)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":619
 *         if c_node is NULL:
 *             return None
 *         return _elementFactory(new_doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def set(self, key, value):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_new_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 619; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.__copy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_new_doc);
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":621
 *         return _elementFactory(new_doc, c_node)
 * 
 *     def set(self, key, value):             # <<<<<<<<<<<<<< 
 *         """Sets an element attribute.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_set[] = "Sets an element attribute.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"key","value",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":624
 *         """Sets an element attribute.
 *         """
 *         _setAttributeValue(self, key, value)             # <<<<<<<<<<<<<< 
 * 
 *     def append(self, _Element element not None):
 */
__pyx_1 = __pyx_f_4lxml_5etree__setAttributeValue(((struct LxmlElement *)__pyx_v_self),__pyx_v_key,__pyx_v_value); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.set");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":626
 *         _setAttributeValue(self, key, value)
 * 
 *     def append(self, _Element element not None):             # <<<<<<<<<<<<<< 
 *         """Adds a subelement to the end of this element.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_append[] = "Adds a subelement to the end of this element.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":629
 *         """Adds a subelement to the end of this element.
 *         """
 *         _appendChild(self, element)             # <<<<<<<<<<<<<< 
 * 
 *     def addnext(self, _Element element):
 */
__pyx_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 629; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.append");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":631
 *         _appendChild(self, element)
 * 
 *     def addnext(self, _Element element):             # <<<<<<<<<<<<<< 
 *         """Adds the element as a following sibling directly after this
 *         element.
 */

static PyObject *__pyx_n_TypeError;
static PyObject *__pyx_n_tail;

static PyObject *__pyx_k339p;

static PyObject *__pyx_builtin_TypeError;

static char __pyx_k339[] = "Only processing instructions and comments can be siblings of the root element";

static PyObject *__pyx_pf_4lxml_5etree_8_Element_addnext(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_addnext[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_addnext(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":639
 *         discarded when adding at the root level.
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<< 
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":639
 *         discarded when adding at the root level.
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<< 
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 */
  __pyx_1 = (!_isElement(((struct LxmlElement *)__pyx_v_self)->_c_node->parent));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":640
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
 *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<< 
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 */
  __pyx_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_PI_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":641
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<< 
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None
 */
    __pyx_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_COMMENT_NODE);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":642
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")             # <<<<<<<<<<<<<< 
 *             element.tail = None
 *         _appendSibling(self, element)
 */
      __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
      Py_INCREF(__pyx_k339p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k339p);
      __pyx_3 = PyObject_CallObject(__pyx_builtin_TypeError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __Pyx_Raise(__pyx_3, 0, 0);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":643
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None             # <<<<<<<<<<<<<< 
 *         _appendSibling(self, element)
 * 
 */
  if (PyObject_SetAttr(__pyx_v_element, __pyx_n_tail, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":644
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None
 *         _appendSibling(self, element)             # <<<<<<<<<<<<<< 
 * 
 *     def addprevious(self, _Element element):
 */
__pyx_4 = __pyx_f_4lxml_5etree__appendSibling(((struct LxmlElement *)__pyx_v_self),((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 644; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.addnext");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":646
 *         _appendSibling(self, element)
 * 
 *     def addprevious(self, _Element element):             # <<<<<<<<<<<<<< 
 *         """Adds the element as a preceding sibling directly before this
 *         element.
 */

static PyObject *__pyx_k340p;

static char __pyx_k340[] = "Only processing instructions and comments can be siblings of the root element";

static PyObject *__pyx_pf_4lxml_5etree_8_Element_addprevious(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_addprevious[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_addprevious(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":654
 *         automatically discarded when adding at the root level.
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<< 
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->parent != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":654
 *         automatically discarded when adding at the root level.
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):             # <<<<<<<<<<<<<< 
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 */
  __pyx_1 = (!_isElement(((struct LxmlElement *)__pyx_v_self)->_c_node->parent));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":655
 *         """
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
 *             if element._c_node.type != tree.XML_PI_NODE:             # <<<<<<<<<<<<<< 
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 */
  __pyx_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_PI_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":656
 *         if self._c_node.parent != NULL and not _isElement(self._c_node.parent):
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<< 
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None
 */
    __pyx_1 = (((struct LxmlElement *)__pyx_v_element)->_c_node->type != XML_COMMENT_NODE);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":657
 *             if element._c_node.type != tree.XML_PI_NODE:
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")             # <<<<<<<<<<<<<< 
 *             element.tail = None
 *         _prependSibling(self, element)
 */
      __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
      Py_INCREF(__pyx_k340p);
      PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k340p);
      __pyx_3 = PyObject_CallObject(__pyx_builtin_TypeError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __Pyx_Raise(__pyx_3, 0, 0);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":658
 *                 if element._c_node.type != tree.XML_COMMENT_NODE:
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None             # <<<<<<<<<<<<<< 
 *         _prependSibling(self, element)
 * 
 */
  if (PyObject_SetAttr(__pyx_v_element, __pyx_n_tail, Py_None) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":659
 *                     raise TypeError("Only processing instructions and comments can be siblings of the root element")
 *             element.tail = None
 *         _prependSibling(self, element)             # <<<<<<<<<<<<<< 
 * 
 *     def extend(self, elements):
 */
__pyx_4 = __pyx_f_4lxml_5etree__prependSibling(((struct LxmlElement *)__pyx_v_self),((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 659; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.addprevious");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":661
 *         _prependSibling(self, element)
 * 
 *     def extend(self, elements):             # <<<<<<<<<<<<<< 
 *         """Extends the current children by the elements in the iterable.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_extend[] = "Extends the current children by the elements in the iterable.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_v_elements) {
PyObject *__pyx_v_element;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_elements);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":664
 *         """Extends the current children by the elements in the iterable.
 *         """
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             _appendChild(self, element)
 * 
 */
if (PyList_CheckExact(__pyx_v_elements)) { __pyx_1 = 0; __pyx_2 = __pyx_v_elements; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":664
 *         """Extends the current children by the elements in the iterable.
 *         """
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             _appendChild(self, element)
 * 
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  Py_DECREF(__pyx_v_element);
  __pyx_v_element = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":665
 *         """
 *         for element in elements:
 *             _appendChild(self, element)             # <<<<<<<<<<<<<< 
 * 
 *     def clear(self):
 */
  if (!__Pyx_TypeTest(__pyx_v_element, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; goto __pyx_L1;}
  __pyx_4 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),((struct LxmlElement *)__pyx_v_element)); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; goto __pyx_L1;}
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.extend");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_elements);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":667
 *             _appendChild(self, element)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<< 
 *         """Resets an element. This function removes all subelements,
 *         clears all attributes and sets the text and tail
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_clear[] = "Resets an element. This function removes all subelements,\n        clears all attributes and sets the text and tail\n        attributes to None.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *unused) {
xmlAttr *__pyx_v_c_attr;
xmlAttr *__pyx_v_c_attr_next;
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_v_c_node_next;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":676
 *         cdef xmlNode* c_node
 *         cdef xmlNode* c_node_next
 *         c_node = self._c_node             # <<<<<<<<<<<<<< 
 *         # remove self.text and self.tail
 *         _removeText(c_node.children)
 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":678
 *         c_node = self._c_node
 *         # remove self.text and self.tail
 *         _removeText(c_node.children)             # <<<<<<<<<<<<<< 
 *         _removeText(c_node.next)
 *         # remove all attributes
 */
__pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->children);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":679
 *         # remove self.text and self.tail
 *         _removeText(c_node.children)
 *         _removeText(c_node.next)             # <<<<<<<<<<<<<< 
 *         # remove all attributes
 *         c_attr = c_node.properties
 */
__pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":681
 *         _removeText(c_node.next)
 *         # remove all attributes
 *         c_attr = c_node.properties             # <<<<<<<<<<<<<< 
 *         while c_attr is not NULL:
 *             c_attr_next = c_attr.next
 */
__pyx_v_c_attr = __pyx_v_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":682
 *         # remove all attributes
 *         c_attr = c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             c_attr_next = c_attr.next
 *             tree.xmlRemoveProp(c_attr)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":682
 *         # remove all attributes
 *         c_attr = c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             c_attr_next = c_attr.next
 *             tree.xmlRemoveProp(c_attr)
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":683
 *         c_attr = c_node.properties
 *         while c_attr is not NULL:
 *             c_attr_next = c_attr.next             # <<<<<<<<<<<<<< 
 *             tree.xmlRemoveProp(c_attr)
 *             c_attr = c_attr_next
 */
  __pyx_v_c_attr_next = __pyx_v_c_attr->next;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":684
 *         while c_attr is not NULL:
 *             c_attr_next = c_attr.next
 *             tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr_next
 *         # remove all subelements
 */
  xmlRemoveProp(__pyx_v_c_attr);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":685
 *             c_attr_next = c_attr.next
 *             tree.xmlRemoveProp(c_attr)
 *             c_attr = c_attr_next             # <<<<<<<<<<<<<< 
 *         # remove all subelements
 *         c_node = c_node.children
 */
  __pyx_v_c_attr = __pyx_v_c_attr_next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":687
 *             c_attr = c_attr_next
 *         # remove all subelements
 *         c_node = c_node.children             # <<<<<<<<<<<<<< 
 *         if c_node is not NULL:
 *             if not _isElement(c_node):
 */
__pyx_v_c_node = __pyx_v_c_node->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":688
 *         # remove all subelements
 *         c_node = c_node.children
 *         if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             if not _isElement(c_node):
 *                 c_node = _nextElement(c_node)
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":689
 *         c_node = c_node.children
 *         if c_node is not NULL:
 *             if not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *                 c_node = _nextElement(c_node)
 *             while c_node is not NULL:
 */
  __pyx_1 = (!_isElement(__pyx_v_c_node));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":690
 *         if c_node is not NULL:
 *             if not _isElement(c_node):
 *                 c_node = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *             while c_node is not NULL:
 *                 c_node_next = _nextElement(c_node)
 */
    __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":691
 *             if not _isElement(c_node):
 *                 c_node = _nextElement(c_node)
 *             while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_node_next = _nextElement(c_node)
 *                 _removeNode(self._doc, c_node)
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":691
 *             if not _isElement(c_node):
 *                 c_node = _nextElement(c_node)
 *             while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_node_next = _nextElement(c_node)
 *                 _removeNode(self._doc, c_node)
 */
    __pyx_1 = (__pyx_v_c_node != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":692
 *                 c_node = _nextElement(c_node)
 *             while c_node is not NULL:
 *                 c_node_next = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *                 _removeNode(self._doc, c_node)
 *                 c_node = c_node_next
 */
    __pyx_v_c_node_next = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":693
 *             while c_node is not NULL:
 *                 c_node_next = _nextElement(c_node)
 *                 _removeNode(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *                 c_node = c_node_next
 * 
 */
    __pyx_2 = __pyx_f_4lxml_5etree__removeNode(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":694
 *                 c_node_next = _nextElement(c_node)
 *                 _removeNode(self._doc, c_node)
 *                 c_node = c_node_next             # <<<<<<<<<<<<<< 
 * 
 *     def insert(self, index, _Element element not None):
 */
    __pyx_v_c_node = __pyx_v_c_node_next;
  }
  goto __pyx_L4;
}
__pyx_L4:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.clear");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":696
 *                 c_node = c_node_next
 * 
 *     def insert(self, index, _Element element not None):             # <<<<<<<<<<<<<< 
 *         """Inserts a subelement at the given position in this element
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_insert[] = "Inserts a subelement at the given position in this element\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_index = 0;
struct LxmlElement *__pyx_v_element = 0;
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_v_c_next;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
int __pyx_2;
int __pyx_3;
static char *__pyx_argnames[] = {"index","element",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_index, &__pyx_v_element))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_index);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":701
 *         cdef xmlNode* c_node
 *         cdef xmlNode* c_next
 *         c_node = _findChild(self._c_node, index)             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             _appendChild(self, element)
 */
__pyx_1 = __pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_1 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 701; goto __pyx_L1;}
__pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":702
 *         cdef xmlNode* c_next
 *         c_node = _findChild(self._c_node, index)
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             _appendChild(self, element)
 *             return
 */
__pyx_2 = (__pyx_v_c_node == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":703
 *         c_node = _findChild(self._c_node, index)
 *         if c_node is NULL:
 *             _appendChild(self, element)             # <<<<<<<<<<<<<< 
 *             return
 *         c_next = element._c_node.next
 */
  __pyx_3 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),__pyx_v_element); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 703; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":704
 *         if c_node is NULL:
 *             _appendChild(self, element)
 *             return             # <<<<<<<<<<<<<< 
 *         c_next = element._c_node.next
 *         tree.xmlAddPrevSibling(c_node, element._c_node)
 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":705
 *             _appendChild(self, element)
 *             return
 *         c_next = element._c_node.next             # <<<<<<<<<<<<<< 
 *         tree.xmlAddPrevSibling(c_node, element._c_node)
 *         _moveTail(c_next, element._c_node)
 */
__pyx_v_c_next = __pyx_v_element->_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":706
 *             return
 *         c_next = element._c_node.next
 *         tree.xmlAddPrevSibling(c_node, element._c_node)             # <<<<<<<<<<<<<< 
 *         _moveTail(c_next, element._c_node)
 *         moveNodeToDocument(self._doc, element._c_node)
 */
xmlAddPrevSibling(__pyx_v_c_node,__pyx_v_element->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":707
 *         c_next = element._c_node.next
 *         tree.xmlAddPrevSibling(c_node, element._c_node)
 *         _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<< 
 *         moveNodeToDocument(self._doc, element._c_node)
 * 
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_element->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":708
 *         tree.xmlAddPrevSibling(c_node, element._c_node)
 *         _moveTail(c_next, element._c_node)
 *         moveNodeToDocument(self._doc, element._c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def remove(self, _Element element not None):
 */
__pyx_3 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_element->_c_node); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 708; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.insert");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_index);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":710
 *         moveNodeToDocument(self._doc, element._c_node)
 * 
 *     def remove(self, _Element element not None):             # <<<<<<<<<<<<<< 
 *         """Removes a matching subelement. Unlike the find methods, this
 *         method compares elements based on identity, not on tag value
 */

static PyObject *__pyx_k341p;

static char __pyx_k341[] = "Element is not a child of this node.";

static PyObject *__pyx_pf_4lxml_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_remove[] = "Removes a matching subelement. Unlike the find methods, this\n        method compares elements based on identity, not on tag value\n        or contents.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_v_c_next;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":717
 *         cdef xmlNode* c_node
 *         cdef xmlNode* c_next
 *         c_node = element._c_node             # <<<<<<<<<<<<<< 
 *         if c_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."
 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":718
 *         cdef xmlNode* c_next
 *         c_node = element._c_node
 *         if c_node.parent is not self._c_node:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Element is not a child of this node."
 *         c_next = element._c_node.next
 */
__pyx_1 = (__pyx_v_c_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":719
 *         c_node = element._c_node
 *         if c_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."             # <<<<<<<<<<<<<< 
 *         c_next = element._c_node.next
 *         tree.xmlUnlinkNode(c_node)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k341p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":720
 *         if c_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."
 *         c_next = element._c_node.next             # <<<<<<<<<<<<<< 
 *         tree.xmlUnlinkNode(c_node)
 *         _moveTail(c_next, c_node)
 */
__pyx_v_c_next = ((struct LxmlElement *)__pyx_v_element)->_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":721
 *             raise ValueError, "Element is not a child of this node."
 *         c_next = element._c_node.next
 *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<< 
 *         _moveTail(c_next, c_node)
 *         # fix namespace declarations
 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":722
 *         c_next = element._c_node.next
 *         tree.xmlUnlinkNode(c_node)
 *         _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *         # fix namespace declarations
 *         moveNodeToDocument(self._doc, c_node)
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":724
 *         _moveTail(c_next, c_node)
 *         # fix namespace declarations
 *         moveNodeToDocument(self._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def replace(self, _Element old_element not None,
 */
__pyx_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 724; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.remove");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":726
 *         moveNodeToDocument(self._doc, c_node)
 * 
 *     def replace(self, _Element old_element not None,             # <<<<<<<<<<<<<< 
 *                 _Element new_element not None):
 *         """Replaces a subelement with the element passed as second argument.
 */

static PyObject *__pyx_k342p;

static char __pyx_k342[] = "Element is not a child of this node.";

static PyObject *__pyx_pf_4lxml_5etree_8_Element_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_replace[] = "Replaces a subelement with the element passed as second argument.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_old_element = 0;
struct LxmlElement *__pyx_v_new_element = 0;
xmlNode *__pyx_v_c_old_node;
xmlNode *__pyx_v_c_old_next;
xmlNode *__pyx_v_c_new_node;
xmlNode *__pyx_v_c_new_next;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
static char *__pyx_argnames[] = {"old_element","new_element",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_old_element, &__pyx_v_new_element))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_old_element);
Py_INCREF(__pyx_v_new_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_element), __pyx_ptype_4lxml_5etree__Element, 0, "old_element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 726; goto __pyx_L1;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_element), __pyx_ptype_4lxml_5etree__Element, 0, "new_element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 727; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":734
 *         cdef xmlNode* c_new_node
 *         cdef xmlNode* c_new_next
 *         c_old_node = old_element._c_node             # <<<<<<<<<<<<<< 
 *         if c_old_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."
 */
__pyx_v_c_old_node = __pyx_v_old_element->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":735
 *         cdef xmlNode* c_new_next
 *         c_old_node = old_element._c_node
 *         if c_old_node.parent is not self._c_node:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Element is not a child of this node."
 *         c_old_next = c_old_node.next
 */
__pyx_1 = (__pyx_v_c_old_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":736
 *         c_old_node = old_element._c_node
 *         if c_old_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."             # <<<<<<<<<<<<<< 
 *         c_old_next = c_old_node.next
 *         c_new_node = new_element._c_node
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k342p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 736; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":737
 *         if c_old_node.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."
 *         c_old_next = c_old_node.next             # <<<<<<<<<<<<<< 
 *         c_new_node = new_element._c_node
 *         c_new_next = c_new_node.next
 */
__pyx_v_c_old_next = __pyx_v_c_old_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":738
 *             raise ValueError, "Element is not a child of this node."
 *         c_old_next = c_old_node.next
 *         c_new_node = new_element._c_node             # <<<<<<<<<<<<<< 
 *         c_new_next = c_new_node.next
 *         tree.xmlReplaceNode(c_old_node, c_new_node)
 */
__pyx_v_c_new_node = __pyx_v_new_element->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":739
 *         c_old_next = c_old_node.next
 *         c_new_node = new_element._c_node
 *         c_new_next = c_new_node.next             # <<<<<<<<<<<<<< 
 *         tree.xmlReplaceNode(c_old_node, c_new_node)
 *         _moveTail(c_new_next, c_new_node)
 */
__pyx_v_c_new_next = __pyx_v_c_new_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":740
 *         c_new_node = new_element._c_node
 *         c_new_next = c_new_node.next
 *         tree.xmlReplaceNode(c_old_node, c_new_node)             # <<<<<<<<<<<<<< 
 *         _moveTail(c_new_next, c_new_node)
 *         _moveTail(c_old_next, c_old_node)
 */
xmlReplaceNode(__pyx_v_c_old_node,__pyx_v_c_new_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":741
 *         c_new_next = c_new_node.next
 *         tree.xmlReplaceNode(c_old_node, c_new_node)
 *         _moveTail(c_new_next, c_new_node)             # <<<<<<<<<<<<<< 
 *         _moveTail(c_old_next, c_old_node)
 *         moveNodeToDocument(self._doc, c_new_node)
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_new_next,__pyx_v_c_new_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":742
 *         tree.xmlReplaceNode(c_old_node, c_new_node)
 *         _moveTail(c_new_next, c_new_node)
 *         _moveTail(c_old_next, c_old_node)             # <<<<<<<<<<<<<< 
 *         moveNodeToDocument(self._doc, c_new_node)
 *         # fix namespace declarations
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_old_next,__pyx_v_c_old_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":743
 *         _moveTail(c_new_next, c_new_node)
 *         _moveTail(c_old_next, c_old_node)
 *         moveNodeToDocument(self._doc, c_new_node)             # <<<<<<<<<<<<<< 
 *         # fix namespace declarations
 *         moveNodeToDocument(self._doc, c_old_node)
 */
__pyx_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_new_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":745
 *         moveNodeToDocument(self._doc, c_new_node)
 *         # fix namespace declarations
 *         moveNodeToDocument(self._doc, c_old_node)             # <<<<<<<<<<<<<< 
 *         
 *     # PROPERTIES
 */
__pyx_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_old_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.replace");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_old_element);
Py_DECREF(__pyx_v_new_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":751
 *         """Element tag
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._tag is not None:
 *                 return self._tag
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_3tag___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":752
 *         """
 *         def __get__(self):
 *             if self._tag is not None:             # <<<<<<<<<<<<<< 
 *                 return self._tag
 *             self._tag = _namespacedName(self._c_node)
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_tag != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":753
 *         def __get__(self):
 *             if self._tag is not None:
 *                 return self._tag             # <<<<<<<<<<<<<< 
 *             self._tag = _namespacedName(self._c_node)
 *             return self._tag
 */
  Py_INCREF(((struct LxmlElement *)__pyx_v_self)->_tag);
  __pyx_r = ((struct LxmlElement *)__pyx_v_self)->_tag;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":754
 *             if self._tag is not None:
 *                 return self._tag
 *             self._tag = _namespacedName(self._c_node)             # <<<<<<<<<<<<<< 
 *             return self._tag
 *     
 */
__pyx_2 = __pyx_f_4lxml_5etree__namespacedName(((struct LxmlElement *)__pyx_v_self)->_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":754
 *             if self._tag is not None:
 *                 return self._tag
 *             self._tag = _namespacedName(self._c_node)             # <<<<<<<<<<<<<< 
 *             return self._tag
 *     
 */
Py_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":755
 *                 return self._tag
 *             self._tag = _namespacedName(self._c_node)
 *             return self._tag             # <<<<<<<<<<<<<< 
 *     
 *         def __set__(self, value):
 */
Py_INCREF(((struct LxmlElement *)__pyx_v_self)->_tag);
__pyx_r = ((struct LxmlElement *)__pyx_v_self)->_tag;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.tag.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":757
 *             return self._tag
 *     
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)
 */

static int __pyx_pf_4lxml_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_name;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":759
 *         def __set__(self, value):
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":759
 *         def __set__(self, value):
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":759
 *         def __set__(self, value):
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 */
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":759
 *         def __set__(self, value):
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":759
 *         def __set__(self, value):
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 */
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 759; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":760
 *             cdef _BaseParser parser
 *             ns, name = _getNsTag(value)
 *             parser = self._doc._parser             # <<<<<<<<<<<<<< 
 *             if parser is not None and parser._for_html:
 *                 _htmlTagValidOrRaise(name)
 */
Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_self)->_doc->_parser));
Py_DECREF(((PyObject *)__pyx_v_parser));
__pyx_v_parser = ((struct LxmlElement *)__pyx_v_self)->_doc->_parser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":761
 *             ns, name = _getNsTag(value)
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *                 _htmlTagValidOrRaise(name)
 *             else:
 */
__pyx_4 = (((PyObject *)__pyx_v_parser) != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":761
 *             ns, name = _getNsTag(value)
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *                 _htmlTagValidOrRaise(name)
 *             else:
 */
  __pyx_4 = __pyx_v_parser->_for_html;
}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":762
 *             parser = self._doc._parser
 *             if parser is not None and parser._for_html:
 *                 _htmlTagValidOrRaise(name)             # <<<<<<<<<<<<<< 
 *             else:
 *                 _tagValidOrRaise(name)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":764
 *                 _htmlTagValidOrRaise(name)
 *             else:
 *                 _tagValidOrRaise(name)             # <<<<<<<<<<<<<< 
 *             self._tag = value
 *             tree.xmlNodeSetName(self._c_node, _cstr(name))
 */
  __pyx_5 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 764; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":765
 *             else:
 *                 _tagValidOrRaise(name)
 *             self._tag = value             # <<<<<<<<<<<<<< 
 *             tree.xmlNodeSetName(self._c_node, _cstr(name))
 *             if ns is None:
 */
Py_INCREF(__pyx_v_value);
Py_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_v_value;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":766
 *                 _tagValidOrRaise(name)
 *             self._tag = value
 *             tree.xmlNodeSetName(self._c_node, _cstr(name))             # <<<<<<<<<<<<<< 
 *             if ns is None:
 *                 self._c_node.ns = NULL
 */
xmlNodeSetName(((struct LxmlElement *)__pyx_v_self)->_c_node,_cstr(__pyx_v_name));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":767
 *             self._tag = value
 *             tree.xmlNodeSetName(self._c_node, _cstr(name))
 *             if ns is None:             # <<<<<<<<<<<<<< 
 *                 self._c_node.ns = NULL
 *             else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":768
 *             tree.xmlNodeSetName(self._c_node, _cstr(name))
 *             if ns is None:
 *                 self._c_node.ns = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._doc._setNodeNs(self._c_node, _cstr(ns))
 */
  ((struct LxmlElement *)__pyx_v_self)->_c_node->ns = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":770
 *                 self._c_node.ns = NULL
 *             else:
 *                 self._doc._setNodeNs(self._c_node, _cstr(ns))             # <<<<<<<<<<<<<< 
 * 
 *     property attrib:
 */
  __pyx_5 = ((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,_cstr(__pyx_v_ns)); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; goto __pyx_L1;}
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.tag.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":776
 *         keys(), values() and items() to access element attributes.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._attrib is None:
 *                 self._attrib = _Attrib(self)
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_6attrib___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":777
 *         """
 *         def __get__(self):
 *             if self._attrib is None:             # <<<<<<<<<<<<<< 
 *                 self._attrib = _Attrib(self)
 *             return self._attrib
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_attrib == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":778
 *         def __get__(self):
 *             if self._attrib is None:
 *                 self._attrib = _Attrib(self)             # <<<<<<<<<<<<<< 
 *             return self._attrib
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__Attrib), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":778
 *         def __get__(self):
 *             if self._attrib is None:
 *                 self._attrib = _Attrib(self)             # <<<<<<<<<<<<<< 
 *             return self._attrib
 * 
 */
  Py_DECREF(((struct LxmlElement *)__pyx_v_self)->_attrib);
  ((struct LxmlElement *)__pyx_v_self)->_attrib = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":779
 *             if self._attrib is None:
 *                 self._attrib = _Attrib(self)
 *             return self._attrib             # <<<<<<<<<<<<<< 
 * 
 *     property text:
 */
Py_INCREF(((struct LxmlElement *)__pyx_v_self)->_attrib);
__pyx_r = ((struct LxmlElement *)__pyx_v_self)->_attrib;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.attrib.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":785
 *         the value None, if there was no text.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return _collectText(self._c_node.children)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_4text___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":786
 *         """
 *         def __get__(self):
 *             return _collectText(self._c_node.children)             # <<<<<<<<<<<<<< 
 * 
 *         def __set__(self, value):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->children); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 786; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.text.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":788
 *             return _collectText(self._c_node.children)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             if isinstance(value, QName):
 *                 value = python.PyUnicode_FromEncodedObject(
 */

static char __pyx_k343[] = "UTF-8";
static char __pyx_k344[] = "strict";

static int __pyx_pf_4lxml_5etree_8_Element_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":789
 * 
 *         def __set__(self, value):
 *             if isinstance(value, QName):             # <<<<<<<<<<<<<< 
 *                 value = python.PyUnicode_FromEncodedObject(
 *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_value,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 789; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":791
 *             if isinstance(value, QName):
 *                 value = python.PyUnicode_FromEncodedObject(
 *                     _resolveQNameText(self, value), 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *             _setNodeText(self._c_node, value)
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree__resolveQNameText(((struct LxmlElement *)__pyx_v_self),__pyx_v_value); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":791
 *             if isinstance(value, QName):
 *                 value = python.PyUnicode_FromEncodedObject(
 *                     _resolveQNameText(self, value), 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *             _setNodeText(self._c_node, value)
 * 
 */
  __pyx_3 = PyUnicode_FromEncodedObject(__pyx_2,__pyx_k343,__pyx_k344); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":792
 *                 value = python.PyUnicode_FromEncodedObject(
 *                     _resolveQNameText(self, value), 'UTF-8', 'strict')
 *             _setNodeText(self._c_node, value)             # <<<<<<<<<<<<<< 
 * 
 *     property tail:
 */
__pyx_4 = __pyx_f_4lxml_5etree__setNodeText(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_value); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.text.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":799
 *         there was no text.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return _collectText(self._c_node.next)
 *            
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_4tail___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":800
 *         """
 *         def __get__(self):
 *             return _collectText(self._c_node.next)             # <<<<<<<<<<<<<< 
 *            
 *         def __set__(self, value):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->next); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.tail.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":802
 *             return _collectText(self._c_node.next)
 *            
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             _setTailText(self._c_node, value)
 * 
 */

static int __pyx_pf_4lxml_5etree_8_Element_4tail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element_4tail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":803
 *            
 *         def __set__(self, value):
 *             _setTailText(self._c_node, value)             # <<<<<<<<<<<<<< 
 * 
 *     # not in ElementTree, read-only
 */
__pyx_1 = __pyx_f_4lxml_5etree__setTailText(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_value); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.tail.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":809
 *         """Namespace prefix or None.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._c_node.ns is not NULL:
 *                 if self._c_node.ns.prefix is not NULL:
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_6prefix___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":810
 *         """
 *         def __get__(self):
 *             if self._c_node.ns is not NULL:             # <<<<<<<<<<<<<< 
 *                 if self._c_node.ns.prefix is not NULL:
 *                     return funicode(self._c_node.ns.prefix)
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":811
 *         def __get__(self):
 *             if self._c_node.ns is not NULL:
 *                 if self._c_node.ns.prefix is not NULL:             # <<<<<<<<<<<<<< 
 *                     return funicode(self._c_node.ns.prefix)
 *             return None
 */
  __pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":812
 *             if self._c_node.ns is not NULL:
 *                 if self._c_node.ns.prefix is not NULL:
 *                     return funicode(self._c_node.ns.prefix)             # <<<<<<<<<<<<<< 
 *             return None
 * 
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":813
 *                 if self._c_node.ns.prefix is not NULL:
 *                     return funicode(self._c_node.ns.prefix)
 *             return None             # <<<<<<<<<<<<<< 
 * 
 *     # not in ElementTree, read-only
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.prefix.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":819
 *         """Original line number as found by the parser or None if unknown.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef long line
 *             line = tree.xmlGetLineNo(self._c_node)
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(PyObject *__pyx_v_self) {
long __pyx_v_line;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":821
 *         def __get__(self):
 *             cdef long line
 *             line = tree.xmlGetLineNo(self._c_node)             # <<<<<<<<<<<<<< 
 *             if line > 0:
 *                 return line
 */
__pyx_v_line = xmlGetLineNo(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":822
 *             cdef long line
 *             line = tree.xmlGetLineNo(self._c_node)
 *             if line > 0:             # <<<<<<<<<<<<<< 
 *                 return line
 *             else:
 */
__pyx_1 = (__pyx_v_line > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":823
 *             line = tree.xmlGetLineNo(self._c_node)
 *             if line > 0:
 *                 return line             # <<<<<<<<<<<<<< 
 *             else:
 *                 return None
 */
  __pyx_2 = PyInt_FromLong(__pyx_v_line); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":825
 *                 return line
 *             else:
 *                 return None             # <<<<<<<<<<<<<< 
 * 
 *         def __set__(self, line):
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.sourceline.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":827
 *                 return None
 * 
 *         def __set__(self, line):             # <<<<<<<<<<<<<< 
 *             if line < 0:
 *                 self._c_node.line = 0
 */

static int __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_line); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_line) {
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
unsigned short __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_line);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":828
 * 
 *         def __set__(self, line):
 *             if line < 0:             # <<<<<<<<<<<<<< 
 *                 self._c_node.line = 0
 *             else:
 */
__pyx_1 = PyObject_RichCompare(__pyx_v_line, __pyx_num_0, Py_LT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 828; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":829
 *         def __set__(self, line):
 *             if line < 0:
 *                 self._c_node.line = 0             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._c_node.line = line
 */
  ((struct LxmlElement *)__pyx_v_self)->_c_node->line = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":831
 *                 self._c_node.line = 0
 *             else:
 *                 self._c_node.line = line             # <<<<<<<<<<<<<< 
 * 
 *     # not in ElementTree, read-only
 */
  __pyx_3 = PyInt_AsLong(__pyx_v_line); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":831
 *                 self._c_node.line = 0
 *             else:
 *                 self._c_node.line = line             # <<<<<<<<<<<<<< 
 * 
 *     # not in ElementTree, read-only
 */
  ((struct LxmlElement *)__pyx_v_self)->_c_node->line = __pyx_3;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.sourceline.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_line);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":837
 *         """Namespace prefix->URI mapping known in the context of this Element.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef xmlNode* c_node
 *             cdef xmlNs* c_ns
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(PyObject *__pyx_v_self) {
xmlNode *__pyx_v_c_node;
xmlNs *__pyx_v_c_ns;
PyObject *__pyx_v_nsmap;
PyObject *__pyx_v_prefix;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
Py_INCREF(__pyx_v_self);
__pyx_v_nsmap = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":840
 *             cdef xmlNode* c_node
 *             cdef xmlNs* c_ns
 *             nsmap = {}             # <<<<<<<<<<<<<< 
 *             c_node = self._c_node
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; goto __pyx_L1;}
Py_DECREF(__pyx_v_nsmap);
__pyx_v_nsmap = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":841
 *             cdef xmlNs* c_ns
 *             nsmap = {}
 *             c_node = self._c_node             # <<<<<<<<<<<<<< 
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
 *                 c_ns = c_node.nsDef
 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":842
 *             nsmap = {}
 *             c_node = self._c_node
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":842
 *             nsmap = {}
 *             c_node = self._c_node
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:
 */
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":842
 *             nsmap = {}
 *             c_node = self._c_node
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:
 */
    __pyx_2 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
  }
  if (!__pyx_2) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":843
 *             c_node = self._c_node
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
 *                 c_ns = c_node.nsDef             # <<<<<<<<<<<<<< 
 *                 while c_ns is not NULL:
 *                     if c_ns.prefix is NULL:
 */
  __pyx_v_c_ns = __pyx_v_c_node->nsDef;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":844
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *                     if c_ns.prefix is NULL:
 *                         prefix = None
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":844
 *             while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE:
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *                     if c_ns.prefix is NULL:
 *                         prefix = None
 */
    __pyx_2 = (__pyx_v_c_ns != NULL);
    if (!__pyx_2) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":845
 *                 c_ns = c_node.nsDef
 *                 while c_ns is not NULL:
 *                     if c_ns.prefix is NULL:             # <<<<<<<<<<<<<< 
 *                         prefix = None
 *                     else:
 */
    __pyx_2 = (__pyx_v_c_ns->prefix == NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":846
 *                 while c_ns is not NULL:
 *                     if c_ns.prefix is NULL:
 *                         prefix = None             # <<<<<<<<<<<<<< 
 *                     else:
 *                         prefix = funicode(c_ns.prefix)
 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = Py_None;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":848
 *                         prefix = None
 *                     else:
 *                         prefix = funicode(c_ns.prefix)             # <<<<<<<<<<<<<< 
 *                     if not python.PyDict_Contains(nsmap, prefix):
 *                         python.PyDict_SetItem(
 */
      __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 848; goto __pyx_L1;}
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":849
 *                     else:
 *                         prefix = funicode(c_ns.prefix)
 *                     if not python.PyDict_Contains(nsmap, prefix):             # <<<<<<<<<<<<<< 
 *                         python.PyDict_SetItem(
 *                             nsmap, prefix, funicode(c_ns.href))
 */
    __pyx_3 = PyDict_Contains(__pyx_v_nsmap,__pyx_v_prefix); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; goto __pyx_L1;}
    __pyx_2 = (!__pyx_3);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":851
 *                     if not python.PyDict_Contains(nsmap, prefix):
 *                         python.PyDict_SetItem(
 *                             nsmap, prefix, funicode(c_ns.href))             # <<<<<<<<<<<<<< 
 *                     c_ns = c_ns.next
 *                 c_node = c_node.parent
 */
      __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->href); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
      __pyx_3 = PyDict_SetItem(__pyx_v_nsmap,__pyx_v_prefix,__pyx_1); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":852
 *                         python.PyDict_SetItem(
 *                             nsmap, prefix, funicode(c_ns.href))
 *                     c_ns = c_ns.next             # <<<<<<<<<<<<<< 
 *                 c_node = c_node.parent
 *             return nsmap
 */
    __pyx_v_c_ns = __pyx_v_c_ns->next;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":853
 *                             nsmap, prefix, funicode(c_ns.href))
 *                     c_ns = c_ns.next
 *                 c_node = c_node.parent             # <<<<<<<<<<<<<< 
 *             return nsmap
 * 
 */
  __pyx_v_c_node = __pyx_v_c_node->parent;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":854
 *                     c_ns = c_ns.next
 *                 c_node = c_node.parent
 *             return nsmap             # <<<<<<<<<<<<<< 
 * 
 *     # ACCESSORS
 */
Py_INCREF(__pyx_v_nsmap);
__pyx_r = __pyx_v_nsmap;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.nsmap.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_nsmap);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":857
 * 
 *     # ACCESSORS
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "<Element %s at %x>" % (self.tag, id(self))
 *     
 */

static PyObject *__pyx_n_tag;
static PyObject *__pyx_n_id;

static PyObject *__pyx_k345p;

static PyObject *__pyx_builtin_id;

static char __pyx_k345[] = "<Element %s at %x>";

static PyObject *__pyx_pf_4lxml_5etree_8_Element___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":858
 *     # ACCESSORS
 *     def __repr__(self):
 *         return "<Element %s at %x>" % (self.tag, id(self))             # <<<<<<<<<<<<<< 
 *     
 *     def __getitem__(self, x):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":858
 *     # ACCESSORS
 *     def __repr__(self):
 *         return "<Element %s at %x>" % (self.tag, id(self))             # <<<<<<<<<<<<<< 
 *     
 *     def __getitem__(self, x):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_builtin_id, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3);
__pyx_1 = 0;
__pyx_3 = 0;
__pyx_1 = PyNumber_Remainder(__pyx_k345p, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":860
 *         return "<Element %s at %x>" % (self.tag, id(self))
 *     
 *     def __getitem__(self, x):             # <<<<<<<<<<<<<< 
 *         """Returns the subelement at the given position or the requested
 *         slice.
 */

static PyObject *__pyx_k346p;

static char __pyx_k346[] = "list index out of range";

static PyObject *__pyx_pf_4lxml_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element___getitem__[] = "Returns the subelement at the given position or the requested\n        slice.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
xmlNode *__pyx_v_c_node;
Py_ssize_t __pyx_v_step;
Py_ssize_t __pyx_v_slicelength;
Py_ssize_t __pyx_v_c;
Py_ssize_t __pyx_v_i;
_node_to_node_function __pyx_v_next_element;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_ssize_t __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":868
 *         cdef Py_ssize_t c, i
 *         cdef _node_to_node_function next_element
 *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<< 
 *             # slicing
 *             if _isFullSlice(<python.slice>x):
 */
__pyx_1 = PySlice_Check(__pyx_v_x);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":870
 *         if python.PySlice_Check(x):
 *             # slicing
 *             if _isFullSlice(<python.slice>x):             # <<<<<<<<<<<<<< 
 *                 return _collectChildren(self)
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 */
  __pyx_1 = __pyx_f_4lxml_5etree__isFullSlice(((PySliceObject *)__pyx_v_x));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":871
 *             # slicing
 *             if _isFullSlice(<python.slice>x):
 *                 return _collectChildren(self)             # <<<<<<<<<<<<<< 
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *             if c_node is NULL:
 */
    __pyx_2 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 871; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":872
 *             if _isFullSlice(<python.slice>x):
 *                 return _collectChildren(self)
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 return []
 */
  if (!__Pyx_TypeTest(__pyx_v_x, __pyx_ptype_6python_slice)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":872
 *             if _isFullSlice(<python.slice>x):
 *                 return _collectChildren(self)
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 return []
 */
  __pyx_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_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 872; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":873
 *                 return _collectChildren(self)
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *             if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 return []
 *             if step > 0:
 */
  __pyx_1 = (__pyx_v_c_node == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":874
 *             _findChildSlice(x, self._c_node, &c_node, &step, &slicelength)
 *             if c_node is NULL:
 *                 return []             # <<<<<<<<<<<<<< 
 *             if step > 0:
 *                 next_element = _nextElement
 */
    __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":875
 *             if c_node is NULL:
 *                 return []
 *             if step > 0:             # <<<<<<<<<<<<<< 
 *                 next_element = _nextElement
 *             else:
 */
  __pyx_1 = (__pyx_v_step > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":876
 *                 return []
 *             if step > 0:
 *                 next_element = _nextElement             # <<<<<<<<<<<<<< 
 *             else:
 *                 step = -step
 */
    __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":878
 *                 next_element = _nextElement
 *             else:
 *                 step = -step             # <<<<<<<<<<<<<< 
 *                 next_element = _previousElement
 *             result = []
 */
    __pyx_v_step = (-__pyx_v_step);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":879
 *             else:
 *                 step = -step
 *                 next_element = _previousElement             # <<<<<<<<<<<<<< 
 *             result = []
 *             c = 0
 */
    __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":880
 *                 step = -step
 *                 next_element = _previousElement
 *             result = []             # <<<<<<<<<<<<<< 
 *             c = 0
 *             while c_node is not NULL and c < slicelength:
 */
  __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; goto __pyx_L1;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":881
 *                 next_element = _previousElement
 *             result = []
 *             c = 0             # <<<<<<<<<<<<<< 
 *             while c_node is not NULL and c < slicelength:
 *                 python.PyList_Append(
 */
  __pyx_v_c = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":882
 *             result = []
 *             c = 0
 *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(
 *                     result, _elementFactory(self._doc, c_node))
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":882
 *             result = []
 *             c = 0
 *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(
 *                     result, _elementFactory(self._doc, c_node))
 */
    __pyx_1 = (__pyx_v_c_node != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":882
 *             result = []
 *             c = 0
 *             while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(
 *                     result, _elementFactory(self._doc, c_node))
 */
      __pyx_1 = (__pyx_v_c < __pyx_v_slicelength);
    }
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":884
 *             while c_node is not NULL and c < slicelength:
 *                 python.PyList_Append(
 *                     result, _elementFactory(self._doc, c_node))             # <<<<<<<<<<<<<< 
 *                 c = c + 1
 *                 for i from 0 <= i < step:
 */
    __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; goto __pyx_L1;}
    __pyx_3 = PyList_Append(__pyx_v_result,__pyx_2); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 883; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":885
 *                 python.PyList_Append(
 *                     result, _elementFactory(self._doc, c_node))
 *                 c = c + 1             # <<<<<<<<<<<<<< 
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)
 */
    __pyx_v_c = (__pyx_v_c + 1);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":886
 *                     result, _elementFactory(self._doc, c_node))
 *                 c = c + 1
 *                 for i from 0 <= i < step:             # <<<<<<<<<<<<<< 
 *                     c_node = next_element(c_node)
 *             return result
 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_step; __pyx_v_i++) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":887
 *                 c = c + 1
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<< 
 *             return result
 *         else:
 */
      __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":888
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)
 *             return result             # <<<<<<<<<<<<<< 
 *         else:
 *             # indexing
 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":891
 *         else:
 *             # indexing
 *             c_node = _findChild(self._c_node, x)             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"
 */
  __pyx_4 = __pyx_PyIndex_AsSsize_t(__pyx_v_x); if (unlikely((__pyx_4 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; goto __pyx_L1;}
  __pyx_v_c_node = __pyx_f_4lxml_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":892
 *             # indexing
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 raise IndexError, "list index out of range"
 *             return _elementFactory(self._doc, c_node)
 */
  __pyx_1 = (__pyx_v_c_node == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":893
 *             c_node = _findChild(self._c_node, x)
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"             # <<<<<<<<<<<<<< 
 *             return _elementFactory(self._doc, c_node)
 *             
 */
    __Pyx_Raise(__pyx_builtin_IndexError, __pyx_k346p, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":894
 *             if c_node is NULL:
 *                 raise IndexError, "list index out of range"
 *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *             
 *     def __len__(self):
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 894; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_x);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":896
 *             return _elementFactory(self._doc, c_node)
 *             
 *     def __len__(self):             # <<<<<<<<<<<<<< 
 *         """Returns the number of subelements.
 *         """
 */

static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element___len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element___len__[] = "Returns the number of subelements.\n        ";
static Py_ssize_t __pyx_pf_4lxml_5etree_8_Element___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":899
 *         """Returns the number of subelements.
 *         """
 *         return _countElements(self._c_node.children)             # <<<<<<<<<<<<<< 
 * 
 *     def __nonzero__(self):
 */
__pyx_r = __pyx_f_4lxml_5etree__countElements(((struct LxmlElement *)__pyx_v_self)->_c_node->children);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":901
 *         return _countElements(self._c_node.children)
 * 
 *     def __nonzero__(self):             # <<<<<<<<<<<<<< 
 *         import warnings
 *         warnings.warn(
 */

static PyObject *__pyx_n_warnings;
static PyObject *__pyx_n_warn;
static PyObject *__pyx_n_FutureWarning;

static PyObject *__pyx_k348p;

static PyObject *__pyx_builtin_FutureWarning;

static char __pyx_k348[] = "The behavior of this method will change in future versions. Use specific 'len(elem)' or 'elem is not None' test instead.";

static int __pyx_pf_4lxml_5etree_8_Element___nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element___nonzero__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_warnings;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_warnings = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":902
 * 
 *     def __nonzero__(self):
 *         import warnings             # <<<<<<<<<<<<<< 
 *         warnings.warn(
 *             "The behavior of this method will change in future versions. "
 */
__pyx_1 = __Pyx_Import(__pyx_n_warnings, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; goto __pyx_L1;}
Py_DECREF(__pyx_v_warnings);
__pyx_v_warnings = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":903
 *     def __nonzero__(self):
 *         import warnings
 *         warnings.warn(             # <<<<<<<<<<<<<< 
 *             "The behavior of this method will change in future versions. "
 *             "Use specific 'len(elem)' or 'elem is not None' test instead.",
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_warnings, __pyx_n_warn); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":907
 *             "Use specific 'len(elem)' or 'elem is not None' test instead.",
 *             FutureWarning
 *             )             # <<<<<<<<<<<<<< 
 *         # emulate old behaviour
 *         return _hasChild(self._c_node)
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
Py_INCREF(__pyx_k348p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k348p);
Py_INCREF(__pyx_builtin_FutureWarning);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_builtin_FutureWarning);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 903; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":909
 *             )
 *         # emulate old behaviour
 *         return _hasChild(self._c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __contains__(self, element):
 */
__pyx_r = __pyx_f_4lxml_5etree__hasChild(((struct LxmlElement *)__pyx_v_self)->_c_node);
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.__nonzero__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_warnings);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":911
 *         return _hasChild(self._c_node)
 * 
 *     def __contains__(self, element):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         if not isinstance(element, _Element):
 */

static int __pyx_pf_4lxml_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static int __pyx_pf_4lxml_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":913
 *     def __contains__(self, element):
 *         cdef xmlNode* c_node
 *         if not isinstance(element, _Element):             # <<<<<<<<<<<<<< 
 *             return 0
 *         c_node = (<_Element>element)._c_node
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":914
 *         cdef xmlNode* c_node
 *         if not isinstance(element, _Element):
 *             return 0             # <<<<<<<<<<<<<< 
 *         c_node = (<_Element>element)._c_node
 *         return c_node is not NULL and c_node.parent is self._c_node
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":915
 *         if not isinstance(element, _Element):
 *             return 0
 *         c_node = (<_Element>element)._c_node             # <<<<<<<<<<<<<< 
 *         return c_node is not NULL and c_node.parent is self._c_node
 * 
 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":916
 *             return 0
 *         c_node = (<_Element>element)._c_node
 *         return c_node is not NULL and c_node.parent is self._c_node             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":916
 *             return 0
 *         c_node = (<_Element>element)._c_node
 *         return c_node is not NULL and c_node.parent is self._c_node             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
  __pyx_1 = (__pyx_v_c_node->parent == ((struct LxmlElement *)__pyx_v_self)->_c_node);
}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Element.__contains__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":918
 *         return c_node is not NULL and c_node.parent is self._c_node
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return ElementChildIterator(self)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":919
 * 
 *     def __iter__(self):
 *         return ElementChildIterator(self)             # <<<<<<<<<<<<<< 
 * 
 *     def __reversed__(self):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 919; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":921
 *         return ElementChildIterator(self)
 * 
 *     def __reversed__(self):             # <<<<<<<<<<<<<< 
 *         return ElementChildIterator(self, reversed=True)
 * 
 */

static PyObject *__pyx_n_reversed;


static PyObject *__pyx_pf_4lxml_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":922
 * 
 *     def __reversed__(self):
 *         return ElementChildIterator(self, reversed=True)             # <<<<<<<<<<<<<< 
 * 
 *     def index(self, _Element x not None, start=None, stop=None):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":922
 * 
 *     def __reversed__(self):
 *         return ElementChildIterator(self, reversed=True)             # <<<<<<<<<<<<<< 
 * 
 *     def index(self, _Element x not None, start=None, stop=None):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_reversed, Py_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 922; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.__reversed__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":924
 *         return ElementChildIterator(self, reversed=True)
 * 
 *     def index(self, _Element x not None, start=None, stop=None):             # <<<<<<<<<<<<<< 
 *         """Find the position of the child within the parent.
 * 
 */

static PyObject *__pyx_k350p;
static PyObject *__pyx_k351p;
static PyObject *__pyx_k352p;
static PyObject *__pyx_k353p;
static PyObject *__pyx_k354p;
static PyObject *__pyx_k355p;

static char __pyx_k350[] = "Element is not a child of this node.";
static char __pyx_k351[] = "list.index(x): x not in slice";
static char __pyx_k352[] = "list.index(x): x not in slice";
static char __pyx_k353[] = "list.index(x): x not in slice";
static char __pyx_k354[] = "list.index(x): x not in slice";
static char __pyx_k355[] = "list.index(x): x not in list";

static PyObject *__pyx_pf_4lxml_5etree_8_Element_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_index[] = "Find the position of the child within the parent.\n\n        This method is not part of the original ElementTree API.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_x = 0;
PyObject *__pyx_v_start = 0;
PyObject *__pyx_v_stop = 0;
Py_ssize_t __pyx_v_k;
Py_ssize_t __pyx_v_l;
Py_ssize_t __pyx_v_c_start;
Py_ssize_t __pyx_v_c_stop;
xmlNode *__pyx_v_c_child;
xmlNode *__pyx_v_c_start_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
static char *__pyx_argnames[] = {"x","start","stop",0};
__pyx_v_start = __pyx_k58;
__pyx_v_stop = __pyx_k59;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_x, &__pyx_v_start, &__pyx_v_stop))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
Py_INCREF(__pyx_v_start);
Py_INCREF(__pyx_v_stop);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_4lxml_5etree__Element, 0, "x"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":933
 *         cdef xmlNode* c_child
 *         cdef xmlNode* c_start_node
 *         c_child = x._c_node             # <<<<<<<<<<<<<< 
 *         if c_child.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."
 */
__pyx_v_c_child = __pyx_v_x->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":934
 *         cdef xmlNode* c_start_node
 *         c_child = x._c_node
 *         if c_child.parent is not self._c_node:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Element is not a child of this node."
 * 
 */
__pyx_1 = (__pyx_v_c_child->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":935
 *         c_child = x._c_node
 *         if c_child.parent is not self._c_node:
 *             raise ValueError, "Element is not a child of this node."             # <<<<<<<<<<<<<< 
 * 
 *         # handle the unbounded search straight away (normal case)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k350p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":938
 * 
 *         # handle the unbounded search straight away (normal case)
 *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<< 
 *             k = 0
 *             c_child = c_child.prev
 */
__pyx_1 = (__pyx_v_stop == Py_None);
__pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
if (__pyx_1) {
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":938
 * 
 *         # handle the unbounded search straight away (normal case)
 *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<< 
 *             k = 0
 *             c_child = c_child.prev
 */
  __pyx_1 = (__pyx_v_start == Py_None);
  __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
  if (!__pyx_1) {
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":938
 * 
 *         # handle the unbounded search straight away (normal case)
 *         if stop is None and (start is None or start == 0):             # <<<<<<<<<<<<<< 
 *             k = 0
 *             c_child = c_child.prev
 */
    __pyx_2 = PyObject_RichCompare(__pyx_v_start, __pyx_num_0, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
  }
}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 938; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":939
 *         # handle the unbounded search straight away (normal case)
 *         if stop is None and (start is None or start == 0):
 *             k = 0             # <<<<<<<<<<<<<< 
 *             c_child = c_child.prev
 *             while c_child is not NULL:
 */
  __pyx_v_k = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":940
 *         if stop is None and (start is None or start == 0):
 *             k = 0
 *             c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *             while c_child is not NULL:
 *                 if _isElement(c_child):
 */
  __pyx_v_c_child = __pyx_v_c_child->prev;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":941
 *             k = 0
 *             c_child = c_child.prev
 *             while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":941
 *             k = 0
 *             c_child = c_child.prev
 *             while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":942
 *             c_child = c_child.prev
 *             while c_child is not NULL:
 *                 if _isElement(c_child):             # <<<<<<<<<<<<<< 
 *                     k = k + 1
 *                 c_child = c_child.prev
 */
    __pyx_1 = _isElement(__pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":943
 *             while c_child is not NULL:
 *                 if _isElement(c_child):
 *                     k = k + 1             # <<<<<<<<<<<<<< 
 *                 c_child = c_child.prev
 *             return k
 */
      __pyx_v_k = (__pyx_v_k + 1);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":944
 *                 if _isElement(c_child):
 *                     k = k + 1
 *                 c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *             return k
 * 
 */
    __pyx_v_c_child = __pyx_v_c_child->prev;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":945
 *                     k = k + 1
 *                 c_child = c_child.prev
 *             return k             # <<<<<<<<<<<<<< 
 * 
 *         # check indices
 */
  __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 945; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":948
 * 
 *         # check indices
 *         if start is None:             # <<<<<<<<<<<<<< 
 *             c_start = 0
 *         else:
 */
__pyx_1 = (__pyx_v_start == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":949
 *         # check indices
 *         if start is None:
 *             c_start = 0             # <<<<<<<<<<<<<< 
 *         else:
 *             c_start = start
 */
  __pyx_v_c_start = 0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":951
 *             c_start = 0
 *         else:
 *             c_start = start             # <<<<<<<<<<<<<< 
 *         if stop is None:
 *             c_stop = 0
 */
  __pyx_3 = __pyx_PyIndex_AsSsize_t(__pyx_v_start); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 951; goto __pyx_L1;}
  __pyx_v_c_start = __pyx_3;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":952
 *         else:
 *             c_start = start
 *         if stop is None:             # <<<<<<<<<<<<<< 
 *             c_stop = 0
 *         else:
 */
__pyx_1 = (__pyx_v_stop == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":953
 *             c_start = start
 *         if stop is None:
 *             c_stop = 0             # <<<<<<<<<<<<<< 
 *         else:
 *             c_stop = stop
 */
  __pyx_v_c_stop = 0;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":955
 *             c_stop = 0
 *         else:
 *             c_stop = stop             # <<<<<<<<<<<<<< 
 *             if c_stop == 0 or \
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
 */
  __pyx_3 = __pyx_PyIndex_AsSsize_t(__pyx_v_stop); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 955; goto __pyx_L1;}
  __pyx_v_c_stop = __pyx_3;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":956
 *         else:
 *             c_stop = stop
 *             if c_stop == 0 or \             # <<<<<<<<<<<<<< 
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
 *                 raise ValueError, "list.index(x): x not in slice"
 */
  __pyx_1 = (__pyx_v_c_stop == 0);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":957
 *             c_stop = stop
 *             if c_stop == 0 or \
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):             # <<<<<<<<<<<<<< 
 *                 raise ValueError, "list.index(x): x not in slice"
 * 
 */
    __pyx_1 = (__pyx_v_c_start >= __pyx_v_c_stop);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":957
 *             c_stop = stop
 *             if c_stop == 0 or \
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):             # <<<<<<<<<<<<<< 
 *                 raise ValueError, "list.index(x): x not in slice"
 * 
 */
      __pyx_1 = (__pyx_v_c_stop > 0);
      if (!__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":957
 *             c_stop = stop
 *             if c_stop == 0 or \
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):             # <<<<<<<<<<<<<< 
 *                 raise ValueError, "list.index(x): x not in slice"
 * 
 */
        __pyx_1 = (__pyx_v_c_start < 0);
      }
    }
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":958
 *             if c_stop == 0 or \
 *                    c_start >= c_stop and (c_stop > 0 or c_start < 0):
 *                 raise ValueError, "list.index(x): x not in slice"             # <<<<<<<<<<<<<< 
 * 
 *         # for negative slice indices, check slice before searching index
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k351p, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 958; goto __pyx_L1;}
    goto __pyx_L9;
  }
  __pyx_L9:;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":961
 * 
 *         # for negative slice indices, check slice before searching index
 *         if c_start < 0 or c_stop < 0:             # <<<<<<<<<<<<<< 
 *             # start from right, at most up to leftmost(c_start, c_stop)
 *             if c_start < c_stop:
 */
__pyx_1 = (__pyx_v_c_start < 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":961
 * 
 *         # for negative slice indices, check slice before searching index
 *         if c_start < 0 or c_stop < 0:             # <<<<<<<<<<<<<< 
 *             # start from right, at most up to leftmost(c_start, c_stop)
 *             if c_start < c_stop:
 */
  __pyx_1 = (__pyx_v_c_stop < 0);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":963
 *         if c_start < 0 or c_stop < 0:
 *             # start from right, at most up to leftmost(c_start, c_stop)
 *             if c_start < c_stop:             # <<<<<<<<<<<<<< 
 *                 k = -c_start
 *             else:
 */
  __pyx_1 = (__pyx_v_c_start < __pyx_v_c_stop);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":964
 *             # start from right, at most up to leftmost(c_start, c_stop)
 *             if c_start < c_stop:
 *                 k = -c_start             # <<<<<<<<<<<<<< 
 *             else:
 *                 k = -c_stop
 */
    __pyx_v_k = (-__pyx_v_c_start);
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":966
 *                 k = -c_start
 *             else:
 *                 k = -c_stop             # <<<<<<<<<<<<<< 
 *             c_start_node = self._c_node.last
 *             l = 1
 */
    __pyx_v_k = (-__pyx_v_c_stop);
  }
  __pyx_L11:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":967
 *             else:
 *                 k = -c_stop
 *             c_start_node = self._c_node.last             # <<<<<<<<<<<<<< 
 *             l = 1
 *             while c_start_node != c_child and l < k:
 */
  __pyx_v_c_start_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->last;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":968
 *                 k = -c_stop
 *             c_start_node = self._c_node.last
 *             l = 1             # <<<<<<<<<<<<<< 
 *             while c_start_node != c_child and l < k:
 *                 if _isElement(c_start_node):
 */
  __pyx_v_l = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":969
 *             c_start_node = self._c_node.last
 *             l = 1
 *             while c_start_node != c_child and l < k:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_start_node):
 *                     l = l + 1
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":969
 *             c_start_node = self._c_node.last
 *             l = 1
 *             while c_start_node != c_child and l < k:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_start_node):
 *                     l = l + 1
 */
    __pyx_1 = (__pyx_v_c_start_node != __pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":969
 *             c_start_node = self._c_node.last
 *             l = 1
 *             while c_start_node != c_child and l < k:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_start_node):
 *                     l = l + 1
 */
      __pyx_1 = (__pyx_v_l < __pyx_v_k);
    }
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":970
 *             l = 1
 *             while c_start_node != c_child and l < k:
 *                 if _isElement(c_start_node):             # <<<<<<<<<<<<<< 
 *                     l = l + 1
 *                 c_start_node = c_start_node.prev
 */
    __pyx_1 = _isElement(__pyx_v_c_start_node);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":971
 *             while c_start_node != c_child and l < k:
 *                 if _isElement(c_start_node):
 *                     l = l + 1             # <<<<<<<<<<<<<< 
 *                 c_start_node = c_start_node.prev
 *             if c_start_node == c_child:
 */
      __pyx_v_l = (__pyx_v_l + 1);
      goto __pyx_L14;
    }
    __pyx_L14:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":972
 *                 if _isElement(c_start_node):
 *                     l = l + 1
 *                 c_start_node = c_start_node.prev             # <<<<<<<<<<<<<< 
 *             if c_start_node == c_child:
 *                 # found! before slice end?
 */
    __pyx_v_c_start_node = __pyx_v_c_start_node->prev;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":973
 *                     l = l + 1
 *                 c_start_node = c_start_node.prev
 *             if c_start_node == c_child:             # <<<<<<<<<<<<<< 
 *                 # found! before slice end?
 *                 if c_stop < 0 and l <= -c_stop:
 */
  __pyx_1 = (__pyx_v_c_start_node == __pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":975
 *             if c_start_node == c_child:
 *                 # found! before slice end?
 *                 if c_stop < 0 and l <= -c_stop:             # <<<<<<<<<<<<<< 
 *                     raise ValueError, "list.index(x): x not in slice"
 *             elif c_start < 0:
 */
    __pyx_1 = (__pyx_v_c_stop < 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":975
 *             if c_start_node == c_child:
 *                 # found! before slice end?
 *                 if c_stop < 0 and l <= -c_stop:             # <<<<<<<<<<<<<< 
 *                     raise ValueError, "list.index(x): x not in slice"
 *             elif c_start < 0:
 */
      __pyx_1 = (__pyx_v_l <= (-__pyx_v_c_stop));
    }
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":976
 *                 # found! before slice end?
 *                 if c_stop < 0 and l <= -c_stop:
 *                     raise ValueError, "list.index(x): x not in slice"             # <<<<<<<<<<<<<< 
 *             elif c_start < 0:
 *                 raise ValueError, "list.index(x): x not in slice"
 */
      __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k352p, 0);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 976; goto __pyx_L1;}
      goto __pyx_L16;
    }
    __pyx_L16:;
    goto __pyx_L15;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":977
 *                 if c_stop < 0 and l <= -c_stop:
 *                     raise ValueError, "list.index(x): x not in slice"
 *             elif c_start < 0:             # <<<<<<<<<<<<<< 
 *                 raise ValueError, "list.index(x): x not in slice"
 * 
 */
  __pyx_1 = (__pyx_v_c_start < 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":978
 *                     raise ValueError, "list.index(x): x not in slice"
 *             elif c_start < 0:
 *                 raise ValueError, "list.index(x): x not in slice"             # <<<<<<<<<<<<<< 
 * 
 *         # now determine the index backwards from child
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k353p, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 978; goto __pyx_L1;}
    goto __pyx_L15;
  }
  __pyx_L15:;
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":981
 * 
 *         # now determine the index backwards from child
 *         c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *         k = 0
 *         if c_stop > 0:
 */
__pyx_v_c_child = __pyx_v_c_child->prev;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":982
 *         # now determine the index backwards from child
 *         c_child = c_child.prev
 *         k = 0             # <<<<<<<<<<<<<< 
 *         if c_stop > 0:
 *             # we can optimize: stop after c_stop elements if not found
 */
__pyx_v_k = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":983
 *         c_child = c_child.prev
 *         k = 0
 *         if c_stop > 0:             # <<<<<<<<<<<<<< 
 *             # we can optimize: stop after c_stop elements if not found
 *             while c_child != NULL and k < c_stop:
 */
__pyx_1 = (__pyx_v_c_stop > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":985
 *         if c_stop > 0:
 *             # we can optimize: stop after c_stop elements if not found
 *             while c_child != NULL and k < c_stop:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":985
 *         if c_stop > 0:
 *             # we can optimize: stop after c_stop elements if not found
 *             while c_child != NULL and k < c_stop:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":985
 *         if c_stop > 0:
 *             # we can optimize: stop after c_stop elements if not found
 *             while c_child != NULL and k < c_stop:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
      __pyx_1 = (__pyx_v_k < __pyx_v_c_stop);
    }
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":986
 *             # we can optimize: stop after c_stop elements if not found
 *             while c_child != NULL and k < c_stop:
 *                 if _isElement(c_child):             # <<<<<<<<<<<<<< 
 *                     k = k + 1
 *                 c_child = c_child.prev
 */
    __pyx_1 = _isElement(__pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":987
 *             while c_child != NULL and k < c_stop:
 *                 if _isElement(c_child):
 *                     k = k + 1             # <<<<<<<<<<<<<< 
 *                 c_child = c_child.prev
 *             if k < c_stop:
 */
      __pyx_v_k = (__pyx_v_k + 1);
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":988
 *                 if _isElement(c_child):
 *                     k = k + 1
 *                 c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *             if k < c_stop:
 *                 return k
 */
    __pyx_v_c_child = __pyx_v_c_child->prev;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":989
 *                     k = k + 1
 *                 c_child = c_child.prev
 *             if k < c_stop:             # <<<<<<<<<<<<<< 
 *                 return k
 *         else:
 */
  __pyx_1 = (__pyx_v_k < __pyx_v_c_stop);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":990
 *                 c_child = c_child.prev
 *             if k < c_stop:
 *                 return k             # <<<<<<<<<<<<<< 
 *         else:
 *             # traverse all
 */
    __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 990; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L21;
  }
  __pyx_L21:;
  goto __pyx_L17;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":993
 *         else:
 *             # traverse all
 *             while c_child != NULL:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":993
 *         else:
 *             # traverse all
 *             while c_child != NULL:             # <<<<<<<<<<<<<< 
 *                 if _isElement(c_child):
 *                     k = k + 1
 */
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":994
 *             # traverse all
 *             while c_child != NULL:
 *                 if _isElement(c_child):             # <<<<<<<<<<<<<< 
 *                     k = k + 1
 *                 c_child = c_child.prev
 */
    __pyx_1 = _isElement(__pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":995
 *             while c_child != NULL:
 *                 if _isElement(c_child):
 *                     k = k + 1             # <<<<<<<<<<<<<< 
 *                 c_child = c_child.prev
 *             if c_start > 0:
 */
      __pyx_v_k = (__pyx_v_k + 1);
      goto __pyx_L24;
    }
    __pyx_L24:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":996
 *                 if _isElement(c_child):
 *                     k = k + 1
 *                 c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *             if c_start > 0:
 *                 if k >= c_start:
 */
    __pyx_v_c_child = __pyx_v_c_child->prev;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":997
 *                     k = k + 1
 *                 c_child = c_child.prev
 *             if c_start > 0:             # <<<<<<<<<<<<<< 
 *                 if k >= c_start:
 *                     return k
 */
  __pyx_1 = (__pyx_v_c_start > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":998
 *                 c_child = c_child.prev
 *             if c_start > 0:
 *                 if k >= c_start:             # <<<<<<<<<<<<<< 
 *                     return k
 *             else:
 */
    __pyx_1 = (__pyx_v_k >= __pyx_v_c_start);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":999
 *             if c_start > 0:
 *                 if k >= c_start:
 *                     return k             # <<<<<<<<<<<<<< 
 *             else:
 *                 return k
 */
      __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;}
      __pyx_r = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L0;
      goto __pyx_L26;
    }
    __pyx_L26:;
    goto __pyx_L25;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1001
 *                     return k
 *             else:
 *                 return k             # <<<<<<<<<<<<<< 
 *         if c_start != 0 or c_stop != 0:
 *             raise ValueError, "list.index(x): x not in slice"
 */
    __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1001; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L25:;
}
__pyx_L17:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1002
 *             else:
 *                 return k
 *         if c_start != 0 or c_stop != 0:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "list.index(x): x not in slice"
 *         else:
 */
__pyx_1 = (__pyx_v_c_start != 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1002
 *             else:
 *                 return k
 *         if c_start != 0 or c_stop != 0:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "list.index(x): x not in slice"
 *         else:
 */
  __pyx_1 = (__pyx_v_c_stop != 0);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1003
 *                 return k
 *         if c_start != 0 or c_stop != 0:
 *             raise ValueError, "list.index(x): x not in slice"             # <<<<<<<<<<<<<< 
 *         else:
 *             raise ValueError, "list.index(x): x not in list"
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k354p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1003; goto __pyx_L1;}
  goto __pyx_L27;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1005
 *             raise ValueError, "list.index(x): x not in slice"
 *         else:
 *             raise ValueError, "list.index(x): x not in list"             # <<<<<<<<<<<<<< 
 * 
 *     def get(self, key, default=None):
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k355p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1005; goto __pyx_L1;}
}
__pyx_L27:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.index");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_x);
Py_DECREF(__pyx_v_start);
Py_DECREF(__pyx_v_stop);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1007
 *             raise ValueError, "list.index(x): x not in list"
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         """Gets an element attribute.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_get[] = "Gets an element attribute.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"key","default",0};
__pyx_v_default = __pyx_k60;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1010
 *         """Gets an element attribute.
 *         """
 *         return _getAttributeValue(self, key, default)             # <<<<<<<<<<<<<< 
 * 
 *     def keys(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__getAttributeValue(((struct LxmlElement *)__pyx_v_self),__pyx_v_key,__pyx_v_default); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1010; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.get");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1012
 *         return _getAttributeValue(self, key, default)
 * 
 *     def keys(self):             # <<<<<<<<<<<<<< 
 *         """Gets a list of attribute names.  The names are returned in an
 *         arbitrary order (just like for an ordinary Python dictionary).
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_keys[] = "Gets a list of attribute names.  The names are returned in an\n        arbitrary order (just like for an ordinary Python dictionary).\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1016
 *         arbitrary order (just like for an ordinary Python dictionary).
 *         """
 *         return _collectAttributes(self._c_node, 1)             # <<<<<<<<<<<<<< 
 * 
 *     def values(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node,1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.keys");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1018
 *         return _collectAttributes(self._c_node, 1)
 * 
 *     def values(self):             # <<<<<<<<<<<<<< 
 *         """Gets element attribute values as a sequence of strings.  The
 *         attributes are returned in an arbitrary order.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_values[] = "Gets element attribute values as a sequence of strings.  The\n        attributes are returned in an arbitrary order.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_values(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1022
 *         attributes are returned in an arbitrary order.
 *         """
 *         return _collectAttributes(self._c_node, 2)             # <<<<<<<<<<<<<< 
 * 
 *     def items(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node,2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.values");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1024
 *         return _collectAttributes(self._c_node, 2)
 * 
 *     def items(self):             # <<<<<<<<<<<<<< 
 *         """Gets element attributes, as a sequence. The attributes are returned in
 *         an arbitrary order.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_items[] = "Gets element attributes, as a sequence. The attributes are returned in\n        an arbitrary order.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1028
 *         an arbitrary order.
 *         """
 *         return _collectAttributes(self._c_node, 3)             # <<<<<<<<<<<<<< 
 * 
 *     def getchildren(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct LxmlElement *)__pyx_v_self)->_c_node,3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.items");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1030
 *         return _collectAttributes(self._c_node, 3)
 * 
 *     def getchildren(self):             # <<<<<<<<<<<<<< 
 *         """Returns all direct children.  The elements are returned in document
 *         order.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getchildren[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1038
 *         ``list(element)`` or simply iterate over elements.
 *         """
 *         return _collectChildren(self)             # <<<<<<<<<<<<<< 
 * 
 *     def getparent(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectChildren(((struct LxmlElement *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1038; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.getchildren");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1040
 *         return _collectChildren(self)
 * 
 *     def getparent(self):             # <<<<<<<<<<<<<< 
 *         """Returns the parent of this element or None for the root element.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getparent[] = "Returns the parent of this element or None for the root element.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *unused) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1044
 *         """
 *         cdef xmlNode* c_node
 *         c_node = _parentElement(self._c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             return None
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__parentElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1045
 *         cdef xmlNode* c_node
 *         c_node = _parentElement(self._c_node)
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             return None
 *         else:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1046
 *         c_node = _parentElement(self._c_node)
 *         if c_node is NULL:
 *             return None             # <<<<<<<<<<<<<< 
 *         else:
 *             return _elementFactory(self._doc, c_node)
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1048
 *             return None
 *         else:
 *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def getnext(self):
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.getparent");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1050
 *             return _elementFactory(self._doc, c_node)
 * 
 *     def getnext(self):             # <<<<<<<<<<<<<< 
 *         """Returns the following sibling of this element or None.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getnext[] = "Returns the following sibling of this element or None.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *unused) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1054
 *         """
 *         cdef xmlNode* c_node
 *         c_node = _nextElement(self._c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1055
 *         cdef xmlNode* c_node
 *         c_node = _nextElement(self._c_node)
 *         if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             return _elementFactory(self._doc, c_node)
 *         return None
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1056
 *         c_node = _nextElement(self._c_node)
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1056; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1057
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     def getprevious(self):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.getnext");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1059
 *         return None
 * 
 *     def getprevious(self):             # <<<<<<<<<<<<<< 
 *         """Returns the preceding sibling of this element or None.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getprevious[] = "Returns the preceding sibling of this element or None.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *unused) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1063
 *         """
 *         cdef xmlNode* c_node
 *         c_node = _previousElement(self._c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__previousElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1064
 *         cdef xmlNode* c_node
 *         c_node = _previousElement(self._c_node)
 *         if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             return _elementFactory(self._doc, c_node)
 *         return None
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1065
 *         c_node = _previousElement(self._c_node)
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1066
 *         if c_node is not NULL:
 *             return _elementFactory(self._doc, c_node)
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     def itersiblings(self, tag=None, *, preceding=False):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.getprevious");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1068
 *         return None
 * 
 *     def itersiblings(self, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the following or preceding siblings of this element.
 * 
 */

static PyObject *__pyx_n_preceding;


static PyObject *__pyx_pf_4lxml_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_itersiblings[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_preceding = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"tag","preceding",0};
__pyx_v_tag = __pyx_k61;
__pyx_v_preceding = __pyx_k62;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_tag, &__pyx_v_preceding))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_preceding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1076
 *         'tag' keyword.
 *         """
 *         return SiblingsIterator(self, tag, preceding=preceding)             # <<<<<<<<<<<<<< 
 * 
 *     def iterancestors(self, tag=None):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1076
 *         'tag' keyword.
 *         """
 *         return SiblingsIterator(self, tag, preceding=preceding)             # <<<<<<<<<<<<<< 
 * 
 *     def iterancestors(self, tag=None):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_preceding, __pyx_v_preceding) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_SiblingsIterator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1076; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.itersiblings");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_preceding);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1078
 *         return SiblingsIterator(self, tag, preceding=preceding)
 * 
 *     def iterancestors(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over the ancestors of this element (from parent to parent).
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterancestors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_iterancestors[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterancestors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k63;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1084
 *         the 'tag' keyword.
 *         """
 *         return AncestorsIterator(self, tag)             # <<<<<<<<<<<<<< 
 * 
 *     def iterdescendants(self, tag=None):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_AncestorsIterator), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1084; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.iterancestors");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1086
 *         return AncestorsIterator(self, tag)
 * 
 *     def iterdescendants(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over the descendants of this element in document order.
 * 
 */

static PyObject *__pyx_n_inclusive;


static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterdescendants(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_iterdescendants[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterdescendants(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k64;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1093
 *         name with the 'tag' keyword.
 *         """
 *         return ElementDepthFirstIterator(self, tag, inclusive=False)             # <<<<<<<<<<<<<< 
 * 
 *     def iterchildren(self, tag=None, *, reversed=False):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1093
 *         name with the 'tag' keyword.
 *         """
 *         return ElementDepthFirstIterator(self, tag, inclusive=False)             # <<<<<<<<<<<<<< 
 * 
 *     def iterchildren(self, tag=None, *, reversed=False):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_inclusive, Py_False) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.iterdescendants");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1095
 *         return ElementDepthFirstIterator(self, tag, inclusive=False)
 * 
 *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the children of this element.
 * 
 */


static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_iterchildren[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_reversed = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"tag","reversed",0};
__pyx_v_tag = __pyx_k65;
__pyx_v_reversed = __pyx_k66;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_tag, &__pyx_v_reversed))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_reversed);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1102
 *         keyword and reversed with the 'reversed' keyword.
 *         """
 *         return ElementChildIterator(self, tag, reversed=reversed)             # <<<<<<<<<<<<<< 
 * 
 *     def getroottree(self):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1102
 *         keyword and reversed with the 'reversed' keyword.
 *         """
 *         return ElementChildIterator(self, tag, reversed=reversed)             # <<<<<<<<<<<<<< 
 * 
 *     def getroottree(self):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_reversed, __pyx_v_reversed) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_ElementChildIterator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1102; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.iterchildren");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_reversed);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1104
 *         return ElementChildIterator(self, tag, reversed=reversed)
 * 
 *     def getroottree(self):             # <<<<<<<<<<<<<< 
 *         """Return an ElementTree for the root node of the document that
 *         contains this element.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getroottree[] = "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.";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1111
 *         returns None (for the root element) and then build an ElementTree for
 *         the last parent that was returned."""
 *         return _elementTreeFactory(self._doc, None)             # <<<<<<<<<<<<<< 
 * 
 *     def getiterator(self, tag=None):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlElement *)__pyx_v_self)->_doc,((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.getroottree");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1113
 *         return _elementTreeFactory(self._doc, None)
 * 
 *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Returns a sequence or iterator of all elements in the subtree in
 *         document order (depth first pre-order), starting with this
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_getiterator[] = "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 lxml,\n        which diverges from the original ElementTree behaviour.  If\n        you want an efficient iterator, use the ``element.iter()``\n        method instead.  You should only use this method in new code\n        if you require backwards compatibility with older versions of\n        lxml or ElementTree.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k67;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1132
 *         lxml or ElementTree.
 *         """
 *         return ElementDepthFirstIterator(self, tag)             # <<<<<<<<<<<<<< 
 * 
 *     def iter(self, tag=None):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1132; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.getiterator");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1134
 *         return ElementDepthFirstIterator(self, tag)
 * 
 *     def iter(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over all elements in the subtree in document order (depth
 *         first pre-order), starting with this element.
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_iter[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k68;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1144
 *         Entity factory functions to look only for the specific element type.
 *         """
 *         return ElementDepthFirstIterator(self, tag)             # <<<<<<<<<<<<<< 
 * 
 *     def itertext(self, tag=None, *, with_tail=True):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Element.iter");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1146
 *         return ElementDepthFirstIterator(self, tag)
 * 
 *     def itertext(self, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         """Iterates over the text content of a subtree.
 * 
 */

static PyObject *__pyx_n_with_tail;


static PyObject *__pyx_pf_4lxml_5etree_8_Element_itertext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_itertext[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_itertext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_with_tail = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"tag","with_tail",0};
__pyx_v_tag = __pyx_k69;
__pyx_v_with_tail = __pyx_k70;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_tag, &__pyx_v_with_tail))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_with_tail);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1155
 *         over tail text.
 *         """
 *         return ElementTextIterator(self, tag, with_tail=with_tail)             # <<<<<<<<<<<<<< 
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1155
 *         over tail text.
 *         """
 *         return ElementTextIterator(self, tag, with_tail=with_tail)             # <<<<<<<<<<<<<< 
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_with_tail, __pyx_v_with_tail) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_ElementTextIterator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1155; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.itertext");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_with_tail);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1157
 *         return ElementTextIterator(self, tag, with_tail=with_tail)
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with the same document.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_makeelement[] = "Creates a new element associated with the same document.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__tag = 0;
PyObject *__pyx_v_attrib = 0;
PyObject *__pyx_v_nsmap = 0;
PyObject *__pyx_v__extra = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"_tag","attrib","nsmap",0};
__pyx_v_attrib = __pyx_k71;
__pyx_v_nsmap = __pyx_k72;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__tag, &__pyx_v_attrib, &__pyx_v_nsmap))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__extra);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1161
 *         """
 *         return _makeElement(_tag, NULL, self._doc, None, None, None,
 *                             attrib, nsmap, _extra)             # <<<<<<<<<<<<<< 
 * 
 *     def find(self, path):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1160; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Element.makeelement");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__extra);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1163
 *                             attrib, nsmap, _extra)
 * 
 *     def find(self, path):             # <<<<<<<<<<<<<< 
 *         """Finds the first matching subelement, by tag name or path.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_find[] = "Finds the first matching subelement, by tag name or path.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1166
 *         """Finds the first matching subelement, by tag name or path.
 *         """
 *         if isinstance(path, QName):             # <<<<<<<<<<<<<< 
 *             path = (<QName>path).text
 *         return _elementpath.find(self, path)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_path,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1166; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1167
 *         """
 *         if isinstance(path, QName):
 *             path = (<QName>path).text             # <<<<<<<<<<<<<< 
 *         return _elementpath.find(self, path)
 * 
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1168
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.find(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def findtext(self, path, default=None):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_find); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1168
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.find(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def findtext(self, path, default=None):
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1168; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Element.find");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1170
 *         return _elementpath.find(self, path)
 * 
 *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<< 
 *         """Finds text for the first matching subelement, by tag name or path.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_findtext[] = "Finds text for the first matching subelement, by tag name or path.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"path","default",0};
__pyx_v_default = __pyx_k73;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_path, &__pyx_v_default))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_default);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1173
 *         """Finds text for the first matching subelement, by tag name or path.
 *         """
 *         if isinstance(path, QName):             # <<<<<<<<<<<<<< 
 *             path = (<QName>path).text
 *         return _elementpath.findtext(self, path, default)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_path,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1173; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1174
 *         """
 *         if isinstance(path, QName):
 *             path = (<QName>path).text             # <<<<<<<<<<<<<< 
 *         return _elementpath.findtext(self, path, default)
 * 
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1175
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.findtext(self, path, default)             # <<<<<<<<<<<<<< 
 * 
 *     def findall(self, path):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_findtext); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1175
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.findtext(self, path, default)             # <<<<<<<<<<<<<< 
 * 
 *     def findall(self, path):
 */
__pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_path);
Py_INCREF(__pyx_v_default);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_default);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Element.findtext");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1177
 *         return _elementpath.findtext(self, path, default)
 * 
 *     def findall(self, path):             # <<<<<<<<<<<<<< 
 *         """Finds all matching subelements, by tag name or path.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_findall[] = "Finds all matching subelements, by tag name or path.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1180
 *         """Finds all matching subelements, by tag name or path.
 *         """
 *         if isinstance(path, QName):             # <<<<<<<<<<<<<< 
 *             path = (<QName>path).text
 *         return _elementpath.findall(self, path)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_path,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1181
 *         """
 *         if isinstance(path, QName):
 *             path = (<QName>path).text             # <<<<<<<<<<<<<< 
 *         return _elementpath.findall(self, path)
 * 
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1182
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.findall(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def iterfind(self, path):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_findall); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1182
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.findall(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def iterfind(self, path):
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1182; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Element.findall");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1184
 *         return _elementpath.findall(self, path)
 * 
 *     def iterfind(self, path):             # <<<<<<<<<<<<<< 
 *         """Iterates over all matching subelements, by tag name or path.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_iterfind[] = "Iterates over all matching subelements, by tag name or path.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1187
 *         """Iterates over all matching subelements, by tag name or path.
 *         """
 *         if isinstance(path, QName):             # <<<<<<<<<<<<<< 
 *             path = (<QName>path).text
 *         return _elementpath.iterfind(self, path)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_path,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1187; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1188
 *         """
 *         if isinstance(path, QName):
 *             path = (<QName>path).text             # <<<<<<<<<<<<<< 
 *         return _elementpath.iterfind(self, path)
 * 
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1189
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.iterfind(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree__elementpath, __pyx_n_iterfind); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1189
 *         if isinstance(path, QName):
 *             path = (<QName>path).text
 *         return _elementpath.iterfind(self, path)             # <<<<<<<<<<<<<< 
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1189; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._Element.iterfind");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1191
 *         return _elementpath.iterfind(self, path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an xpath expression using the element as context node.
 *         """
 */

static PyObject *__pyx_n_namespaces;
static PyObject *__pyx_n_extensions;


static PyObject *__pyx_pf_4lxml_5etree_8_Element_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8_Element_xpath[] = "Evaluate an xpath expression using the element as context node.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8_Element_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v__variables = 0;
PyObject *__pyx_v_evaluator;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"_path","namespaces","extensions",0};
__pyx_v_namespaces = __pyx_k74;
__pyx_v_extensions = __pyx_k75;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__path, &__pyx_v_namespaces, &__pyx_v_extensions))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__path);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
__pyx_v_evaluator = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1194
 *         """Evaluate an xpath expression using the element as context node.
 *         """
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                                           extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1194
 *         """Evaluate an xpath expression using the element as context node.
 *         """
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                                           extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1195
 *         """
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
 *                                           extensions=extensions)             # <<<<<<<<<<<<<< 
 *         return evaluator.evaluate(_path, **_variables)
 * 
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1194; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_evaluator);
__pyx_v_evaluator = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1196
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
 *                                           extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_evaluator, __pyx_n_evaluate); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1196
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
 *                                           extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
Py_INCREF(__pyx_v__path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1196
 *         evaluator = XPathElementEvaluator(self, namespaces=namespaces,
 *                                           extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_v__variables); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Element.xpath");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_evaluator);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1209
 *     cdef _Element NEW_ELEMENT "PY_NEW" (object t)
 * 
 * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef _Element result
 *     result = getProxy(c_node)
 */

static  struct LxmlElement *__pyx_f_4lxml_5etree__elementFactory(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
struct LxmlElement *__pyx_v_result;
PyObject *__pyx_v_element_class;
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_doc);
__pyx_v_result = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_element_class = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1211
 * cdef _Element _elementFactory(_Document doc, xmlNode* c_node):
 *     cdef _Element result
 *     result = getProxy(c_node)             # <<<<<<<<<<<<<< 
 *     if result is not None:
 *         return result
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1211; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1212
 *     cdef _Element result
 *     result = getProxy(c_node)
 *     if result is not None:             # <<<<<<<<<<<<<< 
 *         return result
 *     if c_node is NULL:
 */
__pyx_2 = (((PyObject *)__pyx_v_result) != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1213
 *     result = getProxy(c_node)
 *     if result is not None:
 *         return result             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return None
 */
  Py_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1214
 *     if result is not None:
 *         return result
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */
__pyx_2 = (__pyx_v_c_node == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1215
 *         return result
 *     if c_node is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     if config.ENABLE_THREADING:
 */
  Py_INCREF(Py_None);
  __pyx_r = ((struct LxmlElement *)Py_None);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1217
 *         return None
 * 
 *     if config.ENABLE_THREADING:             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             python.PyThread_acquire_lock(
 */
__pyx_2 = ENABLE_THREADING;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1218
 * 
 *     if config.ENABLE_THREADING:
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             python.PyThread_acquire_lock(
 *                 ELEMENT_CREATION_LOCK, python.WAIT_LOCK)
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1220
 *         with nogil:
 *             python.PyThread_acquire_lock(
 *                 ELEMENT_CREATION_LOCK, python.WAIT_LOCK)             # <<<<<<<<<<<<<< 
 *         result = getProxy(c_node)
 *         if result is not None:
 */
      PyThread_acquire_lock(__pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK,WAIT_LOCK);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1221
 *             python.PyThread_acquire_lock(
 *                 ELEMENT_CREATION_LOCK, python.WAIT_LOCK)
 *         result = getProxy(c_node)             # <<<<<<<<<<<<<< 
 *         if result is not None:
 *             python.PyThread_release_lock(ELEMENT_CREATION_LOCK)
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1221; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result));
  __pyx_v_result = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1222
 *                 ELEMENT_CREATION_LOCK, python.WAIT_LOCK)
 *         result = getProxy(c_node)
 *         if result is not None:             # <<<<<<<<<<<<<< 
 *             python.PyThread_release_lock(ELEMENT_CREATION_LOCK)
 *             return result
 */
  __pyx_2 = (((PyObject *)__pyx_v_result) != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1223
 *         result = getProxy(c_node)
 *         if result is not None:
 *             python.PyThread_release_lock(ELEMENT_CREATION_LOCK)             # <<<<<<<<<<<<<< 
 *             return result
 * 
 */
    PyThread_release_lock(__pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1224
 *         if result is not None:
 *             python.PyThread_release_lock(ELEMENT_CREATION_LOCK)
 *             return result             # <<<<<<<<<<<<<< 
 * 
 *     element_class = LOOKUP_ELEMENT_CLASS(
 */
    Py_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1227
 * 
 *     element_class = LOOKUP_ELEMENT_CLASS(
 *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)             # <<<<<<<<<<<<<< 
 *     if element_class is _Element:
 *         # fast path for standard _Element class
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
Py_DECREF(__pyx_v_element_class);
__pyx_v_element_class = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1228
 *     element_class = LOOKUP_ELEMENT_CLASS(
 *         ELEMENT_CLASS_LOOKUP_STATE, doc, c_node)
 *     if element_class is _Element:             # <<<<<<<<<<<<<< 
 *         # fast path for standard _Element class
 *         result = NEW_ELEMENT(_Element)
 */
__pyx_2 = (__pyx_v_element_class == ((PyObject*)__pyx_ptype_4lxml_5etree__Element));
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1230
 *     if element_class is _Element:
 *         # fast path for standard _Element class
 *         result = NEW_ELEMENT(_Element)             # <<<<<<<<<<<<<< 
 *     else:
 *         result = element_class()
 */
  __pyx_1 = ((PyObject *)PY_NEW(((PyObject*)__pyx_ptype_4lxml_5etree__Element))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1230; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result));
  __pyx_v_result = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L9;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1232
 *         result = NEW_ELEMENT(_Element)
 *     else:
 *         result = element_class()             # <<<<<<<<<<<<<< 
 *     if hasProxy(c_node):
 *         # prevent re-entry race condition - we just called into Python
 */
  __pyx_1 = PyObject_CallObject(__pyx_v_element_class, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result));
  __pyx_v_result = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1233
 *     else:
 *         result = element_class()
 *     if hasProxy(c_node):             # <<<<<<<<<<<<<< 
 *         # prevent re-entry race condition - we just called into Python
 *         result._c_node = NULL
 */
__pyx_3 = __pyx_f_4lxml_5etree_hasProxy(__pyx_v_c_node);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1235
 *     if hasProxy(c_node):
 *         # prevent re-entry race condition - we just called into Python
 *         result._c_node = NULL             # <<<<<<<<<<<<<< 
 *         return getProxy(c_node)
 *     result._doc = doc
 */
  __pyx_v_result->_c_node = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1236
 *         # prevent re-entry race condition - we just called into Python
 *         result._c_node = NULL
 *         return getProxy(c_node)             # <<<<<<<<<<<<<< 
 *     result._doc = doc
 *     result._c_node = c_node
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree_getProxy(__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1236; goto __pyx_L1;}
  __pyx_r = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1237
 *         result._c_node = NULL
 *         return getProxy(c_node)
 *     result._doc = doc             # <<<<<<<<<<<<<< 
 *     result._c_node = c_node
 *     _registerProxy(result)
 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)__pyx_v_result->_doc));
__pyx_v_result->_doc = __pyx_v_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1238
 *         return getProxy(c_node)
 *     result._doc = doc
 *     result._c_node = c_node             # <<<<<<<<<<<<<< 
 *     _registerProxy(result)
 * 
 */
__pyx_v_result->_c_node = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1239
 *     result._doc = doc
 *     result._c_node = c_node
 *     _registerProxy(result)             # <<<<<<<<<<<<<< 
 * 
 *     if config.ENABLE_THREADING:
 */
__pyx_3 = __pyx_f_4lxml_5etree__registerProxy(__pyx_v_result); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1239; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1241
 *     _registerProxy(result)
 * 
 *     if config.ENABLE_THREADING:             # <<<<<<<<<<<<<< 
 *         python.PyThread_release_lock(ELEMENT_CREATION_LOCK)
 * 
 */
__pyx_2 = ENABLE_THREADING;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1242
 * 
 *     if config.ENABLE_THREADING:
 *         python.PyThread_release_lock(ELEMENT_CREATION_LOCK)             # <<<<<<<<<<<<<< 
 * 
 *     if element_class is not _Element:
 */
  PyThread_release_lock(__pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK);
  goto __pyx_L11;
}
__pyx_L11:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1244
 *         python.PyThread_release_lock(ELEMENT_CREATION_LOCK)
 * 
 *     if element_class is not _Element:             # <<<<<<<<<<<<<< 
 *         result._init()
 *     return result
 */
__pyx_2 = (__pyx_v_element_class != ((PyObject*)__pyx_ptype_4lxml_5etree__Element));
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1245
 * 
 *     if element_class is not _Element:
 *         result._init()             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n__init); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1245; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L12;
}
__pyx_L12:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1246
 *     if element_class is not _Element:
 *         result._init()
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._elementFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element_class);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1250
 * 
 * cdef class __ContentOnlyElement(_Element):
 *     cdef int _raiseImmutable(self) except -1:             # <<<<<<<<<<<<<< 
 *         raise TypeError("this element does not have children or attributes")
 * 
 */

static PyObject *__pyx_k362p;

static char __pyx_k362[] = "this element does not have children or attributes";

static  int __pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable(struct __pyx_obj_4lxml_5etree___ContentOnlyElement *__pyx_v_self) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1251
 * cdef class __ContentOnlyElement(_Element):
 *     cdef int _raiseImmutable(self) except -1:
 *         raise TypeError("this element does not have children or attributes")             # <<<<<<<<<<<<<< 
 * 
 *     def set(self, key, value):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;}
Py_INCREF(__pyx_k362p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k362p);
__pyx_2 = PyObject_CallObject(__pyx_builtin_TypeError, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__Pyx_Raise(__pyx_2, 0, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 1251; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement._raiseImmutable");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1253
 *         raise TypeError("this element does not have children or attributes")
 * 
 *     def set(self, key, value):             # <<<<<<<<<<<<<< 
 *         self._raiseImmutable()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"key","value",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1254
 * 
 *     def set(self, key, value):
 *         self._raiseImmutable()             # <<<<<<<<<<<<<< 
 * 
 *     def append(self, value):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.set");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1256
 *         self._raiseImmutable()
 * 
 *     def append(self, value):             # <<<<<<<<<<<<<< 
 *         self._raiseImmutable()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1257
 * 
 *     def append(self, value):
 *         self._raiseImmutable()             # <<<<<<<<<<<<<< 
 * 
 *     def insert(self, index, value):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1257; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.append");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1259
 *         self._raiseImmutable()
 * 
 *     def insert(self, index, value):             # <<<<<<<<<<<<<< 
 *         self._raiseImmutable()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_index = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"index","value",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_index, &__pyx_v_value))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_index);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1260
 * 
 *     def insert(self, index, value):
 *         self._raiseImmutable()             # <<<<<<<<<<<<<< 
 * 
 *     def __setitem__(self, index, value):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1260; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.insert");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_index);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1262
 *         self._raiseImmutable()
 * 
 *     def __setitem__(self, index, value):             # <<<<<<<<<<<<<< 
 *         self._raiseImmutable()
 * 
 */

static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
int __pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_index);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1263
 * 
 *     def __setitem__(self, index, value):
 *         self._raiseImmutable()             # <<<<<<<<<<<<<< 
 * 
 *     def __setslice__(self, start, end, value):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1263; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.__setitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_index);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1265
 *         self._raiseImmutable()
 * 
 *     def __setslice__(self, start, end, value):             # <<<<<<<<<<<<<< 
 *         self._raiseImmutable()
 * 
 */

static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_arg_start, Py_ssize_t __pyx_arg_end, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_arg_start, Py_ssize_t __pyx_arg_end, PyObject *__pyx_v_value) {
PyObject *__pyx_v_start = 0;
PyObject *__pyx_v_end = 0;
int __pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_start = PyInt_FromSsize_t(__pyx_arg_start); if (unlikely(!__pyx_v_start)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; goto __pyx_L1;}
__pyx_v_end = PyInt_FromSsize_t(__pyx_arg_end); if (unlikely(!__pyx_v_end)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1266
 * 
 *     def __setslice__(self, start, end, value):
 *         self._raiseImmutable()             # <<<<<<<<<<<<<< 
 * 
 *     property attrib:
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.__setslice__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_start);
Py_DECREF(__pyx_v_end);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1269
 * 
 *     property attrib:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return {}
 *         
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1270
 *     property attrib:
 *         def __get__(self):
 *             return {}             # <<<<<<<<<<<<<< 
 *         
 *     property text:
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.attrib.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1273
 *         
 *     property text:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._c_node.content is NULL:
 *                 return ''
 */

static PyObject *__pyx_k363p;

static char __pyx_k363[] = "";

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1274
 *     property text:
 *         def __get__(self):
 *             if self._c_node.content is NULL:             # <<<<<<<<<<<<<< 
 *                 return ''
 *             else:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1275
 *         def __get__(self):
 *             if self._c_node.content is NULL:
 *                 return ''             # <<<<<<<<<<<<<< 
 *             else:
 *                 return funicode(self._c_node.content)
 */
  Py_INCREF(__pyx_k363p);
  __pyx_r = __pyx_k363p;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1277
 *                 return ''
 *             else:
 *                 return funicode(self._c_node.content)             # <<<<<<<<<<<<<< 
 * 
 *         def __set__(self, value):
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1277; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.text.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1279
 *                 return funicode(self._c_node.content)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             cdef tree.xmlDict* c_dict
 *             cdef char* c_text
 */

static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
char *__pyx_v_c_text;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1282
 *             cdef tree.xmlDict* c_dict
 *             cdef char* c_text
 *             if value is None:             # <<<<<<<<<<<<<< 
 *                 c_text = NULL
 *             else:
 */
__pyx_1 = (__pyx_v_value == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1283
 *             cdef char* c_text
 *             if value is None:
 *                 c_text = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 value = _utf8(value)
 */
  __pyx_v_c_text = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1285
 *                 c_text = NULL
 *             else:
 *                 value = _utf8(value)             # <<<<<<<<<<<<<< 
 *                 c_text = _cstr(value)
 *             tree.xmlNodeSetContent(self._c_node, c_text)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1285; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1286
 *             else:
 *                 value = _utf8(value)
 *                 c_text = _cstr(value)             # <<<<<<<<<<<<<< 
 *             tree.xmlNodeSetContent(self._c_node, c_text)
 * 
 */
  __pyx_v_c_text = _cstr(__pyx_v_value);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1287
 *                 value = _utf8(value)
 *                 c_text = _cstr(value)
 *             tree.xmlNodeSetContent(self._c_node, c_text)             # <<<<<<<<<<<<<< 
 * 
 *     # ACCESSORS
 */
xmlNodeSetContent(((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node,__pyx_v_c_text);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.text.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1290
 * 
 *     # ACCESSORS
 *     def __getitem__(self, x):             # <<<<<<<<<<<<<< 
 *         if python.PySlice_Check(x):
 *             return []
 */

static PyObject *__pyx_k364p;

static char __pyx_k364[] = "list index out of range";

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_x);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1291
 *     # ACCESSORS
 *     def __getitem__(self, x):
 *         if python.PySlice_Check(x):             # <<<<<<<<<<<<<< 
 *             return []
 *         else:
 */
__pyx_1 = PySlice_Check(__pyx_v_x);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1292
 *     def __getitem__(self, x):
 *         if python.PySlice_Check(x):
 *             return []             # <<<<<<<<<<<<<< 
 *         else:
 *             raise IndexError("list index out of range")
 */
  __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1292; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1294
 *             return []
 *         else:
 *             raise IndexError("list index out of range")             # <<<<<<<<<<<<<< 
 * 
 *     def __len__(self):
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_INCREF(__pyx_k364p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k364p);
  __pyx_3 = PyObject_CallObject(__pyx_builtin_IndexError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1294; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_x);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1296
 *             raise IndexError("list index out of range")
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */

static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1297
 * 
 *     def __len__(self):
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     def get(self, key, default=None):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1299
 *         return 0
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"key","default",0};
__pyx_v_default = __pyx_k76;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1300
 * 
 *     def get(self, key, default=None):
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     def keys(self):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1302
 *         return None
 * 
 *     def keys(self):             # <<<<<<<<<<<<<< 
 *         return []
 *     
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1303
 * 
 *     def keys(self):
 *         return []             # <<<<<<<<<<<<<< 
 *     
 *     def items(self):
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.keys");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1305
 *         return []
 *     
 *     def items(self):             # <<<<<<<<<<<<<< 
 *         return []
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1306
 *     
 *     def items(self):
 *         return []             # <<<<<<<<<<<<<< 
 * 
 *     def values(self):
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.items");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1308
 *         return []
 * 
 *     def values(self):             # <<<<<<<<<<<<<< 
 *         return []
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1309
 * 
 *     def values(self):
 *         return []             # <<<<<<<<<<<<<< 
 * 
 * cdef class _Comment(__ContentOnlyElement):
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.__ContentOnlyElement.values");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1313
 * cdef class _Comment(__ContentOnlyElement):
 *     property tag:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return Comment
 * 
 */

static PyObject *__pyx_n_Comment;

static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Comment_3tag___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1314
 *     property tag:
 *         def __get__(self):
 *             return Comment             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_Comment); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Comment.tag.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1316
 *             return Comment
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "<!--%s-->" % self.text
 *     
 */

static PyObject *__pyx_n_text;

static PyObject *__pyx_k365p;

static char __pyx_k365[] = "<!--%s-->";

static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8_Comment___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1317
 * 
 *     def __repr__(self):
 *         return "<!--%s-->" % self.text             # <<<<<<<<<<<<<< 
 *     
 * cdef class _ProcessingInstruction(__ContentOnlyElement):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k365p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Comment.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1321
 * cdef class _ProcessingInstruction(__ContentOnlyElement):
 *     property tag:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return ProcessingInstruction
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1322
 *     property tag:
 *         def __get__(self):
 *             return ProcessingInstruction             # <<<<<<<<<<<<<< 
 * 
 *     property target:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ProcessingInstruction); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1322; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ProcessingInstruction.tag.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1326
 *     property target:
 *         # not in ElementTree
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return funicode(self._c_node.name)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1327
 *         # not in ElementTree
 *         def __get__(self):
 *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<< 
 * 
 *         def __set__(self, value):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ProcessingInstruction.target.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1329
 *             return funicode(self._c_node.name)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             value = _utf8(value)
 *             c_text = _cstr(value)
 */

static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_v_c_text;
int __pyx_r;
PyObject *__pyx_1 = 0;
char *__pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_c_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1330
 * 
 *         def __set__(self, value):
 *             value = _utf8(value)             # <<<<<<<<<<<<<< 
 *             c_text = _cstr(value)
 *             tree.xmlNodeSetName(self._c_node, c_text)
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1330; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1331
 *         def __set__(self, value):
 *             value = _utf8(value)
 *             c_text = _cstr(value)             # <<<<<<<<<<<<<< 
 *             tree.xmlNodeSetName(self._c_node, c_text)
 * 
 */
__pyx_1 = PyString_FromString(_cstr(__pyx_v_value)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; goto __pyx_L1;}
Py_DECREF(__pyx_v_c_text);
__pyx_v_c_text = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1332
 *             value = _utf8(value)
 *             c_text = _cstr(value)
 *             tree.xmlNodeSetName(self._c_node, c_text)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_2 = PyString_AsString(__pyx_v_c_text); if (unlikely((!__pyx_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; goto __pyx_L1;}
xmlNodeSetName(((struct __pyx_obj_4lxml_5etree__ProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base._c_node,__pyx_2);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ProcessingInstruction.target.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_c_text);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1334
 *             tree.xmlNodeSetName(self._c_node, c_text)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         text = self.text
 *         if text:
 */

static PyObject *__pyx_n_target;

static PyObject *__pyx_k366p;
static PyObject *__pyx_k367p;

static char __pyx_k366[] = "<?%s %s?>";
static char __pyx_k367[] = "<?%s?>";

static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_text;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1335
 * 
 *     def __repr__(self):
 *         text = self.text             # <<<<<<<<<<<<<< 
 *         if text:
 *             return "<?%s %s?>" % (self.target, text)
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1336
 *     def __repr__(self):
 *         text = self.text
 *         if text:             # <<<<<<<<<<<<<< 
 *             return "<?%s %s?>" % (self.target, text)
 *         else:
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_text); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1337
 *         text = self.text
 *         if text:
 *             return "<?%s %s?>" % (self.target, text)             # <<<<<<<<<<<<<< 
 *         else:
 *             return "<?%s?>" % self.target
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_target); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1337
 *         text = self.text
 *         if text:
 *             return "<?%s %s?>" % (self.target, text)             # <<<<<<<<<<<<<< 
 *         else:
 *             return "<?%s?>" % self.target
 */
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  Py_INCREF(__pyx_v_text);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_text);
  __pyx_1 = 0;
  __pyx_1 = PyNumber_Remainder(__pyx_k366p, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1339
 *             return "<?%s %s?>" % (self.target, text)
 *         else:
 *             return "<?%s?>" % self.target             # <<<<<<<<<<<<<< 
 * 
 * cdef class _Entity(__ContentOnlyElement):
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_target); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;}
  __pyx_1 = PyNumber_Remainder(__pyx_k367p, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ProcessingInstruction.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1343
 * cdef class _Entity(__ContentOnlyElement):
 *     property tag:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return Entity
 * 
 */

static PyObject *__pyx_n_Entity;

static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Entity_3tag___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1344
 *     property tag:
 *         def __get__(self):
 *             return Entity             # <<<<<<<<<<<<<< 
 * 
 *     property name:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_Entity); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Entity.tag.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1348
 *     property name:
 *         # not in ElementTree
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return funicode(self._c_node.name)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Entity_4name___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1349
 *         # not in ElementTree
 *         def __get__(self):
 *             return funicode(self._c_node.name)             # <<<<<<<<<<<<<< 
 * 
 *         def __set__(self, value):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1349; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Entity.name.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1351
 *             return funicode(self._c_node.name)
 * 
 *         def __set__(self, value):             # <<<<<<<<<<<<<< 
 *             value = _utf8(value)
 *             c_text = _cstr(value)
 */

static int __pyx_pf_4lxml_5etree_7_Entity_4name___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Entity_4name___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_v_c_text;
int __pyx_r;
PyObject *__pyx_1 = 0;
char *__pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_c_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1352
 * 
 *         def __set__(self, value):
 *             value = _utf8(value)             # <<<<<<<<<<<<<< 
 *             c_text = _cstr(value)
 *             tree.xmlNodeSetName(self._c_node, c_text)
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1352; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1353
 *         def __set__(self, value):
 *             value = _utf8(value)
 *             c_text = _cstr(value)             # <<<<<<<<<<<<<< 
 *             tree.xmlNodeSetName(self._c_node, c_text)
 * 
 */
__pyx_1 = PyString_FromString(_cstr(__pyx_v_value)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; goto __pyx_L1;}
Py_DECREF(__pyx_v_c_text);
__pyx_v_c_text = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1354
 *             value = _utf8(value)
 *             c_text = _cstr(value)
 *             tree.xmlNodeSetName(self._c_node, c_text)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_2 = PyString_AsString(__pyx_v_c_text); if (unlikely((!__pyx_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1354; goto __pyx_L1;}
xmlNodeSetName(((struct __pyx_obj_4lxml_5etree__Entity *)__pyx_v_self)->__pyx_base.__pyx_base._c_node,__pyx_2);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Entity.name.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_c_text);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1356
 *             tree.xmlNodeSetName(self._c_node, c_text)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "&%s;" % self.name
 * 
 */

static PyObject *__pyx_n_name;

static PyObject *__pyx_k368p;

static char __pyx_k368[] = "&%s;";

static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Entity___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1357
 * 
 *     def __repr__(self):
 *         return "&%s;" % self.name             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k368p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1357; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Entity.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1369
 *     # to honour tree restructuring.  _doc can happily be None!
 * 
 *     cdef _assertHasRoot(self):             # <<<<<<<<<<<<<< 
 *         """We have to take care here: the document may not have a root node!
 *         This can happen if ElementTree() is called without any argument and
 */

static PyObject *__pyx_k369p;

static char __pyx_k369[] = "ElementTree not initialized, missing root";

static  PyObject *__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot(struct LxmlElementTree *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1375
 *         the caller program.
 *         """
 *         assert self._context_node is not None, \             # <<<<<<<<<<<<<< 
 *                "ElementTree not initialized, missing root"
 * 
 */
__pyx_1 = (((PyObject *)__pyx_v_self->_context_node) != Py_None);
if (unlikely(!__pyx_1)) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1376
 *         """
 *         assert self._context_node is not None, \
 *                "ElementTree not initialized, missing root"             # <<<<<<<<<<<<<< 
 * 
 *     def parse(self, source, _BaseParser parser=None):
 */
  PyErr_SetObject(PyExc_AssertionError, __pyx_k369p);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1375; goto __pyx_L1;}
}
#endif

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ElementTree._assertHasRoot");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1378
 *                "ElementTree not initialized, missing root"
 * 
 *     def parse(self, source, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *         """Updates self with the content of source and returns its root
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_parse[] = "Updates self with the content of source and returns its root\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"source","parser",0};
__pyx_v_parser = __pyx_k77;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1378; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1382
 *         """
 *         cdef _Document doc
 *         doc = _parseDocument(source, parser)             # <<<<<<<<<<<<<< 
 *         self._context_node = doc.getroot()
 *         if self._context_node is None:
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source,__pyx_v_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1382; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1383
 *         cdef _Document doc
 *         doc = _parseDocument(source, parser)
 *         self._context_node = doc.getroot()             # <<<<<<<<<<<<<< 
 *         if self._context_node is None:
 *             self._doc = doc
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1383; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1383
 *         cdef _Document doc
 *         doc = _parseDocument(source, parser)
 *         self._context_node = doc.getroot()             # <<<<<<<<<<<<<< 
 *         if self._context_node is None:
 *             self._doc = doc
 */
Py_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
((struct LxmlElementTree *)__pyx_v_self)->_context_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1384
 *         doc = _parseDocument(source, parser)
 *         self._context_node = doc.getroot()
 *         if self._context_node is None:             # <<<<<<<<<<<<<< 
 *             self._doc = doc
 *         else:
 */
__pyx_2 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1385
 *         self._context_node = doc.getroot()
 *         if self._context_node is None:
 *             self._doc = doc             # <<<<<<<<<<<<<< 
 *         else:
 *             self._doc = None
 */
  Py_INCREF(((PyObject *)__pyx_v_doc));
  Py_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc));
  ((struct LxmlElementTree *)__pyx_v_self)->_doc = __pyx_v_doc;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1387
 *             self._doc = doc
 *         else:
 *             self._doc = None             # <<<<<<<<<<<<<< 
 *         return self._context_node
 * 
 */
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc));
  ((struct LxmlElementTree *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1388
 *         else:
 *             self._doc = None
 *         return self._context_node             # <<<<<<<<<<<<<< 
 * 
 *     def _setroot(self, _Element root not None):
 */
Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
__pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ElementTree.parse");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1390
 *         return self._context_node
 * 
 *     def _setroot(self, _Element root not None):             # <<<<<<<<<<<<<< 
 *         """Relocate the ElementTree to a new root node.
 *         """
 */

static PyObject *__pyx_k370p;

static char __pyx_k370[] = "Only elements can be the root of an ElementTree";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree__setroot(PyObject *__pyx_v_self, PyObject *__pyx_v_root); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree__setroot[] = "Relocate the ElementTree to a new root node.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree__setroot(PyObject *__pyx_v_self, PyObject *__pyx_v_root) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_root);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_root), __pyx_ptype_4lxml_5etree__Element, 0, "root"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1390; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1393
 *         """Relocate the ElementTree to a new root node.
 *         """
 *         if root._c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *             raise TypeError, "Only elements can be the root of an ElementTree"
 *         self._context_node = root
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_root)->_c_node->type != XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1394
 *         """
 *         if root._c_node.type != tree.XML_ELEMENT_NODE:
 *             raise TypeError, "Only elements can be the root of an ElementTree"             # <<<<<<<<<<<<<< 
 *         self._context_node = root
 *         self._doc = None
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k370p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1394; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1395
 *         if root._c_node.type != tree.XML_ELEMENT_NODE:
 *             raise TypeError, "Only elements can be the root of an ElementTree"
 *         self._context_node = root             # <<<<<<<<<<<<<< 
 *         self._doc = None
 * 
 */
Py_INCREF(__pyx_v_root);
Py_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
((struct LxmlElementTree *)__pyx_v_self)->_context_node = ((struct LxmlElement *)__pyx_v_root);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1396
 *             raise TypeError, "Only elements can be the root of an ElementTree"
 *         self._context_node = root
 *         self._doc = None             # <<<<<<<<<<<<<< 
 * 
 *     def getroot(self):
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc));
((struct LxmlElementTree *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ElementTree._setroot");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_root);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1398
 *         self._doc = None
 * 
 *     def getroot(self):             # <<<<<<<<<<<<<< 
 *         """Gets the root element for this tree.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_getroot[] = "Gets the root element for this tree.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1401
 *         """Gets the root element for this tree.
 *         """
 *         return self._context_node             # <<<<<<<<<<<<<< 
 * 
 *     def __copy__(self):
 */
Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
__pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1403
 *         return self._context_node
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<< 
 *         return _elementTreeFactory(self._doc, self._context_node)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1404
 * 
 *     def __copy__(self):
 *         return _elementTreeFactory(self._doc, self._context_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __deepcopy__(self, memo):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlElementTree *)__pyx_v_self)->_doc,((struct LxmlElementTree *)__pyx_v_self)->_context_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1404; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ElementTree.__copy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1406
 *         return _elementTreeFactory(self._doc, self._context_node)
 * 
 *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<< 
 *         cdef _Element root
 *         if self._context_node is not None:
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
struct LxmlElement *__pyx_v_root;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_memo);
__pyx_v_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1408
 *     def __deepcopy__(self, memo):
 *         cdef _Element root
 *         if self._context_node is not None:             # <<<<<<<<<<<<<< 
 *             root = self._context_node.__copy__()
 *         return _elementTreeFactory(None, root)
 */
__pyx_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1409
 *         cdef _Element root
 *         if self._context_node is not None:
 *             root = self._context_node.__copy__()             # <<<<<<<<<<<<<< 
 *         return _elementTreeFactory(None, root)
 * 
 */
  __pyx_2 = PyObject_GetAttr(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node), __pyx_n___copy__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root));
  __pyx_v_root = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1410
 *         if self._context_node is not None:
 *             root = self._context_node.__copy__()
 *         return _elementTreeFactory(None, root)             # <<<<<<<<<<<<<< 
 * 
 *     property docinfo:
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(((struct LxmlDocument *)Py_None),__pyx_v_root)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1410; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.__deepcopy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_memo);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1417
 *         of a parsed document (e.g.  those returned by the parse functions).
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             self._assertHasRoot()
 *             return DocInfo(self._context_node._doc)
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1418
 *         """
 *         def __get__(self):
 *             self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *             return DocInfo(self._context_node._doc)
 * 
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1418; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1419
 *         def __get__(self):
 *             self._assertHasRoot()
 *             return DocInfo(self._context_node._doc)             # <<<<<<<<<<<<<< 
 * 
 *     property parser:
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_DocInfo), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ElementTree.docinfo.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1424
 *         """The parser that was used to parse the document in this ElementTree.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._context_node is not None and \
 *                    self._context_node._doc is not None:
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1425
 *         """
 *         def __get__(self):
 *             if self._context_node is not None and \             # <<<<<<<<<<<<<< 
 *                    self._context_node._doc is not None:
 *                 return self._context_node._doc._parser
 */
__pyx_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1426
 *         def __get__(self):
 *             if self._context_node is not None and \
 *                    self._context_node._doc is not None:             # <<<<<<<<<<<<<< 
 *                 return self._context_node._doc._parser
 *             if self._doc is not None:
 */
  __pyx_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc) != Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1427
 *             if self._context_node is not None and \
 *                    self._context_node._doc is not None:
 *                 return self._context_node._doc._parser             # <<<<<<<<<<<<<< 
 *             if self._doc is not None:
 *                 return self._doc._parser
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser));
  __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1428
 *                    self._context_node._doc is not None:
 *                 return self._context_node._doc._parser
 *             if self._doc is not None:             # <<<<<<<<<<<<<< 
 *                 return self._doc._parser
 *             return None
 */
__pyx_1 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1429
 *                 return self._context_node._doc._parser
 *             if self._doc is not None:
 *                 return self._doc._parser             # <<<<<<<<<<<<<< 
 *             return None
 * 
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc->_parser));
  __pyx_r = ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_doc->_parser);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1430
 *             if self._doc is not None:
 *                 return self._doc._parser
 *             return None             # <<<<<<<<<<<<<< 
 * 
 *     def write(self, file, *, encoding=None, method="xml",
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1432
 *             return None
 * 
 *     def write(self, file, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *               pretty_print=False, xml_declaration=None):
 *         """Write the tree to a file or file-like object.
 */

static PyObject *__pyx_n_ASCII;
static PyObject *__pyx_n_upper;
static PyObject *__pyx_n_UTF8;

static PyObject *__pyx_k373p;
static PyObject *__pyx_k376p;

static char __pyx_k373[] = "US-ASCII";
static char __pyx_k376[] = "UTF-8";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_write[] = "Write the tree to a 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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_file = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_method = 0;
PyObject *__pyx_v_pretty_print = 0;
PyObject *__pyx_v_xml_declaration = 0;
int __pyx_v_write_declaration;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"file","encoding","method","pretty_print","xml_declaration",0};
__pyx_v_encoding = __pyx_k78;
__pyx_v_method = __pyx_k80;
__pyx_v_pretty_print = __pyx_k81;
__pyx_v_xml_declaration = __pyx_k82;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOOO", __pyx_argnames, &__pyx_v_file, &__pyx_v_encoding, &__pyx_v_method, &__pyx_v_pretty_print, &__pyx_v_xml_declaration))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_file);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_method);
Py_INCREF(__pyx_v_pretty_print);
Py_INCREF(__pyx_v_xml_declaration);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1442
 *         """
 *         cdef bint write_declaration
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         # suppress decl. in default case (purely for ElementTree compatibility)
 *         if xml_declaration is not None:
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1442; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1444
 *         self._assertHasRoot()
 *         # suppress decl. in default case (purely for ElementTree compatibility)
 *         if xml_declaration is not None:             # <<<<<<<<<<<<<< 
 *             write_declaration = xml_declaration
 *             if encoding is None:
 */
__pyx_2 = (__pyx_v_xml_declaration != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1445
 *         # suppress decl. in default case (purely for ElementTree compatibility)
 *         if xml_declaration is not None:
 *             write_declaration = xml_declaration             # <<<<<<<<<<<<<< 
 *             if encoding is None:
 *                 encoding = 'ASCII'
 */
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_2 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1445; goto __pyx_L1;}
  __pyx_v_write_declaration = __pyx_2;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1446
 *         if xml_declaration is not None:
 *             write_declaration = xml_declaration
 *             if encoding is None:             # <<<<<<<<<<<<<< 
 *                 encoding = 'ASCII'
 *         elif encoding is None:
 */
  __pyx_2 = (__pyx_v_encoding == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1447
 *             write_declaration = xml_declaration
 *             if encoding is None:
 *                 encoding = 'ASCII'             # <<<<<<<<<<<<<< 
 *         elif encoding is None:
 *             encoding = 'ASCII'
 */
    Py_INCREF(__pyx_n_ASCII);
    Py_DECREF(__pyx_v_encoding);
    __pyx_v_encoding = __pyx_n_ASCII;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1448
 *             if encoding is None:
 *                 encoding = 'ASCII'
 *         elif encoding is None:             # <<<<<<<<<<<<<< 
 *             encoding = 'ASCII'
 *             write_declaration = 0
 */
__pyx_2 = (__pyx_v_encoding == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1449
 *                 encoding = 'ASCII'
 *         elif encoding is None:
 *             encoding = 'ASCII'             # <<<<<<<<<<<<<< 
 *             write_declaration = 0
 *         else:
 */
  Py_INCREF(__pyx_n_ASCII);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_n_ASCII;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1450
 *         elif encoding is None:
 *             encoding = 'ASCII'
 *             write_declaration = 0             # <<<<<<<<<<<<<< 
 *         else:
 *             encoding = encoding.upper()
 */
  __pyx_v_write_declaration = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1452
 *             write_declaration = 0
 *         else:
 *             encoding = encoding.upper()             # <<<<<<<<<<<<<< 
 *             write_declaration = encoding not in \
 *                                   ('US-ASCII', 'ASCII', 'UTF8', 'UTF-8')
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_upper); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1452; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1454
 *             encoding = encoding.upper()
 *             write_declaration = encoding not in \
 *                                   ('US-ASCII', 'ASCII', 'UTF8', 'UTF-8')             # <<<<<<<<<<<<<< 
 *         _tofilelike(file, self._context_node, encoding, method,
 *                     write_declaration, 1, pretty_print)
 */
  __pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1454; goto __pyx_L1;}
  Py_INCREF(__pyx_k373p);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k373p);
  Py_INCREF(__pyx_n_ASCII);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_ASCII);
  Py_INCREF(__pyx_n_UTF8);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_n_UTF8);
  Py_INCREF(__pyx_k376p);
  PyTuple_SET_ITEM(__pyx_1, 3, __pyx_k376p);
  __pyx_2 = (!PySequence_Contains(__pyx_1, __pyx_v_encoding)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1453; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_v_write_declaration = __pyx_2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1456
 *                                   ('US-ASCII', 'ASCII', 'UTF8', 'UTF-8')
 *         _tofilelike(file, self._context_node, encoding, method,
 *                     write_declaration, 1, pretty_print)             # <<<<<<<<<<<<<< 
 * 
 *     def getpath(self, _Element element not None):
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_2 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1456; goto __pyx_L1;}
__pyx_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_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1455; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.write");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_file);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_method);
Py_DECREF(__pyx_v_pretty_print);
Py_DECREF(__pyx_v_xml_declaration);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1458
 *                     write_declaration, 1, pretty_print)
 * 
 *     def getpath(self, _Element element not None):             # <<<<<<<<<<<<<< 
 *         """Returns a structural, absolute XPath expression to find that element.
 *         """
 */

static PyObject *__pyx_k377p;
static PyObject *__pyx_k378p;

static char __pyx_k377[] = "Element is not in this tree.";
static char __pyx_k378[] = "Error creating node path.";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_getpath[] = "Returns a structural, absolute XPath expression to find that element.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
struct LxmlDocument *__pyx_v_doc;
xmlDoc *__pyx_v_c_doc;
char *__pyx_v_c_path;
PyObject *__pyx_v_path;
PyObject *__pyx_r;
int __pyx_1;
xmlDoc *__pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_path = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1458; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1464
 *         cdef xmlDoc* c_doc
 *         cdef char* c_path
 *         doc = self._context_node._doc             # <<<<<<<<<<<<<< 
 *         if element._doc is not doc:
 *             raise ValueError, "Element is not in this tree."
 */
Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1465
 *         cdef char* c_path
 *         doc = self._context_node._doc
 *         if element._doc is not doc:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Element is not in this tree."
 *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_element)->_doc != __pyx_v_doc);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1466
 *         doc = self._context_node._doc
 *         if element._doc is not doc:
 *             raise ValueError, "Element is not in this tree."             # <<<<<<<<<<<<<< 
 *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
 *         c_path = tree.xmlGetNodePath(element._c_node)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k377p, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1466; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1467
 *         if element._doc is not doc:
 *             raise ValueError, "Element is not in this tree."
 *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)             # <<<<<<<<<<<<<< 
 *         c_path = tree.xmlGetNodePath(element._c_node)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 */
__pyx_2 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1468
 *             raise ValueError, "Element is not in this tree."
 *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
 *         c_path = tree.xmlGetNodePath(element._c_node)             # <<<<<<<<<<<<<< 
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         if c_path is NULL:
 */
__pyx_v_c_path = xmlGetNodePath(((struct LxmlElement *)__pyx_v_element)->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1469
 *         c_doc = _fakeRootDoc(doc._c_doc, self._context_node._c_node)
 *         c_path = tree.xmlGetNodePath(element._c_node)
 *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 *         if c_path is NULL:
 *             raise LxmlError, "Error creating node path."
 */
__pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1470
 *         c_path = tree.xmlGetNodePath(element._c_node)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         if c_path is NULL:             # <<<<<<<<<<<<<< 
 *             raise LxmlError, "Error creating node path."
 *         path = c_path
 */
__pyx_1 = (__pyx_v_c_path == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1471
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         if c_path is NULL:
 *             raise LxmlError, "Error creating node path."             # <<<<<<<<<<<<<< 
 *         path = c_path
 *         tree.xmlFree(c_path)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1471
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         if c_path is NULL:
 *             raise LxmlError, "Error creating node path."             # <<<<<<<<<<<<<< 
 *         path = c_path
 *         tree.xmlFree(c_path)
 */
  __Pyx_Raise(__pyx_3, __pyx_k378p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1472
 *         if c_path is NULL:
 *             raise LxmlError, "Error creating node path."
 *         path = c_path             # <<<<<<<<<<<<<< 
 *         tree.xmlFree(c_path)
 *         return path
 */
__pyx_3 = PyString_FromString(__pyx_v_c_path); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1473
 *             raise LxmlError, "Error creating node path."
 *         path = c_path
 *         tree.xmlFree(c_path)             # <<<<<<<<<<<<<< 
 *         return path
 * 
 */
xmlFree(__pyx_v_c_path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1474
 *         path = c_path
 *         tree.xmlFree(c_path)
 *         return path             # <<<<<<<<<<<<<< 
 * 
 *     def getiterator(self, tag=None):
 */
Py_INCREF(__pyx_v_path);
__pyx_r = __pyx_v_path;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.getpath");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1476
 *         return path
 * 
 *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Returns a sequence or iterator of all elements in document order
 *         (depth first pre-order), starting with the root element.
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_getiterator[] = "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 lxml,\n        which diverges from the original ElementTree behaviour.  If\n        you want an efficient iterator, use the ``tree.iter()`` method\n        instead.  You should only use this method in new code if you\n        require backwards compatibility with older versions of lxml or\n        ElementTree.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k83;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1495
 *         ElementTree.
 *         """
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if root is None:
 *             return ()
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1495; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1496
 *         """
 *         root = self.getroot()
 *         if root is None:             # <<<<<<<<<<<<<< 
 *             return ()
 *         return root.getiterator(tag)
 */
__pyx_3 = (__pyx_v_root == Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1497
 *         root = self.getroot()
 *         if root is None:
 *             return ()             # <<<<<<<<<<<<<< 
 *         return root.getiterator(tag)
 * 
 */
  __pyx_1 = PyTuple_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1498
 *         if root is None:
 *             return ()
 *         return root.getiterator(tag)             # <<<<<<<<<<<<<< 
 * 
 *     def iter(self, tag=None):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_getiterator); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1498
 *         if root is None:
 *             return ()
 *         return root.getiterator(tag)             # <<<<<<<<<<<<<< 
 * 
 *     def iter(self, tag=None):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_tag);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.getiterator");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1500
 *         return root.getiterator(tag)
 * 
 *     def iter(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Creates an iterator for the root element.  The iterator loops over
 *         all elements in this tree, in document order.
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_iter[] = "Creates an iterator for the root element.  The iterator loops over\n        all elements in this tree, in document order.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iter(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k84;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1504
 *         all elements in this tree, in document order.
 *         """
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if root is None:
 *             return ()
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1504; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1505
 *         """
 *         root = self.getroot()
 *         if root is None:             # <<<<<<<<<<<<<< 
 *             return ()
 *         return root.iter(tag)
 */
__pyx_3 = (__pyx_v_root == Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1506
 *         root = self.getroot()
 *         if root is None:
 *             return ()             # <<<<<<<<<<<<<< 
 *         return root.iter(tag)
 * 
 */
  __pyx_1 = PyTuple_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1507
 *         if root is None:
 *             return ()
 *         return root.iter(tag)             # <<<<<<<<<<<<<< 
 * 
 *     def find(self, path):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_iter); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1507
 *         if root is None:
 *             return ()
 *         return root.iter(tag)             # <<<<<<<<<<<<<< 
 * 
 *     def find(self, path):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_tag);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1507; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.iter");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1509
 *         return root.iter(tag)
 * 
 *     def find(self, path):             # <<<<<<<<<<<<<< 
 *         """Finds the first toplevel element with given tag.  Same as
 *         ``tree.getroot().find(path)``.
 */

static PyObject *__pyx_k379p;
static PyObject *__pyx_k380p;

static char __pyx_k379[] = "/";
static char __pyx_k380[] = ".";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_find[] = "Finds the first toplevel element with given tag.  Same as\n        ``tree.getroot().find(path)``.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1513
 *         ``tree.getroot().find(path)``.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         root = self.getroot()
 *         if path[:1] == "/":
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1513; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1514
 *         """
 *         self._assertHasRoot()
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if path[:1] == "/":
 *             path = "." + path
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1514; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1515
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.find(path)
 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1515
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.find(path)
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_k379p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1515; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1516
 *         root = self.getroot()
 *         if path[:1] == "/":
 *             path = "." + path             # <<<<<<<<<<<<<< 
 *         return root.find(path)
 * 
 */
  __pyx_1 = PyNumber_Add(__pyx_k380p, __pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1516; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1517
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.find(path)             # <<<<<<<<<<<<<< 
 * 
 *     def findtext(self, path, default=None):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_find); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1517
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.find(path)             # <<<<<<<<<<<<<< 
 * 
 *     def findtext(self, path, default=None):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1517; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.find");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1519
 *         return root.find(path)
 * 
 *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<< 
 *         """Finds the text for the first element matching the ElementPath
 *         expression.  Same as getroot().findtext(path)
 */

static PyObject *__pyx_k381p;
static PyObject *__pyx_k382p;

static char __pyx_k381[] = "/";
static char __pyx_k382[] = ".";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_findtext[] = "Finds the text for the first element matching the ElementPath\n        expression.  Same as getroot().findtext(path)\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"path","default",0};
__pyx_v_default = __pyx_k85;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_path, &__pyx_v_default))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_default);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1523
 *         expression.  Same as getroot().findtext(path)
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         root = self.getroot()
 *         if path[:1] == "/":
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1523; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1524
 *         """
 *         self._assertHasRoot()
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if path[:1] == "/":
 *             path = "." + path
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1525
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.findtext(path, default)
 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1525
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.findtext(path, default)
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_k381p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1525; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1526
 *         root = self.getroot()
 *         if path[:1] == "/":
 *             path = "." + path             # <<<<<<<<<<<<<< 
 *         return root.findtext(path, default)
 * 
 */
  __pyx_1 = PyNumber_Add(__pyx_k382p, __pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1526; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1527
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.findtext(path, default)             # <<<<<<<<<<<<<< 
 * 
 *     def findall(self, path):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_findtext); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1527
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.findtext(path, default)             # <<<<<<<<<<<<<< 
 * 
 *     def findall(self, path):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_path);
Py_INCREF(__pyx_v_default);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_default);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1527; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.findtext");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1529
 *         return root.findtext(path, default)
 * 
 *     def findall(self, path):             # <<<<<<<<<<<<<< 
 *         """Finds all elements matching the ElementPath expression.  Same as
 *         getroot().findall(path).
 */

static PyObject *__pyx_k383p;
static PyObject *__pyx_k384p;

static char __pyx_k383[] = "/";
static char __pyx_k384[] = ".";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_findall[] = "Finds all elements matching the ElementPath expression.  Same as\n        getroot().findall(path).\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1533
 *         getroot().findall(path).
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         root = self.getroot()
 *         if path[:1] == "/":
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1533; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1534
 *         """
 *         self._assertHasRoot()
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if path[:1] == "/":
 *             path = "." + path
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1534; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1535
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.findall(path)
 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1535
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.findall(path)
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_k383p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1535; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1536
 *         root = self.getroot()
 *         if path[:1] == "/":
 *             path = "." + path             # <<<<<<<<<<<<<< 
 *         return root.findall(path)
 * 
 */
  __pyx_1 = PyNumber_Add(__pyx_k384p, __pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1537
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.findall(path)             # <<<<<<<<<<<<<< 
 * 
 *     def iterfind(self, path):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_findall); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1537
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.findall(path)             # <<<<<<<<<<<<<< 
 * 
 *     def iterfind(self, path):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1537; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.findall");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1539
 *         return root.findall(path)
 * 
 *     def iterfind(self, path):             # <<<<<<<<<<<<<< 
 *         """Iterates over all elements matching the ElementPath expression.
 *         Same as getroot().finditer(path).
 */

static PyObject *__pyx_k385p;
static PyObject *__pyx_k386p;

static char __pyx_k385[] = "/";
static char __pyx_k386[] = ".";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_iterfind[] = "Iterates over all elements matching the ElementPath expression.\n        Same as getroot().finditer(path).\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_iterfind(PyObject *__pyx_v_self, PyObject *__pyx_v_path) {
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1543
 *         Same as getroot().finditer(path).
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         root = self.getroot()
 *         if path[:1] == "/":
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1543; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1544
 *         """
 *         self._assertHasRoot()
 *         root = self.getroot()             # <<<<<<<<<<<<<< 
 *         if path[:1] == "/":
 *             path = "." + path
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1544; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1545
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.iterfind(path)
 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1545
 *         self._assertHasRoot()
 *         root = self.getroot()
 *         if path[:1] == "/":             # <<<<<<<<<<<<<< 
 *             path = "." + path
 *         return root.iterfind(path)
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_k385p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1545; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1546
 *         root = self.getroot()
 *         if path[:1] == "/":
 *             path = "." + path             # <<<<<<<<<<<<<< 
 *         return root.iterfind(path)
 * 
 */
  __pyx_1 = PyNumber_Add(__pyx_k386p, __pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1546; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1547
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.iterfind(path)             # <<<<<<<<<<<<<< 
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_iterfind); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1547
 *         if path[:1] == "/":
 *             path = "." + path
 *         return root.iterfind(path)             # <<<<<<<<<<<<<< 
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1547; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ElementTree.iterfind");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1549
 *         return root.iterfind(path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """XPath evaluate in context of document.
 * 
 */


static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_xpath[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v__variables = 0;
PyObject *__pyx_v_evaluator;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"_path","namespaces","extensions",0};
__pyx_v_namespaces = __pyx_k86;
__pyx_v_extensions = __pyx_k87;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__path, &__pyx_v_namespaces, &__pyx_v_extensions))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__path);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
__pyx_v_evaluator = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1565
 *         XPathEvaluator directly.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
 *                                            extensions=extensions)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1565; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1566
 *         """
 *         self._assertHasRoot()
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                                            extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1566
 *         """
 *         self._assertHasRoot()
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                                            extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1567
 *         self._assertHasRoot()
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
 *                                            extensions=extensions)             # <<<<<<<<<<<<<< 
 *         return evaluator.evaluate(_path, **_variables)
 * 
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1566; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_evaluator);
__pyx_v_evaluator = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1568
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
 *                                            extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_evaluator, __pyx_n_evaluate); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1568
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
 *                                            extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}
Py_INCREF(__pyx_v__path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__path);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1568
 *         evaluator = XPathDocumentEvaluator(self, namespaces=namespaces,
 *                                            extensions=extensions)
 *         return evaluator.evaluate(_path, **_variables)             # <<<<<<<<<<<<<< 
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):
 */
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_v__variables); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.xpath");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_evaluator);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1570
 *         return evaluator.evaluate(_path, **_variables)
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<< 
 *         """Transform this document using other document.
 * 
 */

static PyObject *__pyx_n_access_control;


static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xslt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_xslt[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xslt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__xslt = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_access_control = 0;
PyObject *__pyx_v__kw = 0;
PyObject *__pyx_v_style;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"_xslt","extensions","access_control",0};
__pyx_v_extensions = __pyx_k88;
__pyx_v_access_control = __pyx_k89;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__kw, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__xslt, &__pyx_v_extensions, &__pyx_v_access_control))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__kw);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__xslt);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_access_control);
__pyx_v_style = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1582
 *         class directly.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         style = XSLT(_xslt, extensions=extensions,
 *                      access_control=access_control)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1582; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1583
 *         """
 *         self._assertHasRoot()
 *         style = XSLT(_xslt, extensions=extensions,             # <<<<<<<<<<<<<< 
 *                      access_control=access_control)
 *         return style(self, **_kw)
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}
Py_INCREF(__pyx_v__xslt);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__xslt);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1583
 *         """
 *         self._assertHasRoot()
 *         style = XSLT(_xslt, extensions=extensions,             # <<<<<<<<<<<<<< 
 *                      access_control=access_control)
 *         return style(self, **_kw)
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1584
 *         self._assertHasRoot()
 *         style = XSLT(_xslt, extensions=extensions,
 *                      access_control=access_control)             # <<<<<<<<<<<<<< 
 *         return style(self, **_kw)
 * 
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_access_control, __pyx_v_access_control) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XSLT), __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1583; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_style);
__pyx_v_style = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1585
 *         style = XSLT(_xslt, extensions=extensions,
 *                      access_control=access_control)
 *         return style(self, **_kw)             # <<<<<<<<<<<<<< 
 * 
 *     def relaxng(self, relaxng):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1585
 *         style = XSLT(_xslt, extensions=extensions,
 *                      access_control=access_control)
 *         return style(self, **_kw)             # <<<<<<<<<<<<<< 
 * 
 *     def relaxng(self, relaxng):
 */
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_v_style, __pyx_1, __pyx_v__kw); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1585; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.xslt");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__kw);
Py_DECREF(__pyx_v_style);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__xslt);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_access_control);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1587
 *         return style(self, **_kw)
 * 
 *     def relaxng(self, relaxng):             # <<<<<<<<<<<<<< 
 *         """Validate this document using other document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_v_relaxng); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_relaxng[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_v_relaxng) {
PyObject *__pyx_v_schema;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_relaxng);
__pyx_v_schema = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1599
 *         class directly.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         schema = RelaxNG(relaxng)
 *         return schema.validate(self)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1599; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1600
 *         """
 *         self._assertHasRoot()
 *         schema = RelaxNG(relaxng)             # <<<<<<<<<<<<<< 
 *         return schema.validate(self)
 * 
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; goto __pyx_L1;}
Py_INCREF(__pyx_v_relaxng);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_relaxng);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_RelaxNG), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_schema);
__pyx_v_schema = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1601
 *         self._assertHasRoot()
 *         schema = RelaxNG(relaxng)
 *         return schema.validate(self)             # <<<<<<<<<<<<<< 
 * 
 *     def xmlschema(self, xmlschema):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_schema, __pyx_n_validate); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1601
 *         self._assertHasRoot()
 *         schema = RelaxNG(relaxng)
 *         return schema.validate(self)             # <<<<<<<<<<<<<< 
 * 
 *     def xmlschema(self, xmlschema):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1601; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.relaxng");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_schema);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_relaxng);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1603
 *         return schema.validate(self)
 * 
 *     def xmlschema(self, xmlschema):             # <<<<<<<<<<<<<< 
 *         """Validate this document using other document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_v_xmlschema); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_xmlschema[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_v_xmlschema) {
PyObject *__pyx_v_schema;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_xmlschema);
__pyx_v_schema = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1615
 *         class directly.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         schema = XMLSchema(xmlschema)
 *         return schema.validate(self)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1615; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1616
 *         """
 *         self._assertHasRoot()
 *         schema = XMLSchema(xmlschema)             # <<<<<<<<<<<<<< 
 *         return schema.validate(self)
 * 
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; goto __pyx_L1;}
Py_INCREF(__pyx_v_xmlschema);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_xmlschema);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_XMLSchema), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_schema);
__pyx_v_schema = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1617
 *         self._assertHasRoot()
 *         schema = XMLSchema(xmlschema)
 *         return schema.validate(self)             # <<<<<<<<<<<<<< 
 * 
 *     def xinclude(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_schema, __pyx_n_validate); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1617
 *         self._assertHasRoot()
 *         schema = XMLSchema(xmlschema)
 *         return schema.validate(self)             # <<<<<<<<<<<<<< 
 * 
 *     def xinclude(self):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1617; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTree.xmlschema");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_schema);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_xmlschema);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1619
 *         return schema.validate(self)
 * 
 *     def xinclude(self):             # <<<<<<<<<<<<<< 
 *         """Process the XInclude nodes in this document and include the
 *         referenced XML fragments.
 */

static PyObject *__pyx_k391p;

static char __pyx_k391[] = "XInclude processing failed";

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_xinclude[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *unused) {
int __pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1630
 *         """
 *         cdef int result
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         # We cannot pass the XML_PARSE_NOXINCNODE option as this would free
 *         # the XInclude nodes - there may still be Python references to them!
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1630; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1638
 *         # typed as elements.  The included fragment is added between the two,
 *         # i.e. as a sibling, which does not conflict with traversal.
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             if self._context_node._doc._parser is not None:
 *                 result = xinclude.xmlXIncludeProcessTreeFlags(
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1639
 *         # i.e. as a sibling, which does not conflict with traversal.
 *         with nogil:
 *             if self._context_node._doc._parser is not None:             # <<<<<<<<<<<<<< 
 *                 result = xinclude.xmlXIncludeProcessTreeFlags(
 *                     self._context_node._c_node,
 */
    __pyx_2 = (((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser) != Py_None);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1642
 *                 result = xinclude.xmlXIncludeProcessTreeFlags(
 *                     self._context_node._c_node,
 *                     self._context_node._doc._parser._parse_options)             # <<<<<<<<<<<<<< 
 *             else:
 *                 result = xinclude.xmlXIncludeProcessTree(
 */
      __pyx_v_result = xmlXIncludeProcessTreeFlags(((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node,((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser->_parse_options);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1645
 *             else:
 *                 result = xinclude.xmlXIncludeProcessTree(
 *                     self._context_node._c_node)             # <<<<<<<<<<<<<< 
 *         if result == -1:
 *             raise XIncludeError, "XInclude processing failed"
 */
      __pyx_v_result = xmlXIncludeProcessTree(((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node);
    }
    __pyx_L5:;
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1646
 *                 result = xinclude.xmlXIncludeProcessTree(
 *                     self._context_node._c_node)
 *         if result == -1:             # <<<<<<<<<<<<<< 
 *             raise XIncludeError, "XInclude processing failed"
 * 
 */
__pyx_2 = (__pyx_v_result == -1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1647
 *                     self._context_node._c_node)
 *         if result == -1:
 *             raise XIncludeError, "XInclude processing failed"             # <<<<<<<<<<<<<< 
 * 
 *     def write_c14n(self, file):
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XIncludeError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1647
 *                     self._context_node._c_node)
 *         if result == -1:
 *             raise XIncludeError, "XInclude processing failed"             # <<<<<<<<<<<<<< 
 * 
 *     def write_c14n(self, file):
 */
  __Pyx_Raise(__pyx_1, __pyx_k391p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1647; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ElementTree.xinclude");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1649
 *             raise XIncludeError, "XInclude processing failed"
 * 
 *     def write_c14n(self, file):             # <<<<<<<<<<<<<< 
 *         """C14N write of document. Always writes UTF-8.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_v_file); /*proto*/
static char __pyx_doc_4lxml_5etree_12_ElementTree_write_c14n[] = "C14N write of document. Always writes UTF-8.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_v_file) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_file);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1652
 *         """C14N write of document. Always writes UTF-8.
 *         """
 *         self._assertHasRoot()             # <<<<<<<<<<<<<< 
 *         _tofilelikeC14N(file, self._context_node)
 * 
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1652; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1653
 *         """
 *         self._assertHasRoot()
 *         _tofilelikeC14N(file, self._context_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
 */
__pyx_1 = __pyx_f_4lxml_5etree__tofilelikeC14N(__pyx_v_file,((struct LxmlElementTree *)__pyx_v_self)->_context_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1653; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ElementTree.write_c14n");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1655
 *         _tofilelikeC14N(file, self._context_node)
 * 
 * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):             # <<<<<<<<<<<<<< 
 *     return _newElementTree(doc, context_node, _ElementTree)
 * 
 */

static  struct LxmlElementTree *__pyx_f_4lxml_5etree__elementTreeFactory(struct LxmlDocument *__pyx_v_doc,struct LxmlElement *__pyx_v_context_node) {
struct LxmlElementTree *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_context_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1656
 * 
 * cdef _ElementTree _elementTreeFactory(_Document doc, _Element context_node):
 *     return _newElementTree(doc, context_node, _ElementTree)             # <<<<<<<<<<<<<< 
 * 
 * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc,__pyx_v_context_node,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1656; goto __pyx_L1;}
__pyx_r = ((struct LxmlElementTree *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElementTree *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._elementTreeFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_context_node);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1658
 *     return _newElementTree(doc, context_node, _ElementTree)
 * 
 * cdef _ElementTree _newElementTree(_Document doc, _Element context_node,             # <<<<<<<<<<<<<< 
 *                                   object baseclass):
 *     cdef _ElementTree result
 */

static  struct LxmlElementTree *__pyx_f_4lxml_5etree__newElementTree(struct LxmlDocument *__pyx_v_doc,struct LxmlElement *__pyx_v_context_node,PyObject *__pyx_v_baseclass) {
struct LxmlElementTree *__pyx_v_result;
struct LxmlElementTree *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_context_node);
Py_INCREF(__pyx_v_baseclass);
__pyx_v_result = ((struct LxmlElementTree *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1661
 *                                   object baseclass):
 *     cdef _ElementTree result
 *     result = baseclass()             # <<<<<<<<<<<<<< 
 *     if context_node is None and doc is not None:
 *         context_node = doc.getroot()
 */
__pyx_1 = PyObject_CallObject(__pyx_v_baseclass, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ElementTree)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1661; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlElementTree *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1662
 *     cdef _ElementTree result
 *     result = baseclass()
 *     if context_node is None and doc is not None:             # <<<<<<<<<<<<<< 
 *         context_node = doc.getroot()
 *     if context_node is None:
 */
__pyx_2 = (((PyObject *)__pyx_v_context_node) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1662
 *     cdef _ElementTree result
 *     result = baseclass()
 *     if context_node is None and doc is not None:             # <<<<<<<<<<<<<< 
 *         context_node = doc.getroot()
 *     if context_node is None:
 */
  __pyx_2 = (((PyObject *)__pyx_v_doc) != Py_None);
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1663
 *     result = baseclass()
 *     if context_node is None and doc is not None:
 *         context_node = doc.getroot()             # <<<<<<<<<<<<<< 
 *     if context_node is None:
 *         result._doc = doc
 */
  __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1663; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_context_node));
  __pyx_v_context_node = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1664
 *     if context_node is None and doc is not None:
 *         context_node = doc.getroot()
 *     if context_node is None:             # <<<<<<<<<<<<<< 
 *         result._doc = doc
 *     result._context_node = context_node
 */
__pyx_2 = (((PyObject *)__pyx_v_context_node) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1665
 *         context_node = doc.getroot()
 *     if context_node is None:
 *         result._doc = doc             # <<<<<<<<<<<<<< 
 *     result._context_node = context_node
 *     return result
 */
  Py_INCREF(((PyObject *)__pyx_v_doc));
  Py_DECREF(((PyObject *)__pyx_v_result->_doc));
  __pyx_v_result->_doc = __pyx_v_doc;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1666
 *     if context_node is None:
 *         result._doc = doc
 *     result._context_node = context_node             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_context_node));
Py_DECREF(((PyObject *)__pyx_v_result->_context_node));
__pyx_v_result->_context_node = __pyx_v_context_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1667
 *         result._doc = doc
 *     result._context_node = context_node
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = ((struct LxmlElementTree *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._newElementTree");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_context_node);
Py_DECREF(__pyx_v_baseclass);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1672
 * cdef class _Attrib:
 *     cdef _Element _element
 *     def __init__(self, _Element element not None):             # <<<<<<<<<<<<<< 
 *         self._element = element
 * 
 */

static int __pyx_pf_4lxml_5etree_7_Attrib___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Attrib___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
int __pyx_r;
static char *__pyx_argnames[] = {"element",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1673
 *     cdef _Element _element
 *     def __init__(self, _Element element not None):
 *         self._element = element             # <<<<<<<<<<<<<< 
 * 
 *     # MANIPULATORS
 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element));
((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element = __pyx_v_element;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Attrib.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1676
 * 
 *     # MANIPULATORS
 *     def __setitem__(self, key, value):             # <<<<<<<<<<<<<< 
 *         _setAttributeValue(self._element, key, value)
 * 
 */

static int __pyx_pf_4lxml_5etree_7_Attrib___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Attrib___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1677
 *     # MANIPULATORS
 *     def __setitem__(self, key, value):
 *         _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<< 
 * 
 *     def __delitem__(self, key):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1677; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Attrib.__setitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1679
 *         _setAttributeValue(self._element, key, value)
 * 
 *     def __delitem__(self, key):             # <<<<<<<<<<<<<< 
 *         _delAttribute(self._element, key)
 * 
 */

static int __pyx_pf_4lxml_5etree_7_Attrib___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Attrib___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1680
 * 
 *     def __delitem__(self, key):
 *         _delAttribute(self._element, key)             # <<<<<<<<<<<<<< 
 * 
 *     def update(self, sequence_or_dict):
 */
__pyx_1 = __pyx_f_4lxml_5etree__delAttribute(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1680; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Attrib.__delitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1682
 *         _delAttribute(self._element, key)
 * 
 *     def update(self, sequence_or_dict):             # <<<<<<<<<<<<<< 
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_update(PyObject *__pyx_v_self, PyObject *__pyx_v_sequence_or_dict); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_update(PyObject *__pyx_v_self, PyObject *__pyx_v_sequence_or_dict) {
PyObject *__pyx_v_key;
PyObject *__pyx_v_value;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_sequence_or_dict);
__pyx_v_key = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1683
 * 
 *     def update(self, sequence_or_dict):
 *         if isinstance(sequence_or_dict, dict):             # <<<<<<<<<<<<<< 
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_sequence_or_dict,((PyObject*)&PyDict_Type)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1683; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1684
 *     def update(self, sequence_or_dict):
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()             # <<<<<<<<<<<<<< 
 *         for key, value in sequence_or_dict:
 *             _setAttributeValue(self._element, key, value)
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_sequence_or_dict, __pyx_n_iteritems); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1684; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_sequence_or_dict);
  __pyx_v_sequence_or_dict = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
if (PyList_CheckExact(__pyx_v_sequence_or_dict)) { __pyx_4 = 0; __pyx_2 = __pyx_v_sequence_or_dict; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_v_sequence_or_dict); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_6 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
    Py_DECREF(__pyx_v_key);
    __pyx_v_key = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_6;
    __pyx_6 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_5 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
    Py_DECREF(__pyx_v_key);
    __pyx_v_key = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1685
 *         if isinstance(sequence_or_dict, dict):
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:             # <<<<<<<<<<<<<< 
 *             _setAttributeValue(self._element, key, value)
 * 
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_6;
    __pyx_6 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1686
 *             sequence_or_dict = sequence_or_dict.iteritems()
 *         for key, value in sequence_or_dict:
 *             _setAttributeValue(self._element, key, value)             # <<<<<<<<<<<<<< 
 * 
 *     def pop(self, key, *default):
 */
  __pyx_7 = __pyx_f_4lxml_5etree__setAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,__pyx_v_value); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1686; goto __pyx_L1;}
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._Attrib.update");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_sequence_or_dict);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1688
 *             _setAttributeValue(self._element, key, value)
 * 
 *     def pop(self, key, *default):             # <<<<<<<<<<<<<< 
 *         if python.PyTuple_GET_SIZE(default) > 1:
 *             raise TypeError, "pop expected at most 2 arguments, got %d" % \
 */

static PyObject *__pyx_n_KeyError;

static PyObject *__pyx_k392p;

static PyObject *__pyx_builtin_KeyError;

static char __pyx_k392[] = "pop expected at most 2 arguments, got %d";

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_pop(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"key",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_default, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_default);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1689
 * 
 *     def pop(self, key, *default):
 *         if python.PyTuple_GET_SIZE(default) > 1:             # <<<<<<<<<<<<<< 
 *             raise TypeError, "pop expected at most 2 arguments, got %d" % \
 *                   (python.PyTuple_GET_SIZE(default)+1)
 */
__pyx_1 = (PyTuple_GET_SIZE(__pyx_v_default) > 1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1691
 *         if python.PyTuple_GET_SIZE(default) > 1:
 *             raise TypeError, "pop expected at most 2 arguments, got %d" % \
 *                   (python.PyTuple_GET_SIZE(default)+1)             # <<<<<<<<<<<<<< 
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:
 */
  __pyx_2 = PyInt_FromSsize_t((PyTuple_GET_SIZE(__pyx_v_default) + 1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1691; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k392p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1692
 *             raise TypeError, "pop expected at most 2 arguments, got %d" % \
 *                   (python.PyTuple_GET_SIZE(default)+1)
 *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<< 
 *         if result is None:
 *             if python.PyTuple_GET_SIZE(default) == 0:
 */
__pyx_2 = __pyx_f_4lxml_5etree__getAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,Py_None); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1693
 *                   (python.PyTuple_GET_SIZE(default)+1)
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:             # <<<<<<<<<<<<<< 
 *             if python.PyTuple_GET_SIZE(default) == 0:
 *                 raise KeyError, key
 */
__pyx_1 = (__pyx_v_result == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1694
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:
 *             if python.PyTuple_GET_SIZE(default) == 0:             # <<<<<<<<<<<<<< 
 *                 raise KeyError, key
 *             else:
 */
  __pyx_1 = (PyTuple_GET_SIZE(__pyx_v_default) == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1695
 *         if result is None:
 *             if python.PyTuple_GET_SIZE(default) == 0:
 *                 raise KeyError, key             # <<<<<<<<<<<<<< 
 *             else:
 *                 result = python.PyTuple_GET_ITEM(default, 0)
 */
    __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1697
 *                 raise KeyError, key
 *             else:
 *                 result = python.PyTuple_GET_ITEM(default, 0)             # <<<<<<<<<<<<<< 
 *                 python.Py_INCREF(result)
 *         else:
 */
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_default,0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1697; goto __pyx_L1;}
    Py_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1698
 *             else:
 *                 result = python.PyTuple_GET_ITEM(default, 0)
 *                 python.Py_INCREF(result)             # <<<<<<<<<<<<<< 
 *         else:
 *             _delAttribute(self._element, key)
 */
    Py_INCREF(__pyx_v_result);
  }
  __pyx_L4:;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1700
 *                 python.Py_INCREF(result)
 *         else:
 *             _delAttribute(self._element, key)             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
  __pyx_4 = __pyx_f_4lxml_5etree__delAttribute(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1700; goto __pyx_L1;}
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1701
 *         else:
 *             _delAttribute(self._element, key)
 *         return result             # <<<<<<<<<<<<<< 
 * 
 *     def clear(self):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Attrib.pop");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v_default);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1703
 *         return result
 * 
 *     def clear(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         c_node = self._element._c_node
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_clear(PyObject *__pyx_v_self, PyObject *unused) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1705
 *     def clear(self):
 *         cdef xmlNode* c_node
 *         c_node = self._element._c_node             # <<<<<<<<<<<<<< 
 *         while c_node.properties is not NULL:
 *             tree.xmlRemoveProp(c_node.properties)
 */
__pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1706
 *         cdef xmlNode* c_node
 *         c_node = self._element._c_node
 *         while c_node.properties is not NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlRemoveProp(c_node.properties)
 * 
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1706
 *         cdef xmlNode* c_node
 *         c_node = self._element._c_node
 *         while c_node.properties is not NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlRemoveProp(c_node.properties)
 * 
 */
  __pyx_1 = (__pyx_v_c_node->properties != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1707
 *         c_node = self._element._c_node
 *         while c_node.properties is not NULL:
 *             tree.xmlRemoveProp(c_node.properties)             # <<<<<<<<<<<<<< 
 * 
 *     # ACCESSORS
 */
  xmlRemoveProp(__pyx_v_c_node->properties);
}

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1710
 * 
 *     # ACCESSORS
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))
 *     
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1711
 *     # ACCESSORS
 *     def __repr__(self):
 *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))             # <<<<<<<<<<<<<< 
 *     
 *     def __getitem__(self, key):
 */
__pyx_1 = __pyx_f_4lxml_5etree__attributeIteratorFactory(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyObject_Repr(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1711; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Attrib.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1713
 *         return repr(dict( _attributeIteratorFactory(self._element, 3) ))
 *     
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<< 
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1714
 *     
 *     def __getitem__(self, key):
 *         result = _getAttributeValue(self._element, key, None)             # <<<<<<<<<<<<<< 
 *         if result is None:
 *             raise KeyError, key
 */
__pyx_1 = __pyx_f_4lxml_5etree__getAttributeValue(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1714; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1715
 *     def __getitem__(self, key):
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:             # <<<<<<<<<<<<<< 
 *             raise KeyError, key
 *         else:
 */
__pyx_2 = (__pyx_v_result == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1716
 *         result = _getAttributeValue(self._element, key, None)
 *         if result is None:
 *             raise KeyError, key             # <<<<<<<<<<<<<< 
 *         else:
 *             return result
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1716; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1718
 *             raise KeyError, key
 *         else:
 *             return result             # <<<<<<<<<<<<<< 
 * 
 *     def __nonzero__(self):
 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Attrib.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1720
 *             return result
 * 
 *     def __nonzero__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlAttr* c_attr
 *         c_attr = self._element._c_node.properties
 */

static int __pyx_pf_4lxml_5etree_7_Attrib___nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Attrib___nonzero__(PyObject *__pyx_v_self) {
xmlAttr *__pyx_v_c_attr;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1722
 *     def __nonzero__(self):
 *         cdef xmlAttr* c_attr
 *         c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<< 
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 */
__pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1723
 *         cdef xmlAttr* c_attr
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 return 1
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1723
 *         cdef xmlAttr* c_attr
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 return 1
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1724
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *                 return 1
 *             c_attr = c_attr.next
 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1725
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 return 1             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr.next
 *         return 0
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1726
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 return 1
 *             c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1727
 *                 return 1
 *             c_attr = c_attr.next
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     def __len__(self):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1729
 *         return 0
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlAttr* c_attr
 *         cdef Py_ssize_t c
 */

static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_4lxml_5etree_7_Attrib___len__(PyObject *__pyx_v_self) {
xmlAttr *__pyx_v_c_attr;
Py_ssize_t __pyx_v_c;
Py_ssize_t __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1732
 *         cdef xmlAttr* c_attr
 *         cdef Py_ssize_t c
 *         c = 0             # <<<<<<<<<<<<<< 
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:
 */
__pyx_v_c = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1733
 *         cdef Py_ssize_t c
 *         c = 0
 *         c_attr = self._element._c_node.properties             # <<<<<<<<<<<<<< 
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 */
__pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1734
 *         c = 0
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 c = c + 1
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1734
 *         c = 0
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 c = c + 1
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1735
 *         c_attr = self._element._c_node.properties
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *                 c = c + 1
 *             c_attr = c_attr.next
 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1736
 *         while c_attr is not NULL:
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 c = c + 1             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr.next
 *         return c
 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1737
 *             if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *                 c = c + 1
 *             c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 *         return c
 *     
 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1738
 *                 c = c + 1
 *             c_attr = c_attr.next
 *         return c             # <<<<<<<<<<<<<< 
 *     
 *     def get(self, key, default=None):
 */
__pyx_r = __pyx_v_c;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1740
 *         return c
 *     
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         return _getAttributeValue(self._element, key, default)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"key","default",0};
__pyx_v_default = __pyx_k90;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1741
 *     
 *     def get(self, key, default=None):
 *         return _getAttributeValue(self._element, key, default)             # <<<<<<<<<<<<<< 
 * 
 *     def keys(self):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1741; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Attrib.get");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1743
 *         return _getAttributeValue(self._element, key, default)
 * 
 *     def keys(self):             # <<<<<<<<<<<<<< 
 *         return _collectAttributes(self._element._c_node, 1)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_keys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1744
 * 
 *     def keys(self):
 *         return _collectAttributes(self._element._c_node, 1)             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1744; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Attrib.keys");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1746
 *         return _collectAttributes(self._element._c_node, 1)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return iter(_collectAttributes(self._element._c_node, 1))
 *     
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1747
 * 
 *     def __iter__(self):
 *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<< 
 *     
 *     def iterkeys(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1747; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Attrib.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1749
 *         return iter(_collectAttributes(self._element._c_node, 1))
 *     
 *     def iterkeys(self):             # <<<<<<<<<<<<<< 
 *         return iter(_collectAttributes(self._element._c_node, 1))
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iterkeys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iterkeys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1750
 *     
 *     def iterkeys(self):
 *         return iter(_collectAttributes(self._element._c_node, 1))             # <<<<<<<<<<<<<< 
 * 
 *     def values(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Attrib.iterkeys");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1752
 *         return iter(_collectAttributes(self._element._c_node, 1))
 * 
 *     def values(self):             # <<<<<<<<<<<<<< 
 *         return _collectAttributes(self._element._c_node, 2)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_values(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1753
 * 
 *     def values(self):
 *         return _collectAttributes(self._element._c_node, 2)             # <<<<<<<<<<<<<< 
 * 
 *     def itervalues(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1753; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Attrib.values");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1755
 *         return _collectAttributes(self._element._c_node, 2)
 * 
 *     def itervalues(self):             # <<<<<<<<<<<<<< 
 *         return iter(_collectAttributes(self._element._c_node, 2))
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_itervalues(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_itervalues(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1756
 * 
 *     def itervalues(self):
 *         return iter(_collectAttributes(self._element._c_node, 2))             # <<<<<<<<<<<<<< 
 * 
 *     def items(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1756; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Attrib.itervalues");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1758
 *         return iter(_collectAttributes(self._element._c_node, 2))
 * 
 *     def items(self):             # <<<<<<<<<<<<<< 
 *         return _collectAttributes(self._element._c_node, 3)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_items(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1759
 * 
 *     def items(self):
 *         return _collectAttributes(self._element._c_node, 3)             # <<<<<<<<<<<<<< 
 * 
 *     def iteritems(self):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Attrib.items");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1761
 *         return _collectAttributes(self._element._c_node, 3)
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<< 
 *         return iter(_collectAttributes(self._element._c_node, 3))
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1762
 * 
 *     def iteritems(self):
 *         return iter(_collectAttributes(self._element._c_node, 3))             # <<<<<<<<<<<<<< 
 * 
 *     def has_key(self, key):
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node,3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1762; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Attrib.iteritems");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1764
 *         return iter(_collectAttributes(self._element._c_node, 3))
 * 
 *     def has_key(self, key):             # <<<<<<<<<<<<<< 
 *         if key in self:
 *             return True
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1765
 * 
 *     def has_key(self, key):
 *         if key in self:             # <<<<<<<<<<<<<< 
 *             return True
 *         else:
 */
__pyx_1 = (PySequence_Contains(__pyx_v_self, __pyx_v_key)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1765; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1766
 *     def has_key(self, key):
 *         if key in self:
 *             return True             # <<<<<<<<<<<<<< 
 *         else:
 *             return False
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1768
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<< 
 * 
 *     def __contains__(self, key):
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._Attrib.has_key");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1770
 *             return False
 * 
 *     def __contains__(self, key):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         cdef char* c_result
 */

static int __pyx_pf_4lxml_5etree_7_Attrib___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_pf_4lxml_5etree_7_Attrib___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
xmlNode *__pyx_v_c_node;
char *__pyx_v_c_result;
char *__pyx_v_c_tag;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_tag;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1774
 *         cdef char* c_result
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1774
 *         cdef char* c_result
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1774
 *         cdef char* c_result
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1774
 *         cdef char* c_result
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1774
 *         cdef char* c_result
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1774; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1775
 *         cdef char* c_tag
 *         ns, tag = _getNsTag(key)
 *         c_tag = _cstr(tag)             # <<<<<<<<<<<<<< 
 *         c_node = self._element._c_node
 *         if ns is None:
 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1776
 *         ns, tag = _getNsTag(key)
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             c_result = tree.xmlGetNoNsProp(c_node, c_tag)
 */
__pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__Attrib *)__pyx_v_self)->_element->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1777
 *         c_tag = _cstr(tag)
 *         c_node = self._element._c_node
 *         if ns is None:             # <<<<<<<<<<<<<< 
 *             c_result = tree.xmlGetNoNsProp(c_node, c_tag)
 *         else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1778
 *         c_node = self._element._c_node
 *         if ns is None:
 *             c_result = tree.xmlGetNoNsProp(c_node, c_tag)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_result = tree.xmlGetNsProp(c_node, c_tag, _cstr(ns))
 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_c_node,__pyx_v_c_tag);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1780
 *             c_result = tree.xmlGetNoNsProp(c_node, c_tag)
 *         else:
 *             c_result = tree.xmlGetNsProp(c_node, c_tag, _cstr(ns))             # <<<<<<<<<<<<<< 
 *         if c_result is NULL:
 *             return 0
 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_node,__pyx_v_c_tag,_cstr(__pyx_v_ns));
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1781
 *         else:
 *             c_result = tree.xmlGetNsProp(c_node, c_tag, _cstr(ns))
 *         if c_result is NULL:             # <<<<<<<<<<<<<< 
 *             return 0
 *         else:
 */
__pyx_4 = (__pyx_v_c_result == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1782
 *             c_result = tree.xmlGetNsProp(c_node, c_tag, _cstr(ns))
 *         if c_result is NULL:
 *             return 0             # <<<<<<<<<<<<<< 
 *         else:
 *             tree.xmlFree(c_result)
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1784
 *             return 0
 *         else:
 *             tree.xmlFree(c_result)             # <<<<<<<<<<<<<< 
 *             return 1
 * 
 */
  xmlFree(__pyx_v_c_result);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1785
 *         else:
 *             tree.xmlFree(c_result)
 *             return 1             # <<<<<<<<<<<<<< 
 * 
 *     def __richcmp__(one, other, int op):
 */
  __pyx_r = 1;
  goto __pyx_L0;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Attrib.__contains__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1787
 *             return 1
 * 
 *     def __richcmp__(one, other, int op):             # <<<<<<<<<<<<<< 
 *         if not python.PyDict_Check(one):
 *             one = dict(one)
 */

static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_Attrib___richcmp__(PyObject *__pyx_v_one, PyObject *__pyx_v_other, int __pyx_v_op) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_one);
Py_INCREF(__pyx_v_other);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1788
 * 
 *     def __richcmp__(one, other, int op):
 *         if not python.PyDict_Check(one):             # <<<<<<<<<<<<<< 
 *             one = dict(one)
 *         if not python.PyDict_Check(other):
 */
__pyx_1 = (!PyDict_Check(__pyx_v_one));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1789
 *     def __richcmp__(one, other, int op):
 *         if not python.PyDict_Check(one):
 *             one = dict(one)             # <<<<<<<<<<<<<< 
 *         if not python.PyDict_Check(other):
 *             other = dict(other)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  Py_INCREF(__pyx_v_one);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_one);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_one);
  __pyx_v_one = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1790
 *         if not python.PyDict_Check(one):
 *             one = dict(one)
 *         if not python.PyDict_Check(other):             # <<<<<<<<<<<<<< 
 *             other = dict(other)
 *         return python.PyObject_RichCompare(one, other, op)
 */
__pyx_1 = (!PyDict_Check(__pyx_v_other));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1791
 *             one = dict(one)
 *         if not python.PyDict_Check(other):
 *             other = dict(other)             # <<<<<<<<<<<<<< 
 *         return python.PyObject_RichCompare(one, other, op)
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; goto __pyx_L1;}
  Py_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_other);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1791; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_other);
  __pyx_v_other = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1792
 *         if not python.PyDict_Check(other):
 *             other = dict(other)
 *         return python.PyObject_RichCompare(one, other, op)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _AttribIterator:
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_one,__pyx_v_other,__pyx_v_op); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._Attrib.__richcmp__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_one);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1801
 *     cdef xmlAttr* _c_attr
 *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1802
 *     cdef int _keysvalues # 1 - keys, 2 - values, 3 - items (key, value)
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1804
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlAttr* c_attr
 *         if self._node is None:
 */

static PyObject *__pyx_n_StopIteration;

static PyObject *__pyx_builtin_StopIteration;

static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_AttribIterator___next__(PyObject *__pyx_v_self) {
xmlAttr *__pyx_v_c_attr;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1806
 *     def __next__(self):
 *         cdef xmlAttr* c_attr
 *         if self._node is None:             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 *         c_attr = self._c_attr
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1807
 *         cdef xmlAttr* c_attr
 *         if self._node is None:
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 *         c_attr = self._c_attr
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1808
 *         if self._node is None:
 *             raise StopIteration
 *         c_attr = self._c_attr             # <<<<<<<<<<<<<< 
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
 *             c_attr = c_attr.next
 */
__pyx_v_c_attr = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_c_attr;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1809
 *             raise StopIteration
 *         c_attr = self._c_attr
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr.next
 *         if c_attr is NULL:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1809
 *             raise StopIteration
 *         c_attr = self._c_attr
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr.next
 *         if c_attr is NULL:
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1809
 *             raise StopIteration
 *         c_attr = self._c_attr
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             c_attr = c_attr.next
 *         if c_attr is NULL:
 */
    __pyx_1 = (__pyx_v_c_attr->type != XML_ATTRIBUTE_NODE);
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1810
 *         c_attr = self._c_attr
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
 *             c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 *         if c_attr is NULL:
 *             self._node = None
 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1811
 *         while c_attr is not NULL and c_attr.type != tree.XML_ATTRIBUTE_NODE:
 *             c_attr = c_attr.next
 *         if c_attr is NULL:             # <<<<<<<<<<<<<< 
 *             self._node = None
 *             raise StopIteration
 */
__pyx_1 = (__pyx_v_c_attr == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1812
 *             c_attr = c_attr.next
 *         if c_attr is NULL:
 *             self._node = None             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 * 
 */
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node));
  ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_node = ((struct LxmlElement *)Py_None);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1813
 *         if c_attr is NULL:
 *             self._node = None
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 * 
 *         self._c_attr = c_attr.next
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1815
 *             raise StopIteration
 * 
 *         self._c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 *         if self._keysvalues == 1:
 *             return _namespacedName(<xmlNode*>c_attr)
 */
((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_c_attr = __pyx_v_c_attr->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1816
 * 
 *         self._c_attr = c_attr.next
 *         if self._keysvalues == 1:             # <<<<<<<<<<<<<< 
 *             return _namespacedName(<xmlNode*>c_attr)
 *         elif self._keysvalues == 2:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_keysvalues == 1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1817
 *         self._c_attr = c_attr.next
 *         if self._keysvalues == 1:
 *             return _namespacedName(<xmlNode*>c_attr)             # <<<<<<<<<<<<<< 
 *         elif self._keysvalues == 2:
 *             return _attributeValue(self._node._c_node, c_attr)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1817; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1818
 *         if self._keysvalues == 1:
 *             return _namespacedName(<xmlNode*>c_attr)
 *         elif self._keysvalues == 2:             # <<<<<<<<<<<<<< 
 *             return _attributeValue(self._node._c_node, c_attr)
 *         else:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_v_self)->_keysvalues == 2);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1819
 *             return _namespacedName(<xmlNode*>c_attr)
 *         elif self._keysvalues == 2:
 *             return _attributeValue(self._node._c_node, c_attr)             # <<<<<<<<<<<<<< 
 *         else:
 *             return (_namespacedName(<xmlNode*>c_attr),
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1819; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1821
 *             return _attributeValue(self._node._c_node, c_attr)
 *         else:
 *             return (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<< 
 *                     _attributeValue(self._node._c_node, c_attr))
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1822
 *         else:
 *             return (_namespacedName(<xmlNode*>c_attr),
 *                     _attributeValue(self._node._c_node, c_attr))             # <<<<<<<<<<<<<< 
 * 
 * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
 */
  __pyx_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_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1822; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1821; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  __pyx_2 = 0;
  __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
}
__pyx_L6:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._AttribIterator.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1824
 *                     _attributeValue(self._node._c_node, c_attr))
 * 
 * cdef object _attributeIteratorFactory(_Element element, int keysvalues):             # <<<<<<<<<<<<<< 
 *     cdef _AttribIterator attribs
 *     if element._c_node.properties is NULL:
 */

static  PyObject *__pyx_f_4lxml_5etree__attributeIteratorFactory(struct LxmlElement *__pyx_v_element,int __pyx_v_keysvalues) {
struct __pyx_obj_4lxml_5etree__AttribIterator *__pyx_v_attribs;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_element);
__pyx_v_attribs = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1826
 * cdef object _attributeIteratorFactory(_Element element, int keysvalues):
 *     cdef _AttribIterator attribs
 *     if element._c_node.properties is NULL:             # <<<<<<<<<<<<<< 
 *         return ITER_EMPTY
 *     attribs = _AttribIterator()
 */
__pyx_1 = (__pyx_v_element->_c_node->properties == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1827
 *     cdef _AttribIterator attribs
 *     if element._c_node.properties is NULL:
 *         return ITER_EMPTY             # <<<<<<<<<<<<<< 
 *     attribs = _AttribIterator()
 *     attribs._node = element
 */
  Py_INCREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
  __pyx_r = __pyx_v_4lxml_5etree_ITER_EMPTY;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1828
 *     if element._c_node.properties is NULL:
 *         return ITER_EMPTY
 *     attribs = _AttribIterator()             # <<<<<<<<<<<<<< 
 *     attribs._node = element
 *     attribs._c_attr = element._c_node.properties
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__AttribIterator), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__AttribIterator)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1828; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_attribs));
__pyx_v_attribs = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1829
 *         return ITER_EMPTY
 *     attribs = _AttribIterator()
 *     attribs._node = element             # <<<<<<<<<<<<<< 
 *     attribs._c_attr = element._c_node.properties
 *     attribs._keysvalues = keysvalues
 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)__pyx_v_attribs->_node));
__pyx_v_attribs->_node = __pyx_v_element;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1830
 *     attribs = _AttribIterator()
 *     attribs._node = element
 *     attribs._c_attr = element._c_node.properties             # <<<<<<<<<<<<<< 
 *     attribs._keysvalues = keysvalues
 *     return attribs
 */
__pyx_v_attribs->_c_attr = __pyx_v_element->_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1831
 *     attribs._node = element
 *     attribs._c_attr = element._c_node.properties
 *     attribs._keysvalues = keysvalues             # <<<<<<<<<<<<<< 
 *     return attribs
 * 
 */
__pyx_v_attribs->_keysvalues = __pyx_v_keysvalues;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1832
 *     attribs._c_attr = element._c_node.properties
 *     attribs._keysvalues = keysvalues
 *     return attribs             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_attribs));
__pyx_r = ((PyObject *)__pyx_v_attribs);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._attributeIteratorFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_attribs);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1841
 *     cdef char* _href
 *     cdef char* _name
 *     cdef _initTagMatch(self, tag):             # <<<<<<<<<<<<<< 
 *         self._href = NULL
 *         self._name = NULL
 */

static PyObject *__pyx_n_Element;

static  PyObject *__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch(struct LxmlElementTagMatcher *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1842
 *     cdef char* _name
 *     cdef _initTagMatch(self, tag):
 *         self._href = NULL             # <<<<<<<<<<<<<< 
 *         self._name = NULL
 *         if tag is None:
 */
__pyx_v_self->_href = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1843
 *     cdef _initTagMatch(self, tag):
 *         self._href = NULL
 *         self._name = NULL             # <<<<<<<<<<<<<< 
 *         if tag is None:
 *             self._node_type = 0
 */
__pyx_v_self->_name = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1844
 *         self._href = NULL
 *         self._name = NULL
 *         if tag is None:             # <<<<<<<<<<<<<< 
 *             self._node_type = 0
 *         elif tag is Comment:
 */
__pyx_1 = (__pyx_v_tag == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1845
 *         self._name = NULL
 *         if tag is None:
 *             self._node_type = 0             # <<<<<<<<<<<<<< 
 *         elif tag is Comment:
 *             self._node_type = tree.XML_COMMENT_NODE
 */
  __pyx_v_self->_node_type = 0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1846
 *         if tag is None:
 *             self._node_type = 0
 *         elif tag is Comment:             # <<<<<<<<<<<<<< 
 *             self._node_type = tree.XML_COMMENT_NODE
 *         elif tag is ProcessingInstruction:
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Comment); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1846; goto __pyx_L1;}
__pyx_1 = (__pyx_v_tag == __pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1847
 *             self._node_type = 0
 *         elif tag is Comment:
 *             self._node_type = tree.XML_COMMENT_NODE             # <<<<<<<<<<<<<< 
 *         elif tag is ProcessingInstruction:
 *             self._node_type = tree.XML_PI_NODE
 */
  __pyx_v_self->_node_type = XML_COMMENT_NODE;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1848
 *         elif tag is Comment:
 *             self._node_type = tree.XML_COMMENT_NODE
 *         elif tag is ProcessingInstruction:             # <<<<<<<<<<<<<< 
 *             self._node_type = tree.XML_PI_NODE
 *         elif tag is Entity:
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ProcessingInstruction); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1848; goto __pyx_L1;}
__pyx_1 = (__pyx_v_tag == __pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1849
 *             self._node_type = tree.XML_COMMENT_NODE
 *         elif tag is ProcessingInstruction:
 *             self._node_type = tree.XML_PI_NODE             # <<<<<<<<<<<<<< 
 *         elif tag is Entity:
 *             self._node_type = tree.XML_ENTITY_REF_NODE
 */
  __pyx_v_self->_node_type = XML_PI_NODE;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1850
 *         elif tag is ProcessingInstruction:
 *             self._node_type = tree.XML_PI_NODE
 *         elif tag is Entity:             # <<<<<<<<<<<<<< 
 *             self._node_type = tree.XML_ENTITY_REF_NODE
 *         elif tag is Element:
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Entity); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; goto __pyx_L1;}
__pyx_1 = (__pyx_v_tag == __pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1851
 *             self._node_type = tree.XML_PI_NODE
 *         elif tag is Entity:
 *             self._node_type = tree.XML_ENTITY_REF_NODE             # <<<<<<<<<<<<<< 
 *         elif tag is Element:
 *             self._node_type = tree.XML_ELEMENT_NODE
 */
  __pyx_v_self->_node_type = XML_ENTITY_REF_NODE;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1852
 *         elif tag is Entity:
 *             self._node_type = tree.XML_ENTITY_REF_NODE
 *         elif tag is Element:             # <<<<<<<<<<<<<< 
 *             self._node_type = tree.XML_ELEMENT_NODE
 *         else:
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Element); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1852; goto __pyx_L1;}
__pyx_1 = (__pyx_v_tag == __pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1853
 *             self._node_type = tree.XML_ENTITY_REF_NODE
 *         elif tag is Element:
 *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<< 
 *         else:
 *             self._node_type = tree.XML_ELEMENT_NODE
 */
  __pyx_v_self->_node_type = XML_ELEMENT_NODE;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1855
 *             self._node_type = tree.XML_ELEMENT_NODE
 *         else:
 *             self._node_type = tree.XML_ELEMENT_NODE             # <<<<<<<<<<<<<< 
 *             self._pystrings = _getNsTag(tag)
 *             if self._pystrings[0] is not None:
 */
  __pyx_v_self->_node_type = XML_ELEMENT_NODE;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1856
 *         else:
 *             self._node_type = tree.XML_ELEMENT_NODE
 *             self._pystrings = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])
 */
  __pyx_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1856; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1856
 *         else:
 *             self._node_type = tree.XML_ELEMENT_NODE
 *             self._pystrings = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])
 */
  Py_DECREF(__pyx_v_self->_pystrings);
  __pyx_v_self->_pystrings = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1857
 *             self._node_type = tree.XML_ELEMENT_NODE
 *             self._pystrings = _getNsTag(tag)
 *             if self._pystrings[0] is not None:             # <<<<<<<<<<<<<< 
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])
 */
  if (PyList_CheckExact(__pyx_v_self->_pystrings) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_self->_pystrings)) {
    __pyx_3 = PyList_GET_ITEM(__pyx_v_self->_pystrings, 0); Py_INCREF(__pyx_3);
    } else if (PyTuple_CheckExact(__pyx_v_self->_pystrings) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_self->_pystrings)) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_pystrings, 0); Py_INCREF(__pyx_3);
    } else {
    __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1857; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1857
 *             self._node_type = tree.XML_ELEMENT_NODE
 *             self._pystrings = _getNsTag(tag)
 *             if self._pystrings[0] is not None:             # <<<<<<<<<<<<<< 
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])
 */
  __pyx_1 = (__pyx_3 != Py_None);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1858
 *             self._pystrings = _getNsTag(tag)
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])             # <<<<<<<<<<<<<< 
 *             self._name = _cstr(self._pystrings[1])
 *             if self._name[0] == c'*' and self._name[1] == c'\0':
 */
    if (PyList_CheckExact(__pyx_v_self->_pystrings) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_self->_pystrings)) {
      __pyx_3 = PyList_GET_ITEM(__pyx_v_self->_pystrings, 0); Py_INCREF(__pyx_3);
      } else if (PyTuple_CheckExact(__pyx_v_self->_pystrings) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_self->_pystrings)) {
      __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_pystrings, 0); Py_INCREF(__pyx_3);
      } else {
      __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; goto __pyx_L1;}
      __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1858; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1858
 *             self._pystrings = _getNsTag(tag)
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])             # <<<<<<<<<<<<<< 
 *             self._name = _cstr(self._pystrings[1])
 *             if self._name[0] == c'*' and self._name[1] == c'\0':
 */
    __pyx_v_self->_href = _cstr(__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1859
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])             # <<<<<<<<<<<<<< 
 *             if self._name[0] == c'*' and self._name[1] == c'\0':
 *                 self._name = NULL
 */
  if (PyList_CheckExact(__pyx_v_self->_pystrings) && 0 <= 1 && 1 < PyList_GET_SIZE(__pyx_v_self->_pystrings)) {
    __pyx_3 = PyList_GET_ITEM(__pyx_v_self->_pystrings, 1); Py_INCREF(__pyx_3);
    } else if (PyTuple_CheckExact(__pyx_v_self->_pystrings) && 0 <= 1 && 1 < PyTuple_GET_SIZE(__pyx_v_self->_pystrings)) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_pystrings, 1); Py_INCREF(__pyx_3);
    } else {
    __pyx_2 = PyInt_FromLong(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1859; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1859
 *             if self._pystrings[0] is not None:
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])             # <<<<<<<<<<<<<< 
 *             if self._name[0] == c'*' and self._name[1] == c'\0':
 *                 self._name = NULL
 */
  __pyx_v_self->_name = _cstr(__pyx_3);
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1860
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])
 *             if self._name[0] == c'*' and self._name[1] == c'\0':             # <<<<<<<<<<<<<< 
 *                 self._name = NULL
 * 
 */
  __pyx_1 = ((__pyx_v_self->_name[0]) == '*');
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1860
 *                 self._href = _cstr(self._pystrings[0])
 *             self._name = _cstr(self._pystrings[1])
 *             if self._name[0] == c'*' and self._name[1] == c'\0':             # <<<<<<<<<<<<<< 
 *                 self._name = NULL
 * 
 */
    __pyx_1 = ((__pyx_v_self->_name[1]) == '\0');
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1861
 *             self._name = _cstr(self._pystrings[1])
 *             if self._name[0] == c'*' and self._name[1] == c'\0':
 *                 self._name = NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef public class _ElementIterator(_ElementTagMatcher) [
 */
    __pyx_v_self->_name = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ElementTagMatcher._initTagMatch");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1868
 *     cdef _Element _node
 *     cdef _node_to_node_function _next_element
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1869
 *     cdef _node_to_node_function _next_element
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _storeNext(self, _Element node):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1871
 *         return self
 * 
 *     cdef void _storeNext(self, _Element node):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         c_node = self._next_element(node._c_node)
 */

static  void __pyx_f_4lxml_5etree_16_ElementIterator__storeNext(struct LxmlElementIterator *__pyx_v_self,struct LxmlElement *__pyx_v_node) {
xmlNode *__pyx_v_c_node;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1873
 *     cdef void _storeNext(self, _Element node):
 *         cdef xmlNode* c_node
 *         c_node = self._next_element(node._c_node)             # <<<<<<<<<<<<<< 
 *         while c_node is not NULL and \
 *                   self._node_type != 0 and \
 */
__pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_node->_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1874
 *         cdef xmlNode* c_node
 *         c_node = self._next_element(node._c_node)
 *         while c_node is not NULL and \             # <<<<<<<<<<<<<< 
 *                   self._node_type != 0 and \
 *                   (self._node_type != c_node.type or
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1874
 *         cdef xmlNode* c_node
 *         c_node = self._next_element(node._c_node)
 *         while c_node is not NULL and \             # <<<<<<<<<<<<<< 
 *                   self._node_type != 0 and \
 *                   (self._node_type != c_node.type or
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1875
 *         c_node = self._next_element(node._c_node)
 *         while c_node is not NULL and \
 *                   self._node_type != 0 and \             # <<<<<<<<<<<<<< 
 *                   (self._node_type != c_node.type or
 *                    not _tagMatches(c_node, self._href, self._name)):
 */
    __pyx_1 = (__pyx_v_self->__pyx_base._node_type != 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1876
 *         while c_node is not NULL and \
 *                   self._node_type != 0 and \
 *                   (self._node_type != c_node.type or             # <<<<<<<<<<<<<< 
 *                    not _tagMatches(c_node, self._href, self._name)):
 *             c_node = self._next_element(c_node)
 */
      __pyx_1 = (__pyx_v_self->__pyx_base._node_type != __pyx_v_c_node->type);
      if (!__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1877
 *                   self._node_type != 0 and \
 *                   (self._node_type != c_node.type or
 *                    not _tagMatches(c_node, self._href, self._name)):             # <<<<<<<<<<<<<< 
 *             c_node = self._next_element(c_node)
 *         if c_node is NULL:
 */
        __pyx_1 = (!__pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->__pyx_base._href,__pyx_v_self->__pyx_base._name));
      }
    }
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1878
 *                   (self._node_type != c_node.type or
 *                    not _tagMatches(c_node, self._href, self._name)):
 *             c_node = self._next_element(c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             self._node = None
 */
  __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_c_node);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1879
 *                    not _tagMatches(c_node, self._href, self._name)):
 *             c_node = self._next_element(c_node)
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             self._node = None
 *         else:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1880
 *             c_node = self._next_element(c_node)
 *         if c_node is NULL:
 *             self._node = None             # <<<<<<<<<<<<<< 
 *         else:
 *             # Python ref:
 */
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)__pyx_v_self->_node));
  __pyx_v_self->_node = ((struct LxmlElement *)Py_None);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1883
 *         else:
 *             # Python ref:
 *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1883; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1883
 *         else:
 *             # Python ref:
 *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_node));
  __pyx_v_self->_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
}
__pyx_L4:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("lxml.etree._ElementIterator._storeNext");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1885
 *             self._node = _elementFactory(node._doc, c_node)
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         cdef _Element current_node
 */

static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_16_ElementIterator___next__(PyObject *__pyx_v_self) {
struct LxmlElement *__pyx_v_current_node;
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_current_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1889
 *         cdef _Element current_node
 *         # Python ref:
 *         current_node = self._node             # <<<<<<<<<<<<<< 
 *         if current_node is None:
 *             raise StopIteration
 */
Py_INCREF(((PyObject *)((struct LxmlElementIterator *)__pyx_v_self)->_node));
Py_DECREF(((PyObject *)__pyx_v_current_node));
__pyx_v_current_node = ((struct LxmlElementIterator *)__pyx_v_self)->_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1890
 *         # Python ref:
 *         current_node = self._node
 *         if current_node is None:             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 *         self._storeNext(current_node)
 */
__pyx_1 = (((PyObject *)__pyx_v_current_node) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1891
 *         current_node = self._node
 *         if current_node is None:
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 *         self._storeNext(current_node)
 *         return current_node
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1891; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1892
 *         if current_node is None:
 *             raise StopIteration
 *         self._storeNext(current_node)             # <<<<<<<<<<<<<< 
 *         return current_node
 * 
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1893
 *             raise StopIteration
 *         self._storeNext(current_node)
 *         return current_node             # <<<<<<<<<<<<<< 
 * 
 * cdef class ElementChildIterator(_ElementIterator):
 */
Py_INCREF(((PyObject *)__pyx_v_current_node));
__pyx_r = ((PyObject *)__pyx_v_current_node);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ElementIterator.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_current_node);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1897
 * cdef class ElementChildIterator(_ElementIterator):
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         self._initTagMatch(tag)
 */

static int __pyx_pf_4lxml_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_reversed = 0;
xmlNode *__pyx_v_c_node;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"node","tag","reversed",0};
__pyx_v_tag = __pyx_k91;
__pyx_v_reversed = __pyx_k92;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_tag, &__pyx_v_reversed))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_reversed);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1897; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1899
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):
 *         cdef xmlNode* c_node
 *         self._initTagMatch(tag)             # <<<<<<<<<<<<<< 
 *         if reversed:
 *             c_node = _findChildBackwards(node._c_node, 0)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1899; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1900
 *         cdef xmlNode* c_node
 *         self._initTagMatch(tag)
 *         if reversed:             # <<<<<<<<<<<<<< 
 *             c_node = _findChildBackwards(node._c_node, 0)
 *             self._next_element = _previousElement
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_reversed); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1900; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1901
 *         self._initTagMatch(tag)
 *         if reversed:
 *             c_node = _findChildBackwards(node._c_node, 0)             # <<<<<<<<<<<<<< 
 *             self._next_element = _previousElement
 *         else:
 */
  __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_node->_c_node,0);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1902
 *         if reversed:
 *             c_node = _findChildBackwards(node._c_node, 0)
 *             self._next_element = _previousElement             # <<<<<<<<<<<<<< 
 *         else:
 *             c_node = _findChildForwards(node._c_node, 0)
 */
  ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1904
 *             self._next_element = _previousElement
 *         else:
 *             c_node = _findChildForwards(node._c_node, 0)             # <<<<<<<<<<<<<< 
 *             self._next_element = _nextElement
 *         if tag is not None:
 */
  __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_node->_c_node,0);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1905
 *         else:
 *             c_node = _findChildForwards(node._c_node, 0)
 *             self._next_element = _nextElement             # <<<<<<<<<<<<<< 
 *         if tag is not None:
 *             while c_node is not NULL and \
 */
  ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__nextElement;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1906
 *             c_node = _findChildForwards(node._c_node, 0)
 *             self._next_element = _nextElement
 *         if tag is not None:             # <<<<<<<<<<<<<< 
 *             while c_node is not NULL and \
 *                       self._node_type != 0 and \
 */
__pyx_2 = (__pyx_v_tag != Py_None);
if (__pyx_2) {
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1907
 *             self._next_element = _nextElement
 *         if tag is not None:
 *             while c_node is not NULL and \             # <<<<<<<<<<<<<< 
 *                       self._node_type != 0 and \
 *                       (self._node_type != c_node.type or
 */
    __pyx_2 = (__pyx_v_c_node != NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1908
 *         if tag is not None:
 *             while c_node is not NULL and \
 *                       self._node_type != 0 and \             # <<<<<<<<<<<<<< 
 *                       (self._node_type != c_node.type or
 *                        not _tagMatches(c_node, self._href, self._name)):
 */
      __pyx_2 = (((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != 0);
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1909
 *             while c_node is not NULL and \
 *                       self._node_type != 0 and \
 *                       (self._node_type != c_node.type or             # <<<<<<<<<<<<<< 
 *                        not _tagMatches(c_node, self._href, self._name)):
 *                 c_node = self._next_element(c_node)
 */
        __pyx_2 = (((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._node_type != __pyx_v_c_node->type);
        if (!__pyx_2) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1910
 *                       self._node_type != 0 and \
 *                       (self._node_type != c_node.type or
 *                        not _tagMatches(c_node, self._href, self._name)):             # <<<<<<<<<<<<<< 
 *                 c_node = self._next_element(c_node)
 *         if c_node is not NULL:
 */
          __pyx_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));
        }
      }
    }
    if (!__pyx_2) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1911
 *                       (self._node_type != c_node.type or
 *                        not _tagMatches(c_node, self._href, self._name)):
 *                 c_node = self._next_element(c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is not NULL:
 *             # store Python ref:
 */
    __pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element(__pyx_v_c_node);
  }
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1912
 *                        not _tagMatches(c_node, self._href, self._name)):
 *                 c_node = self._next_element(c_node)
 *         if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             # store Python ref:
 *             self._node = _elementFactory(node._doc, c_node)
 */
__pyx_2 = (__pyx_v_c_node != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1914
 *         if c_node is not NULL:
 *             # store Python ref:
 *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef class SiblingsIterator(_ElementIterator):
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1914; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1914
 *         if c_node is not NULL:
 *             # store Python ref:
 *             self._node = _elementFactory(node._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef class SiblingsIterator(_ElementIterator):
 */
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node));
  ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.ElementChildIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_reversed);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1921
 *     You can pass the boolean keyword ``preceding`` to specify the direction.
 *     """
 *     def __init__(self, _Element node not None, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         if preceding:
 */

static int __pyx_pf_4lxml_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_preceding = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"node","tag","preceding",0};
__pyx_v_tag = __pyx_k93;
__pyx_v_preceding = __pyx_k94;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_tag, &__pyx_v_preceding))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_preceding);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1921; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1922
 *     """
 *     def __init__(self, _Element node not None, tag=None, *, preceding=False):
 *         self._initTagMatch(tag)             # <<<<<<<<<<<<<< 
 *         if preceding:
 *             self._next_element = _previousElement
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1922; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1923
 *     def __init__(self, _Element node not None, tag=None, *, preceding=False):
 *         self._initTagMatch(tag)
 *         if preceding:             # <<<<<<<<<<<<<< 
 *             self._next_element = _previousElement
 *         else:
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_preceding); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1923; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1924
 *         self._initTagMatch(tag)
 *         if preceding:
 *             self._next_element = _previousElement             # <<<<<<<<<<<<<< 
 *         else:
 *             self._next_element = _nextElement
 */
  ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__previousElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1926
 *             self._next_element = _previousElement
 *         else:
 *             self._next_element = _nextElement             # <<<<<<<<<<<<<< 
 *         self._storeNext(node)
 * 
 */
  ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__nextElement;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1927
 *         else:
 *             self._next_element = _nextElement
 *         self._storeNext(node)             # <<<<<<<<<<<<<< 
 * 
 * cdef class AncestorsIterator(_ElementIterator):
 */
((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);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.SiblingsIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_preceding);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1931
 * cdef class AncestorsIterator(_ElementIterator):
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         self._next_element = _parentElement
 */

static int __pyx_pf_4lxml_5etree_17AncestorsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17AncestorsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_tag = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"node","tag",0};
__pyx_v_tag = __pyx_k95;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_node, &__pyx_v_tag))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_tag);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1931; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1932
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):
 *         self._initTagMatch(tag)             # <<<<<<<<<<<<<< 
 *         self._next_element = _parentElement
 *         self._storeNext(node)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1932; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1933
 *     def __init__(self, _Element node not None, tag=None):
 *         self._initTagMatch(tag)
 *         self._next_element = _parentElement             # <<<<<<<<<<<<<< 
 *         self._storeNext(node)
 * 
 */
((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_4lxml_5etree__parentElement;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1934
 *         self._initTagMatch(tag)
 *         self._next_element = _parentElement
 *         self._storeNext(node)             # <<<<<<<<<<<<<< 
 * 
 * cdef class ElementDepthFirstIterator(_ElementTagMatcher):
 */
((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);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.AncestorsIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1956
 *     cdef _Element _next_node
 *     cdef _Element _top_node
 *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):             # <<<<<<<<<<<<<< 
 *         self._top_node  = node
 *         self._next_node = node
 */

static PyObject *__pyx_n_next;

static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_inclusive = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"node","tag","inclusive",0};
__pyx_v_tag = __pyx_k96;
__pyx_v_inclusive = __pyx_k97;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_tag, &__pyx_v_inclusive))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_inclusive);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_4lxml_5etree__Element, 0, "node"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1956; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1957
 *     cdef _Element _top_node
 *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):
 *         self._top_node  = node             # <<<<<<<<<<<<<< 
 *         self._next_node = node
 *         self._initTagMatch(tag)
 */
Py_INCREF(((PyObject *)__pyx_v_node));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node));
((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node = __pyx_v_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1958
 *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):
 *         self._top_node  = node
 *         self._next_node = node             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         if not inclusive or \
 */
Py_INCREF(((PyObject *)__pyx_v_node));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = __pyx_v_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1959
 *         self._top_node  = node
 *         self._next_node = node
 *         self._initTagMatch(tag)             # <<<<<<<<<<<<<< 
 *         if not inclusive or \
 *                tag is not None and \
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1959; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1960
 *         self._next_node = node
 *         self._initTagMatch(tag)
 *         if not inclusive or \             # <<<<<<<<<<<<<< 
 *                tag is not None and \
 *                self._node_type != 0 and \
 */
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_v_inclusive); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1960; goto __pyx_L1;}
__pyx_2 = (!__pyx_3);
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1961
 *         self._initTagMatch(tag)
 *         if not inclusive or \
 *                tag is not None and \             # <<<<<<<<<<<<<< 
 *                self._node_type != 0 and \
 *                (self._node_type != node._c_node.type or
 */
  __pyx_2 = (__pyx_v_tag != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1962
 *         if not inclusive or \
 *                tag is not None and \
 *                self._node_type != 0 and \             # <<<<<<<<<<<<<< 
 *                (self._node_type != node._c_node.type or
 *                 not _tagMatches(node._c_node, self._href, self._name)):
 */
    __pyx_2 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != 0);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1963
 *                tag is not None and \
 *                self._node_type != 0 and \
 *                (self._node_type != node._c_node.type or             # <<<<<<<<<<<<<< 
 *                 not _tagMatches(node._c_node, self._href, self._name)):
 *             # this cannot raise StopIteration, self._next_node != None
 */
      __pyx_2 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._node_type != __pyx_v_node->_c_node->type);
      if (!__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1964
 *                self._node_type != 0 and \
 *                (self._node_type != node._c_node.type or
 *                 not _tagMatches(node._c_node, self._href, self._name)):             # <<<<<<<<<<<<<< 
 *             # this cannot raise StopIteration, self._next_node != None
 *             self.next()
 */
        __pyx_2 = (!__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));
      }
    }
  }
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1966
 *                 not _tagMatches(node._c_node, self._href, self._name)):
 *             # this cannot raise StopIteration, self._next_node != None
 *             self.next()             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_next); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1966; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_inclusive);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1968
 *             self.next()
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1969
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1971
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         cdef _Element current_node
 */

static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__(PyObject *__pyx_v_self) {
xmlNode *__pyx_v_c_node;
struct LxmlElement *__pyx_v_current_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_current_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1974
 *         cdef xmlNode* c_node
 *         cdef _Element current_node
 *         current_node = self._next_node             # <<<<<<<<<<<<<< 
 *         if current_node is None:
 *             raise StopIteration
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
Py_DECREF(((PyObject *)__pyx_v_current_node));
__pyx_v_current_node = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1975
 *         cdef _Element current_node
 *         current_node = self._next_node
 *         if current_node is None:             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 *         c_node = self._next_node._c_node
 */
__pyx_1 = (((PyObject *)__pyx_v_current_node) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1976
 *         current_node = self._next_node
 *         if current_node is None:
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 *         c_node = self._next_node._c_node
 *         if self._name is NULL and self._href is NULL:
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1976; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1977
 *         if current_node is None:
 *             raise StopIteration
 *         c_node = self._next_node._c_node             # <<<<<<<<<<<<<< 
 *         if self._name is NULL and self._href is NULL:
 *             c_node = self._nextNodeAnyTag(c_node)
 */
__pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1978
 *             raise StopIteration
 *         c_node = self._next_node._c_node
 *         if self._name is NULL and self._href is NULL:             # <<<<<<<<<<<<<< 
 *             c_node = self._nextNodeAnyTag(c_node)
 *         else:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1978
 *             raise StopIteration
 *         c_node = self._next_node._c_node
 *         if self._name is NULL and self._href is NULL:             # <<<<<<<<<<<<<< 
 *             c_node = self._nextNodeAnyTag(c_node)
 *         else:
 */
  __pyx_1 = (((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._href == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1979
 *         c_node = self._next_node._c_node
 *         if self._name is NULL and self._href is NULL:
 *             c_node = self._nextNodeAnyTag(c_node)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_node = self._nextNodeMatchTag(c_node)
 */
  __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);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1981
 *             c_node = self._nextNodeAnyTag(c_node)
 *         else:
 *             c_node = self._nextNodeMatchTag(c_node)             # <<<<<<<<<<<<<< 
 *         if c_node is NULL:
 *             self._next_node = None
 */
  __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);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1982
 *         else:
 *             c_node = self._nextNodeMatchTag(c_node)
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             self._next_node = None
 *         else:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1983
 *             c_node = self._nextNodeMatchTag(c_node)
 *         if c_node is NULL:
 *             self._next_node = None             # <<<<<<<<<<<<<< 
 *         else:
 *             self._next_node = _elementFactory(current_node._doc, c_node)
 */
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
  ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = ((struct LxmlElement *)Py_None);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1985
 *             self._next_node = None
 *         else:
 *             self._next_node = _elementFactory(current_node._doc, c_node)             # <<<<<<<<<<<<<< 
 *         return current_node
 * 
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_current_node->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1985; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1985
 *             self._next_node = None
 *         else:
 *             self._next_node = _elementFactory(current_node._doc, c_node)             # <<<<<<<<<<<<<< 
 *         return current_node
 * 
 */
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
  ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1986
 *         else:
 *             self._next_node = _elementFactory(current_node._doc, c_node)
 *         return current_node             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
 */
Py_INCREF(((PyObject *)__pyx_v_current_node));
__pyx_r = ((PyObject *)__pyx_v_current_node);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.ElementDepthFirstIterator.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_current_node);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1988
 *         return current_node
 * 
 *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if self._node_type == 0 or self._node_type == c_node.type:
 */

static  xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *__pyx_v_self,xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1989
 * 
 *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<< 
 *         if self._node_type == 0 or self._node_type == c_node.type:
 *             return c_node
 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node,__pyx_v_c_node,0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1990
 *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if self._node_type == 0 or self._node_type == c_node.type:             # <<<<<<<<<<<<<< 
 *             return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 */
__pyx_1 = (__pyx_v_self->__pyx_base._node_type == 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1990
 *     cdef xmlNode* _nextNodeAnyTag(self, xmlNode* c_node):
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if self._node_type == 0 or self._node_type == c_node.type:             # <<<<<<<<<<<<<< 
 *             return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 */
  __pyx_1 = (__pyx_v_self->__pyx_base._node_type == __pyx_v_c_node->type);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1991
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if self._node_type == 0 or self._node_type == c_node.type:
 *             return c_node             # <<<<<<<<<<<<<< 
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *         return NULL
 */
  __pyx_r = __pyx_v_c_node;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1992
 *         if self._node_type == 0 or self._node_type == c_node.type:
 *             return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<< 
 *         return NULL
 * 
 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1993
 *             return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *         return NULL             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1995
 *         return NULL
 * 
 *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if c_node.type == tree.XML_ELEMENT_NODE:
 */

static  xmlNode *__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *__pyx_v_self,xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1996
 * 
 *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)             # <<<<<<<<<<<<<< 
 *         if c_node.type == tree.XML_ELEMENT_NODE:
 *             if _tagMatches(c_node, self._href, self._name):
 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node,__pyx_v_c_node,0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1997
 *     cdef xmlNode* _nextNodeMatchTag(self, xmlNode* c_node):
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *             if _tagMatches(c_node, self._href, self._name):
 *                 return c_node
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1998
 *         tree.BEGIN_FOR_EACH_ELEMENT_FROM(self._top_node._c_node, c_node, 0)
 *         if c_node.type == tree.XML_ELEMENT_NODE:
 *             if _tagMatches(c_node, self._href, self._name):             # <<<<<<<<<<<<<< 
 *                 return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 */
  __pyx_1 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->__pyx_base._href,__pyx_v_self->__pyx_base._name);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1999
 *         if c_node.type == tree.XML_ELEMENT_NODE:
 *             if _tagMatches(c_node, self._href, self._name):
 *                 return c_node             # <<<<<<<<<<<<<< 
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *         return NULL
 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2000
 *             if _tagMatches(c_node, self._href, self._name):
 *                 return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<< 
 *         return NULL
 * 
 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2001
 *                 return c_node
 *         tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *         return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef class ElementTextIterator:
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2014
 *     cdef object _nextEvent
 *     cdef _Element _start_element
 *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         if with_tail:
 *             events = ("start", "end")
 */

static PyObject *__pyx_n_events;


static int __pyx_pf_4lxml_5etree_19ElementTextIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_19ElementTextIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_with_tail = 0;
PyObject *__pyx_v_events;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"element","tag","with_tail",0};
__pyx_v_tag = __pyx_k98;
__pyx_v_with_tail = __pyx_k99;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_element, &__pyx_v_tag, &__pyx_v_with_tail))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_with_tail);
__pyx_v_events = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2014; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2015
 *     cdef _Element _start_element
 *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):
 *         if with_tail:             # <<<<<<<<<<<<<< 
 *             events = ("start", "end")
 *         else:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_with_tail); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2015; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2016
 *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):
 *         if with_tail:
 *             events = ("start", "end")             # <<<<<<<<<<<<<< 
 *         else:
 *             events = ("start",)
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2016; goto __pyx_L1;}
  Py_INCREF(__pyx_n_start);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_start);
  Py_INCREF(__pyx_n_end);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_n_end);
  Py_DECREF(__pyx_v_events);
  __pyx_v_events = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2018
 *             events = ("start", "end")
 *         else:
 *             events = ("start",)             # <<<<<<<<<<<<<< 
 *         self._start_element = element
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2018; goto __pyx_L1;}
  Py_INCREF(__pyx_n_start);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_start);
  Py_DECREF(__pyx_v_events);
  __pyx_v_events = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2019
 *         else:
 *             events = ("start",)
 *         self._start_element = element             # <<<<<<<<<<<<<< 
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element));
((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element = __pyx_v_element;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2020
 *             events = ("start",)
 *         self._start_element = element
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_element));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_element));
__pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2020
 *             events = ("start",)
 *         self._start_element = element
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_events, __pyx_v_events) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2020
 *             events = ("start",)
 *         self._start_element = element
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_tag, __pyx_v_tag) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_iterwalk), __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n_next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2020; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2020
 *             events = ("start",)
 *         self._start_element = element
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent);
((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent = __pyx_2;
__pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.ElementTextIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_events);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_with_tail);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2022
 *         self._nextEvent = iterwalk(element, events=events, tag=tag).next
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2023
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2025
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef _Element element
 *         while result is None:
 */


static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_19ElementTextIterator___next__(PyObject *__pyx_v_self) {
struct LxmlElement *__pyx_v_element;
PyObject *__pyx_v_event;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_event = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2027
 *     def __next__(self):
 *         cdef _Element element
 *         while result is None:             # <<<<<<<<<<<<<< 
 *             event, element = self._nextEvent() # raises StopIteration
 *             if event == "start":
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2027
 *     def __next__(self):
 *         cdef _Element element
 *         while result is None:             # <<<<<<<<<<<<<< 
 *             event, element = self._nextEvent() # raises StopIteration
 *             if event == "start":
 */
  __pyx_1 = (__pyx_v_result == Py_None);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2028
 *         cdef _Element element
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<< 
 *             if event == "start":
 *                 result = element.text
 */
  __pyx_2 = PyObject_CallObject(((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_nextEvent, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
  if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
    __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0);
    Py_INCREF(__pyx_4);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2028
 *         cdef _Element element
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<< 
 *             if event == "start":
 *                 result = element.text
 */
    Py_DECREF(__pyx_v_event);
    __pyx_v_event = __pyx_4;
    __pyx_4 = 0;
    __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 1);
    Py_INCREF(__pyx_4);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2028
 *         cdef _Element element
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<< 
 *             if event == "start":
 *                 result = element.text
 */
    if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_4);
    __pyx_4 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  else {
    __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2028
 *         cdef _Element element
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<< 
 *             if event == "start":
 *                 result = element.text
 */
    Py_DECREF(__pyx_v_event);
    __pyx_v_event = __pyx_4;
    __pyx_4 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2028
 *         cdef _Element element
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration             # <<<<<<<<<<<<<< 
 *             if event == "start":
 *                 result = element.text
 */
    if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_4);
    __pyx_4 = 0;
    if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2028; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2029
 *         while result is None:
 *             event, element = self._nextEvent() # raises StopIteration
 *             if event == "start":             # <<<<<<<<<<<<<< 
 *                 result = element.text
 *             elif element is not self._start_element:
 */
  __pyx_4 = PyObject_RichCompare(__pyx_v_event, __pyx_n_start, Py_EQ); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2029; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2030
 *             event, element = self._nextEvent() # raises StopIteration
 *             if event == "start":
 *                 result = element.text             # <<<<<<<<<<<<<< 
 *             elif element is not self._start_element:
 *                 result = element.tail
 */
    __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_element), __pyx_n_text); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2030; goto __pyx_L1;}
    Py_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2031
 *             if event == "start":
 *                 result = element.text
 *             elif element is not self._start_element:             # <<<<<<<<<<<<<< 
 *                 result = element.tail
 *         return result
 */
  __pyx_1 = (__pyx_v_element != ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)__pyx_v_self)->_start_element);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2032
 *                 result = element.text
 *             elif element is not self._start_element:
 *                 result = element.tail             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
    __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_element), __pyx_n_tail); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2032; goto __pyx_L1;}
    Py_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2033
 *             elif element is not self._start_element:
 *                 result = element.tail
 *         return result             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.ElementTextIterator.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_event);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2035
 *         return result
 * 
 * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)
 */

static  xmlNode *__pyx_f_4lxml_5etree__createElement(xmlDoc *__pyx_v_c_doc,PyObject *__pyx_v_name_utf) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_r;
Py_INCREF(__pyx_v_name_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2037
 * cdef xmlNode* _createElement(xmlDoc* c_doc, object name_utf) except NULL:
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)             # <<<<<<<<<<<<<< 
 *     return c_node
 * 
 */
__pyx_v_c_node = xmlNewDocNode(__pyx_v_c_doc,NULL,_cstr(__pyx_v_name_utf),NULL);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2038
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocNode(c_doc, NULL, _cstr(name_utf), NULL)
 *     return c_node             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):
 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2040
 *     return c_node
 * 
 * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocComment(c_doc, text)
 */

static  xmlNode *__pyx_f_4lxml_5etree__createComment(xmlDoc *__pyx_v_c_doc,char *__pyx_v_text) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2042
 * cdef xmlNode* _createComment(xmlDoc* c_doc, char* text):
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocComment(c_doc, text)             # <<<<<<<<<<<<<< 
 *     return c_node
 * 
 */
__pyx_v_c_node = xmlNewDocComment(__pyx_v_c_doc,__pyx_v_text);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2043
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocComment(c_doc, text)
 *     return c_node             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):
 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2045
 *     return c_node
 * 
 * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocPI(c_doc, target, text)
 */

static  xmlNode *__pyx_f_4lxml_5etree__createPI(xmlDoc *__pyx_v_c_doc,char *__pyx_v_target,char *__pyx_v_text) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2047
 * cdef xmlNode* _createPI(xmlDoc* c_doc, char* target, char* text):
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocPI(c_doc, target, text)             # <<<<<<<<<<<<<< 
 *     return c_node
 * 
 */
__pyx_v_c_node = xmlNewDocPI(__pyx_v_c_doc,__pyx_v_target,__pyx_v_text);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2048
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewDocPI(c_doc, target, text)
 *     return c_node             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):
 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2050
 *     return c_node
 * 
 * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewReference(c_doc, name)
 */

static  xmlNode *__pyx_f_4lxml_5etree__createEntity(xmlDoc *__pyx_v_c_doc,char *__pyx_v_name) {
xmlNode *__pyx_v_c_node;
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2052
 * cdef xmlNode* _createEntity(xmlDoc* c_doc, char* name):
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewReference(c_doc, name)             # <<<<<<<<<<<<<< 
 *     return c_node
 * 
 */
__pyx_v_c_node = xmlNewReference(__pyx_v_c_doc,__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2053
 *     cdef xmlNode* c_node
 *     c_node = tree.xmlNewReference(c_doc, name)
 *     return c_node             # <<<<<<<<<<<<<< 
 * 
 * # module-level API for ElementTree
 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2057
 * # module-level API for ElementTree
 * 
 * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *     """Element factory.  This function returns an object implementing the
 *     Element interface.
 */

static PyObject *__pyx_pf_4lxml_5etree_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_Element[] = "Element factory.  This function returns an object implementing the\n    Element interface.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__tag = 0;
PyObject *__pyx_v_attrib = 0;
PyObject *__pyx_v_nsmap = 0;
PyObject *__pyx_v__extra = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"_tag","attrib","nsmap",0};
__pyx_v_attrib = __pyx_k100;
__pyx_v_nsmap = __pyx_k101;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__tag, &__pyx_v_attrib, &__pyx_v_nsmap))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__extra);
  return NULL;
}
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2063
 *     ### also look at _Element.makeelement() and _BaseParser.makeelement() ###
 *     return _makeElement(_tag, NULL, None, None, None, None,
 *                         attrib, nsmap, _extra)             # <<<<<<<<<<<<<< 
 * 
 * def Comment(text=None):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2062; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.Element");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__extra);
Py_DECREF(__pyx_v__tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2065
 *                         attrib, nsmap, _extra)
 * 
 * def Comment(text=None):             # <<<<<<<<<<<<<< 
 *     """Comment element factory. This factory function creates a special element that will
 *     be serialized as an XML comment.
 */

static PyObject *__pyx_k399p;

static char __pyx_k399[] = "";

static PyObject *__pyx_pf_4lxml_5etree_Comment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_Comment[] = "Comment element factory. This factory function creates a special element that will\n    be serialized as an XML comment.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_Comment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct LxmlDocument *__pyx_v_doc;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"text",0};
__pyx_v_text = __pyx_k102;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_text))) return NULL;
Py_INCREF(__pyx_v_text);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2072
 *     cdef xmlNode*  c_node
 *     cdef xmlDoc*   c_doc
 *     if text is None:             # <<<<<<<<<<<<<< 
 *         text = ''
 *     else:
 */
__pyx_1 = (__pyx_v_text == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2073
 *     cdef xmlDoc*   c_doc
 *     if text is None:
 *         text = ''             # <<<<<<<<<<<<<< 
 *     else:
 *         text = _utf8(text)
 */
  Py_INCREF(__pyx_k399p);
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_k399p;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2075
 *         text = ''
 *     else:
 *         text = _utf8(text)             # <<<<<<<<<<<<<< 
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2075; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2076
 *     else:
 *         text = _utf8(text)
 *     c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createComment(c_doc, _cstr(text))
 */
__pyx_3 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2076; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2077
 *         text = _utf8(text)
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<< 
 *     c_node = _createComment(c_doc, _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2077; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2078
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createComment(c_doc, _cstr(text))             # <<<<<<<<<<<<<< 
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__createComment(__pyx_v_c_doc,_cstr(__pyx_v_text));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2079
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createComment(c_doc, _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<< 
 *     return _elementFactory(doc, c_node)
 * 
 */
xmlAddChild(((xmlNode *)__pyx_v_c_doc),__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2080
 *     c_node = _createComment(c_doc, _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * def ProcessingInstruction(target, text=None):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2080; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.Comment");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2082
 *     return _elementFactory(doc, c_node)
 * 
 * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<< 
 *     """ProcessingInstruction element factory. This factory function creates a
 *     special element that will be serialized as an XML processing instruction.
 */

static PyObject *__pyx_k400p;

static char __pyx_k400[] = "";

static PyObject *__pyx_pf_4lxml_5etree_ProcessingInstruction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_ProcessingInstruction[] = "ProcessingInstruction element factory. This factory function creates a\n    special element that will be serialized as an XML processing instruction.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_ProcessingInstruction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_text = 0;
struct LxmlDocument *__pyx_v_doc;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"target","text",0};
__pyx_v_text = __pyx_k103;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_target, &__pyx_v_text))) return NULL;
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_text);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2089
 *     cdef xmlNode*  c_node
 *     cdef xmlDoc*   c_doc
 *     target = _utf8(target)             # <<<<<<<<<<<<<< 
 *     if text is None:
 *         text = ''
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_target); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2089; goto __pyx_L1;}
Py_DECREF(__pyx_v_target);
__pyx_v_target = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2090
 *     cdef xmlDoc*   c_doc
 *     target = _utf8(target)
 *     if text is None:             # <<<<<<<<<<<<<< 
 *         text = ''
 *     else:
 */
__pyx_2 = (__pyx_v_text == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2091
 *     target = _utf8(target)
 *     if text is None:
 *         text = ''             # <<<<<<<<<<<<<< 
 *     else:
 *         text = _utf8(text)
 */
  Py_INCREF(__pyx_k400p);
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_k400p;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2093
 *         text = ''
 *     else:
 *         text = _utf8(text)             # <<<<<<<<<<<<<< 
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 */
  __pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_text); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2093; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2094
 *     else:
 *         text = _utf8(text)
 *     c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
 */
__pyx_3 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2094; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2095
 *         text = _utf8(text)
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<< 
 *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2095; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2096
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))             # <<<<<<<<<<<<<< 
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__createPI(__pyx_v_c_doc,_cstr(__pyx_v_target),_cstr(__pyx_v_text));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2097
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<< 
 *     return _elementFactory(doc, c_node)
 * 
 */
xmlAddChild(((xmlNode *)__pyx_v_c_doc),__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2098
 *     c_node = _createPI(c_doc, _cstr(target), _cstr(text))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * PI = ProcessingInstruction
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2098; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.ProcessingInstruction");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2102
 * PI = ProcessingInstruction
 * 
 * def Entity(name):             # <<<<<<<<<<<<<< 
 *     """Entity factory.  This factory function creates a special element that
 *     will be serialized as an XML entity.  Note, however, that the entity will
 */

static PyObject *__pyx_pf_4lxml_5etree_Entity(PyObject *__pyx_self, PyObject *__pyx_v_name); /*proto*/
static char __pyx_doc_4lxml_5etree_Entity[] = "Entity factory.  This factory function creates a special element that\n    will be serialized as an XML entity.  Note, however, that the entity will\n    not be automatically declared in the document.  A document that uses\n    entities requires a DTD.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_Entity(PyObject *__pyx_self, PyObject *__pyx_v_name) {
struct LxmlDocument *__pyx_v_doc;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
xmlDoc *__pyx_2;
Py_INCREF(__pyx_v_name);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2111
 *     cdef xmlNode*  c_node
 *     cdef xmlDoc*   c_doc
 *     name = _utf8(name)             # <<<<<<<<<<<<<< 
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2111; goto __pyx_L1;}
Py_DECREF(__pyx_v_name);
__pyx_v_name = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2112
 *     cdef xmlDoc*   c_doc
 *     name = _utf8(name)
 *     c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createEntity(c_doc, _cstr(name))
 */
__pyx_2 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2112; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2113
 *     name = _utf8(name)
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)             # <<<<<<<<<<<<<< 
 *     c_node = _createEntity(c_doc, _cstr(name))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2113; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2114
 *     c_doc = _newDoc()
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createEntity(c_doc, _cstr(name))             # <<<<<<<<<<<<<< 
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__createEntity(__pyx_v_c_doc,_cstr(__pyx_v_name));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2115
 *     doc = _documentFactory(c_doc, None)
 *     c_node = _createEntity(c_doc, _cstr(name))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)             # <<<<<<<<<<<<<< 
 *     return _elementFactory(doc, c_node)
 * 
 */
xmlAddChild(((xmlNode *)__pyx_v_c_doc),__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2116
 *     c_node = _createEntity(c_doc, _cstr(name))
 *     tree.xmlAddChild(<xmlNode*>c_doc, c_node)
 *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * def SubElement(_Element _parent not None, _tag,
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2116; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.Entity");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2118
 *     return _elementFactory(doc, c_node)
 * 
 * def SubElement(_Element _parent not None, _tag,             # <<<<<<<<<<<<<< 
 *                attrib=None, nsmap=None, **_extra):
 *     """Subelement factory.  This function creates an element instance, and
 */

static PyObject *__pyx_pf_4lxml_5etree_SubElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_SubElement[] = "Subelement factory.  This function creates an element instance, and\n    appends it to an existing element.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_SubElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v__parent = 0;
PyObject *__pyx_v__tag = 0;
PyObject *__pyx_v_attrib = 0;
PyObject *__pyx_v_nsmap = 0;
PyObject *__pyx_v__extra = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"_parent","_tag","attrib","nsmap",0};
__pyx_v_attrib = __pyx_k104;
__pyx_v_nsmap = __pyx_k105;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 4, 0, &__pyx_v__extra, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|OO", __pyx_argnames, &__pyx_v__parent, &__pyx_v__tag, &__pyx_v_attrib, &__pyx_v_nsmap))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__extra);
  return NULL;
}
Py_INCREF(__pyx_v__parent);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v__parent), __pyx_ptype_4lxml_5etree__Element, 0, "_parent"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2118; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2123
 *     appends it to an existing element.
 *     """
 *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)             # <<<<<<<<<<<<<< 
 * 
 * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2123; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.SubElement");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__extra);
Py_DECREF(__pyx_v__parent);
Py_DECREF(__pyx_v__tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2125
 *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)
 * 
 * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """ElementTree wrapper class.
 *     """
 */

static PyObject *__pyx_n_result;

static PyObject *__pyx_pf_4lxml_5etree_ElementTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_ElementTree[] = "ElementTree wrapper class.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_ElementTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
PyObject *__pyx_v_file = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_result_container;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
xmlDoc *__pyx_7;
static char *__pyx_argnames[] = {"element","file","parser",0};
__pyx_v_element = __pyx_k106;
__pyx_v_file = __pyx_k107;
__pyx_v_parser = __pyx_k108;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_element, &__pyx_v_file, &__pyx_v_parser))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_file);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_container = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 1, "element"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;}
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2125; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2135
 *     cdef _Document doc
 * 
 *     if element is not None:             # <<<<<<<<<<<<<< 
 *         doc  = element._doc
 *     elif file is not None:
 */
__pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2136
 * 
 *     if element is not None:
 *         doc  = element._doc             # <<<<<<<<<<<<<< 
 *     elif file is not None:
 *         try:
 */
  Py_INCREF(((PyObject *)__pyx_v_element->_doc));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = __pyx_v_element->_doc;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2137
 *     if element is not None:
 *         doc  = element._doc
 *     elif file is not None:             # <<<<<<<<<<<<<< 
 *         try:
 *             doc = _parseDocument(file, parser)
 */
__pyx_1 = (__pyx_v_file != Py_None);
if (__pyx_1) {
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2139
 *     elif file is not None:
 *         try:
 *             doc = _parseDocument(file, parser)             # <<<<<<<<<<<<<< 
 *         except _TargetParserResult, result_container:
 *             return result_container.result
 */
    __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_file,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2139; goto __pyx_L3;}
    Py_DECREF(((PyObject *)__pyx_v_doc));
    __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
    __pyx_2 = 0;
  }
  goto __pyx_L4;
  __pyx_L3:;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2140
 *         try:
 *             doc = _parseDocument(file, parser)
 *         except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *             return result_container.result
 *     else:
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}
  __pyx_3 = PyErr_ExceptionMatches(__pyx_2);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_3) {
    __Pyx_AddTraceback("lxml.etree.ElementTree");
    if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2140; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2140
 *         try:
 *             doc = _parseDocument(file, parser)
 *         except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *             return result_container.result
 *     else:
 */
    Py_INCREF(__pyx_4);
    Py_DECREF(__pyx_v_result_container);
    __pyx_v_result_container = __pyx_4;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2141
 *             doc = _parseDocument(file, parser)
 *         except _TargetParserResult, result_container:
 *             return result_container.result             # <<<<<<<<<<<<<< 
 *     else:
 *         c_doc = _newDoc()
 */
    __pyx_6 = PyObject_GetAttr(__pyx_v_result_container, __pyx_n_result); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2141; goto __pyx_L1;}
    __pyx_r = __pyx_6;
    __pyx_6 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    goto __pyx_L0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    goto __pyx_L4;
  }
  goto __pyx_L1;
  __pyx_L4:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2143
 *             return result_container.result
 *     else:
 *         c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *         doc = _documentFactory(c_doc, parser)
 * 
 */
  __pyx_7 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2143; goto __pyx_L1;}
  __pyx_v_c_doc = __pyx_7;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2144
 *     else:
 *         c_doc = _newDoc()
 *         doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 * 
 *     return _elementTreeFactory(doc, element)
 */
  __pyx_6 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2144; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_6);
  __pyx_6 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2146
 *         doc = _documentFactory(c_doc, parser)
 * 
 *     return _elementTreeFactory(doc, element)             # <<<<<<<<<<<<<< 
 * 
 * def HTML(text, _BaseParser parser=None, *, base_url=None):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc,__pyx_v_element)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2146; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree.ElementTree");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result_container);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_file);
Py_DECREF(__pyx_v_parser);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2148
 *     return _elementTreeFactory(doc, element)
 * 
 * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an HTML document from a string constant. This function can be used
 *     to embed "HTML literals" in Python code.
 */

static PyObject *__pyx_pf_4lxml_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_HTML[] = "Parses an HTML document from a string constant. This function can be used\n    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    ";
static PyObject *__pyx_pf_4lxml_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_v_base_url = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_result_container;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
static char *__pyx_argnames[] = {"text","parser","base_url",0};
__pyx_v_parser = __pyx_k109;
__pyx_v_base_url = __pyx_k110;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_text, &__pyx_v_parser, &__pyx_v_base_url))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_base_url);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_container = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2148; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2160
 *     """
 *     cdef _Document doc
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, HTMLParser):
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2161
 *     cdef _Document doc
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *         if not isinstance(parser, HTMLParser):
 *             parser = __DEFAULT_HTML_PARSER
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2161; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2162
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, HTMLParser):             # <<<<<<<<<<<<<< 
 *             parser = __DEFAULT_HTML_PARSER
 *     try:
 */
  __pyx_1 = PyObject_IsInstance(((PyObject *)__pyx_v_parser),((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2162; goto __pyx_L1;}
  __pyx_3 = (!__pyx_1);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2163
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, HTMLParser):
 *             parser = __DEFAULT_HTML_PARSER             # <<<<<<<<<<<<<< 
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)
 */
    Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
    Py_DECREF(((PyObject *)__pyx_v_parser));
    __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2164
 *         if not isinstance(parser, HTMLParser):
 *             parser = __DEFAULT_HTML_PARSER
 *     try:             # <<<<<<<<<<<<<< 
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2165
 *             parser = __DEFAULT_HTML_PARSER
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<< 
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text,__pyx_v_base_url,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2165; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2166
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()             # <<<<<<<<<<<<<< 
 *     except _TargetParserResult, result_container:
 *         return result_container.result
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2166; goto __pyx_L4;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2167
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; goto __pyx_L1;}
__pyx_4 = PyErr_ExceptionMatches(__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_4) {
  __Pyx_AddTraceback("lxml.etree.HTML");
  if (__Pyx_GetException(&__pyx_2, &__pyx_5, &__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2167; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2167
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
  Py_INCREF(__pyx_5);
  Py_DECREF(__pyx_v_result_container);
  __pyx_v_result_container = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2168
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 *         return result_container.result             # <<<<<<<<<<<<<< 
 * 
 * def XML(text, _BaseParser parser=None, *, base_url=None):
 */
  __pyx_7 = PyObject_GetAttr(__pyx_v_result_container, __pyx_n_result); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2168; goto __pyx_L1;}
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  goto __pyx_L5;
}
goto __pyx_L1;
__pyx_L5:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.HTML");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result_container);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_base_url);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2170
 *         return result_container.result
 * 
 * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string constant. This function can be used
 *     to embed "XML literals" in Python code, like in
 */

static PyObject *__pyx_pf_4lxml_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_XML[] = "Parses an XML document from a string constant. This function can be used\n    to embed \"XML literals\" in Python code, 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    ";
static PyObject *__pyx_pf_4lxml_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_v_base_url = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_result_container;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
static char *__pyx_argnames[] = {"text","parser","base_url",0};
__pyx_v_parser = __pyx_k111;
__pyx_v_base_url = __pyx_k112;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_text, &__pyx_v_parser, &__pyx_v_base_url))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_base_url);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_container = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2170; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2184
 *     """
 *     cdef _Document doc
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, XMLParser):
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2185
 *     cdef _Document doc
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *         if not isinstance(parser, XMLParser):
 *             parser = __DEFAULT_XML_PARSER
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2185; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2186
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, XMLParser):             # <<<<<<<<<<<<<< 
 *             parser = __DEFAULT_XML_PARSER
 *     try:
 */
  __pyx_1 = PyObject_IsInstance(((PyObject *)__pyx_v_parser),((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2186; goto __pyx_L1;}
  __pyx_3 = (!__pyx_1);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2187
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *         if not isinstance(parser, XMLParser):
 *             parser = __DEFAULT_XML_PARSER             # <<<<<<<<<<<<<< 
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)
 */
    Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
    Py_DECREF(((PyObject *)__pyx_v_parser));
    __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2188
 *         if not isinstance(parser, XMLParser):
 *             parser = __DEFAULT_XML_PARSER
 *     try:             # <<<<<<<<<<<<<< 
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2189
 *             parser = __DEFAULT_XML_PARSER
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<< 
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text,__pyx_v_base_url,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2189; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2190
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()             # <<<<<<<<<<<<<< 
 *     except _TargetParserResult, result_container:
 *         return result_container.result
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2190; goto __pyx_L4;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2191
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}
__pyx_4 = PyErr_ExceptionMatches(__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_4) {
  __Pyx_AddTraceback("lxml.etree.XML");
  if (__Pyx_GetException(&__pyx_2, &__pyx_5, &__pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2191; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2191
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
  Py_INCREF(__pyx_5);
  Py_DECREF(__pyx_v_result_container);
  __pyx_v_result_container = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2192
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 *         return result_container.result             # <<<<<<<<<<<<<< 
 * 
 * def fromstring(text, _BaseParser parser=None, *, base_url=None):
 */
  __pyx_7 = PyObject_GetAttr(__pyx_v_result_container, __pyx_n_result); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2192; goto __pyx_L1;}
  __pyx_r = __pyx_7;
  __pyx_7 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  goto __pyx_L5;
}
goto __pyx_L1;
__pyx_L5:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.XML");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result_container);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_base_url);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2194
 *         return result_container.result
 * 
 * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_fromstring[] = "Parses an XML document from a string.\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    ";
static PyObject *__pyx_pf_4lxml_5etree_fromstring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_v_base_url = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_result_container;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"text","parser","base_url",0};
__pyx_v_parser = __pyx_k113;
__pyx_v_base_url = __pyx_k114;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_text, &__pyx_v_parser, &__pyx_v_base_url))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_base_url);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_container = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2194; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2205
 *     """
 *     cdef _Document doc
 *     try:             # <<<<<<<<<<<<<< 
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2206
 *     cdef _Document doc
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)             # <<<<<<<<<<<<<< 
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_v_text,__pyx_v_base_url,__pyx_v_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2206; goto __pyx_L2;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2207
 *     try:
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()             # <<<<<<<<<<<<<< 
 *     except _TargetParserResult, result_container:
 *         return result_container.result
 */
  __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2207; goto __pyx_L2;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2208
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}
__pyx_2 = PyErr_ExceptionMatches(__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree.fromstring");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2208; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2208
 *         doc = _parseMemoryDocument(text, base_url, parser)
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
  Py_INCREF(__pyx_3);
  Py_DECREF(__pyx_v_result_container);
  __pyx_v_result_container = __pyx_3;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2209
 *         return doc.getroot()
 *     except _TargetParserResult, result_container:
 *         return result_container.result             # <<<<<<<<<<<<<< 
 * 
 * def fromstringlist(strings, _BaseParser parser=None):
 */
  __pyx_5 = PyObject_GetAttr(__pyx_v_result_container, __pyx_n_result); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2209; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
goto __pyx_L1;
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.fromstring");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result_container);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_base_url);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2211
 *         return result_container.result
 * 
 * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a sequence of strings.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_fromstringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_fromstringlist[] = "Parses an XML document from a sequence of strings.\n\n    To override the default parser with a different parser you can pass it to\n    the ``parser`` keyword argument.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_fromstringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_strings = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_v_feed;
PyObject *__pyx_v_data;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"strings","parser",0};
__pyx_v_parser = __pyx_k115;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_strings, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_strings);
Py_INCREF(__pyx_v_parser);
__pyx_v_feed = Py_None; Py_INCREF(Py_None);
__pyx_v_data = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2211; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2218
 *     """
 *     cdef _Document doc
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     feed = parser.feed
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2219
 *     cdef _Document doc
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *     feed = parser.feed
 *     for data in strings:
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2219; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2220
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     feed = parser.feed             # <<<<<<<<<<<<<< 
 *     for data in strings:
 *         feed(data)
 */
__pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_n_feed); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2220; goto __pyx_L1;}
Py_DECREF(__pyx_v_feed);
__pyx_v_feed = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2221
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     feed = parser.feed
 *     for data in strings:             # <<<<<<<<<<<<<< 
 *         feed(data)
 *     return parser.close()
 */
if (PyList_CheckExact(__pyx_v_strings)) { __pyx_3 = 0; __pyx_2 = __pyx_v_strings; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_v_strings); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2221; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2221
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     feed = parser.feed
 *     for data in strings:             # <<<<<<<<<<<<<< 
 *         feed(data)
 *     return parser.close()
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_2);
    if (!__pyx_4) {
      break;
    }
  }
  Py_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2222
 *     feed = parser.feed
 *     for data in strings:
 *         feed(data)             # <<<<<<<<<<<<<< 
 *     return parser.close()
 * 
 */
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; goto __pyx_L1;}
  Py_INCREF(__pyx_v_data);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_data);
  __pyx_5 = PyObject_CallObject(__pyx_v_feed, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2222; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2223
 *     for data in strings:
 *         feed(data)
 *     return parser.close()             # <<<<<<<<<<<<<< 
 * 
 * def iselement(element):
 */
__pyx_4 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_n_close); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; goto __pyx_L1;}
__pyx_5 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2223; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_5;
__pyx_5 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.fromstringlist");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_feed);
Py_DECREF(__pyx_v_data);
Py_DECREF(__pyx_v_strings);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2225
 *     return parser.close()
 * 
 * def iselement(element):             # <<<<<<<<<<<<<< 
 *     """Checks if an object appears to be a valid element object.
 *     """
 */

static PyObject *__pyx_pf_4lxml_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_4lxml_5etree_iselement[] = "Checks if an object appears to be a valid element object.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_v_element) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_element);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2228
 *     """Checks if an object appears to be a valid element object.
 *     """
 *     return isinstance(element, _Element)             # <<<<<<<<<<<<<< 
 * 
 * def dump(_Element elem not None, *, pretty_print=True):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; goto __pyx_L1;}
__pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2228; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.iselement");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2230
 *     return isinstance(element, _Element)
 * 
 * def dump(_Element elem not None, *, pretty_print=True):             # <<<<<<<<<<<<<< 
 *     """Writes an element tree or element structure to sys.stdout. This function
 *     should be used for debugging only.
 */

static PyObject *__pyx_n_stdout;

static PyObject *__pyx_pf_4lxml_5etree_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_dump[] = "Writes an element tree or element structure to sys.stdout. This function\n    should be used for debugging only.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_elem = 0;
PyObject *__pyx_v_pretty_print = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"elem","pretty_print",0};
__pyx_v_pretty_print = __pyx_k116;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_elem, &__pyx_v_pretty_print))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_elem);
Py_INCREF(__pyx_v_pretty_print);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elem), __pyx_ptype_4lxml_5etree__Element, 0, "elem"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2230; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2234
 *     should be used for debugging only.
 *     """
 *     _dumpToFile(sys.stdout, elem._c_node, pretty_print)             # <<<<<<<<<<<<<< 
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_n_stdout); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2234
 *     should be used for debugging only.
 *     """
 *     _dumpToFile(sys.stdout, elem._c_node, pretty_print)             # <<<<<<<<<<<<<< 
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_2 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; goto __pyx_L1;}
__pyx_3 = __pyx_f_4lxml_5etree__dumpToFile(__pyx_1,__pyx_v_elem->_c_node,__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2234; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.dump");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_elem);
Py_DECREF(__pyx_v_pretty_print);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2236
 *     _dumpToFile(sys.stdout, elem._c_node, pretty_print)
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *              xml_declaration=None, pretty_print=False):
 *     """Serialize an element to an encoded string representation of its XML
 */

static PyObject *__pyx_k402p;
static PyObject *__pyx_k404p;
static PyObject *__pyx_k406p;

static char __pyx_k402[] = "UTF-8";
static char __pyx_k404[] = "US-ASCII";
static char __pyx_k406[] = "Type '%s' cannot be serialized.";

static PyObject *__pyx_pf_4lxml_5etree_tostring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_tostring[] = "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    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    ";
static PyObject *__pyx_pf_4lxml_5etree_tostring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_or_tree = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_method = 0;
PyObject *__pyx_v_xml_declaration = 0;
PyObject *__pyx_v_pretty_print = 0;
int __pyx_v_write_declaration;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"element_or_tree","encoding","method","xml_declaration","pretty_print",0};
__pyx_v_encoding = __pyx_k117;
__pyx_v_method = __pyx_k119;
__pyx_v_xml_declaration = __pyx_k120;
__pyx_v_pretty_print = __pyx_k121;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOOO", __pyx_argnames, &__pyx_v_element_or_tree, &__pyx_v_encoding, &__pyx_v_method, &__pyx_v_xml_declaration, &__pyx_v_pretty_print))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_element_or_tree);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_method);
Py_INCREF(__pyx_v_xml_declaration);
Py_INCREF(__pyx_v_pretty_print);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2252
 *     """
 *     cdef bint write_declaration
 *     if xml_declaration is None:             # <<<<<<<<<<<<<< 
 *         # by default, write an XML declaration only for non-standard encodings
 *         write_declaration = encoding is not None and encoding.upper() not in \
 */
__pyx_1 = (__pyx_v_xml_declaration == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2254
 *     if xml_declaration is None:
 *         # by default, write an XML declaration only for non-standard encodings
 *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<< 
 *                             ('ASCII', 'UTF-8', 'UTF8', 'US-ASCII')
 *     else:
 */
  __pyx_1 = (__pyx_v_encoding != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2254
 *     if xml_declaration is None:
 *         # by default, write an XML declaration only for non-standard encodings
 *         write_declaration = encoding is not None and encoding.upper() not in \             # <<<<<<<<<<<<<< 
 *                             ('ASCII', 'UTF-8', 'UTF8', 'US-ASCII')
 *     else:
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_upper); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2254; goto __pyx_L1;}
    __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2254; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2255
 *         # by default, write an XML declaration only for non-standard encodings
 *         write_declaration = encoding is not None and encoding.upper() not in \
 *                             ('ASCII', 'UTF-8', 'UTF8', 'US-ASCII')             # <<<<<<<<<<<<<< 
 *     else:
 *         write_declaration = xml_declaration
 */
    __pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2255; goto __pyx_L1;}
    Py_INCREF(__pyx_n_ASCII);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_ASCII);
    Py_INCREF(__pyx_k402p);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_k402p);
    Py_INCREF(__pyx_n_UTF8);
    PyTuple_SET_ITEM(__pyx_2, 2, __pyx_n_UTF8);
    Py_INCREF(__pyx_k404p);
    PyTuple_SET_ITEM(__pyx_2, 3, __pyx_k404p);
    __pyx_1 = (!PySequence_Contains(__pyx_2, __pyx_3)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2254; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  __pyx_v_write_declaration = __pyx_1;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2257
 *                             ('ASCII', 'UTF-8', 'UTF8', 'US-ASCII')
 *     else:
 *         write_declaration = xml_declaration             # <<<<<<<<<<<<<< 
 *     if encoding is None:
 *         encoding = 'ASCII'
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_xml_declaration); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2257; goto __pyx_L1;}
  __pyx_v_write_declaration = __pyx_1;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2258
 *     else:
 *         write_declaration = xml_declaration
 *     if encoding is None:             # <<<<<<<<<<<<<< 
 *         encoding = 'ASCII'
 * 
 */
__pyx_1 = (__pyx_v_encoding == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2259
 *         write_declaration = xml_declaration
 *     if encoding is None:
 *         encoding = 'ASCII'             # <<<<<<<<<<<<<< 
 * 
 *     if isinstance(element_or_tree, _Element):
 */
  Py_INCREF(__pyx_n_ASCII);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_n_ASCII;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2261
 *         encoding = 'ASCII'
 * 
 *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<< 
 *         return _tostring(<_Element>element_or_tree, encoding, method,
 *                          write_declaration, 0, pretty_print)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2261; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2263
 *     if isinstance(element_or_tree, _Element):
 *         return _tostring(<_Element>element_or_tree, encoding, method,
 *                          write_declaration, 0, pretty_print)             # <<<<<<<<<<<<<< 
 *     elif isinstance(element_or_tree, _ElementTree):
 *         return _tostring((<_ElementTree>element_or_tree)._context_node,
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2263; goto __pyx_L1;}
  __pyx_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_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2262; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2264
 *         return _tostring(<_Element>element_or_tree, encoding, method,
 *                          write_declaration, 0, pretty_print)
 *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<< 
 *         return _tostring((<_ElementTree>element_or_tree)._context_node,
 *                          encoding, method, write_declaration, 1, pretty_print)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2264; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2266
 *     elif isinstance(element_or_tree, _ElementTree):
 *         return _tostring((<_ElementTree>element_or_tree)._context_node,
 *                          encoding, method, write_declaration, 1, pretty_print)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2266; goto __pyx_L1;}
  __pyx_2 = __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_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2265; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2268
 *                          encoding, method, write_declaration, 1, pretty_print)
 *     else:
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)             # <<<<<<<<<<<<<< 
 * 
 * def tostringlist(element_or_tree, *args, **kwargs):
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; goto __pyx_L1;}
  Py_INCREF(__pyx_v_element_or_tree);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_element_or_tree);
  __pyx_2 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k406p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2268; goto __pyx_L1;}
}
__pyx_L4:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.tostring");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element_or_tree);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_method);
Py_DECREF(__pyx_v_xml_declaration);
Py_DECREF(__pyx_v_pretty_print);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2270
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)
 * 
 * def tostringlist(element_or_tree, *args, **kwargs):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to an encoded string representation of its XML
 *     tree, stored in a list of partial strings.
 */

static PyObject *__pyx_pf_4lxml_5etree_tostringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_tostringlist[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_tostringlist(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_or_tree = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_v_kwargs = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"element_or_tree",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, &__pyx_v_args, &__pyx_v_kwargs, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element_or_tree))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_args);
  Py_XDECREF(__pyx_v_kwargs);
  return NULL;
}
Py_INCREF(__pyx_v_element_or_tree);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2277
 *     single string wrapped in a list.
 *     """
 *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<< 
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_tostring); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2277
 *     single string wrapped in a list.
 *     """
 *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<< 
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}
Py_INCREF(__pyx_v_element_or_tree);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_element_or_tree);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2277
 *     single string wrapped in a list.
 *     """
 *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<< 
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):
 */
__pyx_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}
__pyx_4 = PyNumber_Add(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2277
 *     single string wrapped in a list.
 *     """
 *     return [tostring(element_or_tree, *args, **kwargs)]             # <<<<<<<<<<<<<< 
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):
 */
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_4, __pyx_v_kwargs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2277; goto __pyx_L1;}
PyList_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.tostringlist");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_XDECREF(__pyx_v_kwargs);
Py_DECREF(__pyx_v_element_or_tree);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2279
 *     return [tostring(element_or_tree, *args, **kwargs)]
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to the Python unicode representation of its XML
 *     tree.
 */

static PyObject *__pyx_k407p;

static char __pyx_k407[] = "Type '%s' cannot be serialized.";

static PyObject *__pyx_pf_4lxml_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_tounicode[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_or_tree = 0;
PyObject *__pyx_v_method = 0;
PyObject *__pyx_v_pretty_print = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"element_or_tree","method","pretty_print",0};
__pyx_v_method = __pyx_k123;
__pyx_v_pretty_print = __pyx_k124;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_element_or_tree, &__pyx_v_method, &__pyx_v_pretty_print))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_element_or_tree);
Py_INCREF(__pyx_v_method);
Py_INCREF(__pyx_v_pretty_print);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2292
 *     'html' or plain 'text'.
 *     """
 *     if isinstance(element_or_tree, _Element):             # <<<<<<<<<<<<<< 
 *         return _tounicode(<_Element>element_or_tree, method, 0, pretty_print)
 *     elif isinstance(element_or_tree, _ElementTree):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2292; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2293
 *     """
 *     if isinstance(element_or_tree, _Element):
 *         return _tounicode(<_Element>element_or_tree, method, 0, pretty_print)             # <<<<<<<<<<<<<< 
 *     elif isinstance(element_or_tree, _ElementTree):
 *         return _tounicode((<_ElementTree>element_or_tree)._context_node,
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; goto __pyx_L1;}
  __pyx_2 = __pyx_f_4lxml_5etree__tounicode(((struct LxmlElement *)__pyx_v_element_or_tree),__pyx_v_method,0,__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2293; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2294
 *     if isinstance(element_or_tree, _Element):
 *         return _tounicode(<_Element>element_or_tree, method, 0, pretty_print)
 *     elif isinstance(element_or_tree, _ElementTree):             # <<<<<<<<<<<<<< 
 *         return _tounicode((<_ElementTree>element_or_tree)._context_node,
 *                           method, 1, pretty_print)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2294; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2296
 *     elif isinstance(element_or_tree, _ElementTree):
 *         return _tounicode((<_ElementTree>element_or_tree)._context_node,
 *                           method, 1, pretty_print)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_pretty_print); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2296; goto __pyx_L1;}
  __pyx_2 = __pyx_f_4lxml_5etree__tounicode(((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node,__pyx_v_method,1,__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2295; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2298
 *                           method, 1, pretty_print)
 *     else:
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)             # <<<<<<<<<<<<<< 
 * 
 * def parse(source, _BaseParser parser=None):
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; goto __pyx_L1;}
  Py_INCREF(__pyx_v_element_or_tree);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_element_or_tree);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyNumber_Remainder(__pyx_k407p, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_2, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2298; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.tounicode");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element_or_tree);
Py_DECREF(__pyx_v_method);
Py_DECREF(__pyx_v_pretty_print);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2300
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)
 * 
 * def parse(source, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Return an ElementTree object loaded with source elements.  If no parser
 *     is provided as second argument, the default parser is used.
 */

static PyObject *__pyx_pf_4lxml_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_parse[] = "Return an ElementTree object loaded with source elements.  If no parser\n    is provided as second argument, the default parser is used.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_result_container;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"source","parser",0};
__pyx_v_parser = __pyx_k125;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_container = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2300; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2305
 *     """
 *     cdef _Document doc
 *     try:             # <<<<<<<<<<<<<< 
 *         doc = _parseDocument(source, parser)
 *         return _elementTreeFactory(doc, None)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2306
 *     cdef _Document doc
 *     try:
 *         doc = _parseDocument(source, parser)             # <<<<<<<<<<<<<< 
 *         return _elementTreeFactory(doc, None)
 *     except _TargetParserResult, result_container:
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source,__pyx_v_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2306; goto __pyx_L2;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2307
 *     try:
 *         doc = _parseDocument(source, parser)
 *         return _elementTreeFactory(doc, None)             # <<<<<<<<<<<<<< 
 *     except _TargetParserResult, result_container:
 *         return result_container.result
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc,((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2307; goto __pyx_L2;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2308
 *         doc = _parseDocument(source, parser)
 *         return _elementTreeFactory(doc, None)
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; goto __pyx_L1;}
__pyx_2 = PyErr_ExceptionMatches(__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree.parse");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2308; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2308
 *         doc = _parseDocument(source, parser)
 *         return _elementTreeFactory(doc, None)
 *     except _TargetParserResult, result_container:             # <<<<<<<<<<<<<< 
 *         return result_container.result
 * 
 */
  Py_INCREF(__pyx_3);
  Py_DECREF(__pyx_v_result_container);
  __pyx_v_result_container = __pyx_3;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2309
 *         return _elementTreeFactory(doc, None)
 *     except _TargetParserResult, result_container:
 *         return result_container.result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  __pyx_5 = PyObject_GetAttr(__pyx_v_result_container, __pyx_n_result); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2309; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
goto __pyx_L1;
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.parse");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result_container);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":7
 * # the Python class
 * 
 * cdef _Element getProxy(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Get a proxy for a given node.
 *     """
 */

static  struct LxmlElement *__pyx_f_4lxml_5etree_getProxy(xmlNode *__pyx_v_c_node) {
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":11
 *     """
 *     #print "getProxy for:", <int>c_node
 *     if c_node is not NULL and c_node._private is not NULL:             # <<<<<<<<<<<<<< 
 *         return <_Element>c_node._private
 *     else:
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":11
 *     """
 *     #print "getProxy for:", <int>c_node
 *     if c_node is not NULL and c_node._private is not NULL:             # <<<<<<<<<<<<<< 
 *         return <_Element>c_node._private
 *     else:
 */
  __pyx_1 = (__pyx_v_c_node->_private != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":12
 *     #print "getProxy for:", <int>c_node
 *     if c_node is not NULL and c_node._private is not NULL:
 *         return <_Element>c_node._private             # <<<<<<<<<<<<<< 
 *     else:
 *         return None
 */
  __pyx_2 = (PyObject *)__pyx_v_c_node->_private;
  Py_INCREF(__pyx_2);
  __pyx_r = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":14
 *         return <_Element>c_node._private
 *     else:
 *         return None             # <<<<<<<<<<<<<< 
 * 
 * cdef int hasProxy(xmlNode* c_node):
 */
  Py_INCREF(Py_None);
  __pyx_r = ((struct LxmlElement *)Py_None);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":16
 *         return None
 * 
 * cdef int hasProxy(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return c_node._private is not NULL
 *     
 */

static  int __pyx_f_4lxml_5etree_hasProxy(xmlNode *__pyx_v_c_node) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":17
 * 
 * cdef int hasProxy(xmlNode* c_node):
 *     return c_node._private is not NULL             # <<<<<<<<<<<<<< 
 *     
 * cdef int _registerProxy(_Element proxy) except -1:
 */
__pyx_r = (__pyx_v_c_node->_private != NULL);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":19
 *     return c_node._private is not NULL
 *     
 * cdef int _registerProxy(_Element proxy) except -1:             # <<<<<<<<<<<<<< 
 *     """Register a proxy and type for the node it's proxying for.
 *     """
 */

static PyObject *__pyx_k408p;

static char __pyx_k408[] = "double registering proxy!";

static  int __pyx_f_4lxml_5etree__registerProxy(struct LxmlElement *__pyx_v_proxy) {
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_proxy);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":24
 *     cdef xmlNode* c_node
 *     # cannot register for NULL
 *     c_node = proxy._c_node             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return 0
 */
__pyx_v_c_node = __pyx_v_proxy->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":25
 *     # cannot register for NULL
 *     c_node = proxy._c_node
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return 0
 *     #print "registering for:", <int>proxy._c_node
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":26
 *     c_node = proxy._c_node
 *     if c_node is NULL:
 *         return 0             # <<<<<<<<<<<<<< 
 *     #print "registering for:", <int>proxy._c_node
 *     assert c_node._private is NULL, "double registering proxy!"
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":28
 *         return 0
 *     #print "registering for:", <int>proxy._c_node
 *     assert c_node._private is NULL, "double registering proxy!"             # <<<<<<<<<<<<<< 
 *     c_node._private = <void*>proxy
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":28
 *         return 0
 *     #print "registering for:", <int>proxy._c_node
 *     assert c_node._private is NULL, "double registering proxy!"             # <<<<<<<<<<<<<< 
 *     c_node._private = <void*>proxy
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 */
if (unlikely(!(__pyx_v_c_node->_private == NULL))) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":28
 *         return 0
 *     #print "registering for:", <int>proxy._c_node
 *     assert c_node._private is NULL, "double registering proxy!"             # <<<<<<<<<<<<<< 
 *     c_node._private = <void*>proxy
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 */
  PyErr_SetObject(PyExc_AssertionError, __pyx_k408p);
  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":29
 *     #print "registering for:", <int>proxy._c_node
 *     assert c_node._private is NULL, "double registering proxy!"
 *     c_node._private = <void*>proxy             # <<<<<<<<<<<<<< 
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 *     proxy._gc_doc = <python.PyObject*>proxy._doc
 */
__pyx_v_c_node->_private = ((void *)__pyx_v_proxy);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":31
 *     c_node._private = <void*>proxy
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 *     proxy._gc_doc = <python.PyObject*>proxy._doc             # <<<<<<<<<<<<<< 
 *     python.Py_INCREF(proxy._doc)
 * 
 */
__pyx_v_proxy->_gc_doc = ((PyObject *)__pyx_v_proxy->_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":32
 *     # additional INCREF to make sure _Document is GC-ed LAST!
 *     proxy._gc_doc = <python.PyObject*>proxy._doc
 *     python.Py_INCREF(proxy._doc)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _unregisterProxy(_Element proxy) except -1:
 */
Py_INCREF(((PyObject *)__pyx_v_proxy->_doc));

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._registerProxy");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_proxy);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":34
 *     python.Py_INCREF(proxy._doc)
 * 
 * cdef int _unregisterProxy(_Element proxy) except -1:             # <<<<<<<<<<<<<< 
 *     """Unregister a proxy for the node it's proxying for.
 *     """
 */

static PyObject *__pyx_k409p;

static char __pyx_k409[] = "Tried to unregister unknown proxy";

static  int __pyx_f_4lxml_5etree__unregisterProxy(struct LxmlElement *__pyx_v_proxy) {
xmlNode *__pyx_v_c_node;
int __pyx_r;
Py_INCREF(__pyx_v_proxy);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":38
 *     """
 *     cdef xmlNode* c_node
 *     c_node = proxy._c_node             # <<<<<<<<<<<<<< 
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"
 *     c_node._private = NULL
 */
__pyx_v_c_node = __pyx_v_proxy->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":39
 *     cdef xmlNode* c_node
 *     c_node = proxy._c_node
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"             # <<<<<<<<<<<<<< 
 *     c_node._private = NULL
 *     return 0
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":39
 *     cdef xmlNode* c_node
 *     c_node = proxy._c_node
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"             # <<<<<<<<<<<<<< 
 *     c_node._private = NULL
 *     return 0
 */
if (unlikely(!(__pyx_v_c_node->_private == ((void *)__pyx_v_proxy)))) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":39
 *     cdef xmlNode* c_node
 *     c_node = proxy._c_node
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"             # <<<<<<<<<<<<<< 
 *     c_node._private = NULL
 *     return 0
 */
  PyErr_SetObject(PyExc_AssertionError, __pyx_k409p);
  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 39; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":40
 *     c_node = proxy._c_node
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"
 *     c_node._private = NULL             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
__pyx_v_c_node->_private = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":41
 *     assert c_node._private is <void*>proxy, "Tried to unregister unknown proxy"
 *     c_node._private = NULL
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef void _releaseProxy(_Element proxy):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._unregisterProxy");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_proxy);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":43
 *     return 0
 * 
 * cdef void _releaseProxy(_Element proxy):             # <<<<<<<<<<<<<< 
 *     """An additional DECREF for the document.
 *     """
 */

static  void __pyx_f_4lxml_5etree__releaseProxy(struct LxmlElement *__pyx_v_proxy) {
Py_INCREF(__pyx_v_proxy);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":46
 *     """An additional DECREF for the document.
 *     """
 *     python.Py_XDECREF(proxy._gc_doc)             # <<<<<<<<<<<<<< 
 *     proxy._gc_doc = NULL
 * 
 */
Py_XDECREF(__pyx_v_proxy->_gc_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":47
 *     """
 *     python.Py_XDECREF(proxy._gc_doc)
 *     proxy._gc_doc = NULL             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
__pyx_v_proxy->_gc_doc = NULL;

Py_DECREF(__pyx_v_proxy);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":52
 * # temporarily make a node the root node of its document
 * 
 * cdef xmlDoc* _fakeRootDoc(xmlDoc* c_base_doc, xmlNode* c_node) except NULL:             # <<<<<<<<<<<<<< 
 *     # build a temporary document that has the given node as root node
 *     # note that copy and original must not be modified during its lifetime!!
 */

static  xmlDoc *__pyx_f_4lxml_5etree__fakeRootDoc(xmlDoc *__pyx_v_c_base_doc,xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_v_c_child;
xmlNode *__pyx_v_c_root;
xmlNode *__pyx_v_c_new_root;
xmlDoc *__pyx_v_c_doc;
xmlDoc *__pyx_r;
int __pyx_1;
xmlDoc *__pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":60
 *     cdef xmlNode* c_new_root
 *     cdef xmlDoc*  c_doc
 *     c_root = tree.xmlDocGetRootElement(c_base_doc)             # <<<<<<<<<<<<<< 
 *     if c_root is c_node:
 *         # already the root node
 */
__pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_base_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":61
 *     cdef xmlDoc*  c_doc
 *     c_root = tree.xmlDocGetRootElement(c_base_doc)
 *     if c_root is c_node:             # <<<<<<<<<<<<<< 
 *         # already the root node
 *         return c_base_doc
 */
__pyx_1 = (__pyx_v_c_root == __pyx_v_c_node);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":63
 *     if c_root is c_node:
 *         # already the root node
 *         return c_base_doc             # <<<<<<<<<<<<<< 
 * 
 *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
 */
  __pyx_r = __pyx_v_c_base_doc;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":65
 *         return c_base_doc
 * 
 *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!             # <<<<<<<<<<<<<< 
 *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
 *     tree.xmlDocSetRootElement(c_doc, c_new_root)
 */
__pyx_2 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_base_doc,0); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 65; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":66
 * 
 *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
 *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!             # <<<<<<<<<<<<<< 
 *     tree.xmlDocSetRootElement(c_doc, c_new_root)
 *     _copyParentNamespaces(c_node, c_new_root)
 */
__pyx_v_c_new_root = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_c_doc,2);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":67
 *     c_doc  = _copyDoc(c_base_doc, 0)                   # non recursive!
 *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
 *     tree.xmlDocSetRootElement(c_doc, c_new_root)             # <<<<<<<<<<<<<< 
 *     _copyParentNamespaces(c_node, c_new_root)
 *     _copyParentNamespaces(c_node, c_root)
 */
xmlDocSetRootElement(__pyx_v_c_doc,__pyx_v_c_new_root);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":68
 *     c_new_root = tree.xmlDocCopyNode(c_node, c_doc, 2) # non recursive!
 *     tree.xmlDocSetRootElement(c_doc, c_new_root)
 *     _copyParentNamespaces(c_node, c_new_root)             # <<<<<<<<<<<<<< 
 *     _copyParentNamespaces(c_node, c_root)
 * 
 */
__pyx_f_4lxml_5etree__copyParentNamespaces(__pyx_v_c_node,__pyx_v_c_new_root);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":69
 *     tree.xmlDocSetRootElement(c_doc, c_new_root)
 *     _copyParentNamespaces(c_node, c_new_root)
 *     _copyParentNamespaces(c_node, c_root)             # <<<<<<<<<<<<<< 
 * 
 *     c_new_root.children = c_node.children
 */
__pyx_f_4lxml_5etree__copyParentNamespaces(__pyx_v_c_node,__pyx_v_c_root);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":71
 *     _copyParentNamespaces(c_node, c_root)
 * 
 *     c_new_root.children = c_node.children             # <<<<<<<<<<<<<< 
 *     c_new_root.last = c_node.last
 *     c_new_root.next = c_new_root.prev = c_new_root.parent = NULL
 */
__pyx_v_c_new_root->children = __pyx_v_c_node->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":72
 * 
 *     c_new_root.children = c_node.children
 *     c_new_root.last = c_node.last             # <<<<<<<<<<<<<< 
 *     c_new_root.next = c_new_root.prev = c_new_root.parent = NULL
 * 
 */
__pyx_v_c_new_root->last = __pyx_v_c_node->last;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":73
 *     c_new_root.children = c_node.children
 *     c_new_root.last = c_node.last
 *     c_new_root.next = c_new_root.prev = c_new_root.parent = NULL             # <<<<<<<<<<<<<< 
 * 
 *     # store original node
 */
__pyx_v_c_new_root->next = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":73
 *     c_new_root.children = c_node.children
 *     c_new_root.last = c_node.last
 *     c_new_root.next = c_new_root.prev = c_new_root.parent = NULL             # <<<<<<<<<<<<<< 
 * 
 *     # store original node
 */
__pyx_v_c_new_root->prev = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":73
 *     c_new_root.children = c_node.children
 *     c_new_root.last = c_node.last
 *     c_new_root.next = c_new_root.prev = c_new_root.parent = NULL             # <<<<<<<<<<<<<< 
 * 
 *     # store original node
 */
__pyx_v_c_new_root->parent = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":76
 * 
 *     # store original node
 *     c_doc._private = c_node             # <<<<<<<<<<<<<< 
 * 
 *     # divert parent pointers of children
 */
__pyx_v_c_doc->_private = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":79
 * 
 *     # divert parent pointers of children
 *     c_child = c_new_root.children             # <<<<<<<<<<<<<< 
 *     while c_child is not NULL:
 *         c_child.parent = c_new_root
 */
__pyx_v_c_child = __pyx_v_c_new_root->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":80
 *     # divert parent pointers of children
 *     c_child = c_new_root.children
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         c_child.parent = c_new_root
 *         c_child = c_child.next
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":80
 *     # divert parent pointers of children
 *     c_child = c_new_root.children
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         c_child.parent = c_new_root
 *         c_child = c_child.next
 */
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":81
 *     c_child = c_new_root.children
 *     while c_child is not NULL:
 *         c_child.parent = c_new_root             # <<<<<<<<<<<<<< 
 *         c_child = c_child.next
 * 
 */
  __pyx_v_c_child->parent = __pyx_v_c_new_root;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":82
 *     while c_child is not NULL:
 *         c_child.parent = c_new_root
 *         c_child = c_child.next             # <<<<<<<<<<<<<< 
 * 
 *     c_doc.children = c_new_root
 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":84
 *         c_child = c_child.next
 * 
 *     c_doc.children = c_new_root             # <<<<<<<<<<<<<< 
 *     return c_doc
 * 
 */
__pyx_v_c_doc->children = __pyx_v_c_new_root;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":85
 * 
 *     c_doc.children = c_new_root
 *     return c_doc             # <<<<<<<<<<<<<< 
 * 
 * cdef void _destroyFakeDoc(xmlDoc* c_base_doc, xmlDoc* c_doc):
 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._fakeRootDoc");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":87
 *     return c_doc
 * 
 * cdef void _destroyFakeDoc(xmlDoc* c_base_doc, xmlDoc* c_doc):             # <<<<<<<<<<<<<< 
 *     # delete a temporary document
 *     cdef xmlNode* c_child
 */

static  void __pyx_f_4lxml_5etree__destroyFakeDoc(xmlDoc *__pyx_v_c_base_doc,xmlDoc *__pyx_v_c_doc) {
xmlNode *__pyx_v_c_child;
xmlNode *__pyx_v_c_parent;
xmlNode *__pyx_v_c_root;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":92
 *     cdef xmlNode* c_parent
 *     cdef xmlNode* c_root
 *     if c_doc != c_base_doc:             # <<<<<<<<<<<<<< 
 *         c_root = tree.xmlDocGetRootElement(c_doc)
 * 
 */
__pyx_1 = (__pyx_v_c_doc != __pyx_v_c_base_doc);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":93
 *     cdef xmlNode* c_root
 *     if c_doc != c_base_doc:
 *         c_root = tree.xmlDocGetRootElement(c_doc)             # <<<<<<<<<<<<<< 
 * 
 *         # restore parent pointers of children
 */
  __pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_doc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":96
 * 
 *         # restore parent pointers of children
 *         c_parent = <xmlNode*>c_doc._private             # <<<<<<<<<<<<<< 
 *         c_child = c_root.children
 *         while c_child is not NULL:
 */
  __pyx_v_c_parent = ((xmlNode *)__pyx_v_c_doc->_private);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":97
 *         # restore parent pointers of children
 *         c_parent = <xmlNode*>c_doc._private
 *         c_child = c_root.children             # <<<<<<<<<<<<<< 
 *         while c_child is not NULL:
 *             c_child.parent = c_parent
 */
  __pyx_v_c_child = __pyx_v_c_root->children;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":98
 *         c_parent = <xmlNode*>c_doc._private
 *         c_child = c_root.children
 *         while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *             c_child.parent = c_parent
 *             c_child = c_child.next
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":98
 *         c_parent = <xmlNode*>c_doc._private
 *         c_child = c_root.children
 *         while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *             c_child.parent = c_parent
 *             c_child = c_child.next
 */
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":99
 *         c_child = c_root.children
 *         while c_child is not NULL:
 *             c_child.parent = c_parent             # <<<<<<<<<<<<<< 
 *             c_child = c_child.next
 * 
 */
    __pyx_v_c_child->parent = __pyx_v_c_parent;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":100
 *         while c_child is not NULL:
 *             c_child.parent = c_parent
 *             c_child = c_child.next             # <<<<<<<<<<<<<< 
 * 
 *         # prevent recursive removal of children
 */
    __pyx_v_c_child = __pyx_v_c_child->next;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":103
 * 
 *         # prevent recursive removal of children
 *         c_root.children = c_root.last = NULL             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeDoc(c_doc)
 * 
 */
  __pyx_v_c_root->children = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":103
 * 
 *         # prevent recursive removal of children
 *         c_root.children = c_root.last = NULL             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeDoc(c_doc)
 * 
 */
  __pyx_v_c_root->last = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":104
 *         # prevent recursive removal of children
 *         c_root.children = c_root.last = NULL
 *         tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
  xmlFreeDoc(__pyx_v_c_doc);
  goto __pyx_L2;
}
__pyx_L2:;

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":109
 * # support for freeing tree elements when proxy objects are destroyed
 * 
 * cdef int attemptDeallocation(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Attempt deallocation of c_node (or higher up in tree).
 *     """
 */

static  int __pyx_f_4lxml_5etree_attemptDeallocation(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_v_c_top;
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":114
 *     cdef xmlNode* c_top
 *     # could be we actually aren't referring to the tree at all
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         #print "not freeing, node is NULL"
 *         return 0
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":116
 *     if c_node is NULL:
 *         #print "not freeing, node is NULL"
 *         return 0             # <<<<<<<<<<<<<< 
 *     c_top = getDeallocationTop(c_node)
 *     if c_top is not NULL:
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":117
 *         #print "not freeing, node is NULL"
 *         return 0
 *     c_top = getDeallocationTop(c_node)             # <<<<<<<<<<<<<< 
 *     if c_top is not NULL:
 *         #print "freeing:", c_top.name
 */
__pyx_v_c_top = __pyx_f_4lxml_5etree_getDeallocationTop(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":118
 *         return 0
 *     c_top = getDeallocationTop(c_node)
 *     if c_top is not NULL:             # <<<<<<<<<<<<<< 
 *         #print "freeing:", c_top.name
 *         _removeText(c_top.next) # tail
 */
__pyx_1 = (__pyx_v_c_top != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":120
 *     if c_top is not NULL:
 *         #print "freeing:", c_top.name
 *         _removeText(c_top.next) # tail             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeNode(c_top)
 *         return 1
 */
  __pyx_f_4lxml_5etree__removeText(__pyx_v_c_top->next);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":121
 *         #print "freeing:", c_top.name
 *         _removeText(c_top.next) # tail
 *         tree.xmlFreeNode(c_top)             # <<<<<<<<<<<<<< 
 *         return 1
 *     return 0
 */
  xmlFreeNode(__pyx_v_c_top);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":122
 *         _removeText(c_top.next) # tail
 *         tree.xmlFreeNode(c_top)
 *         return 1             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":123
 *         tree.xmlFreeNode(c_top)
 *         return 1
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* getDeallocationTop(xmlNode* c_node):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":125
 *     return 0
 * 
 * cdef xmlNode* getDeallocationTop(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Return the top of the tree that can be deallocated, or NULL.
 *     """
 */

static  xmlNode *__pyx_f_4lxml_5etree_getDeallocationTop(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_v_c_current;
xmlNode *__pyx_v_c_top;
xmlNode *__pyx_r;
int __pyx_1;
int __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":131
 *     cdef xmlNode* c_top
 *     #print "trying to do deallocating:", c_node.type
 *     if c_node._private is not NULL:             # <<<<<<<<<<<<<< 
 *         #print "Not freeing: proxies still exist"
 *         return NULL
 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":133
 *     if c_node._private is not NULL:
 *         #print "Not freeing: proxies still exist"
 *         return NULL             # <<<<<<<<<<<<<< 
 *     c_current = c_node.parent
 *     c_top = c_node
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":134
 *         #print "Not freeing: proxies still exist"
 *         return NULL
 *     c_current = c_node.parent             # <<<<<<<<<<<<<< 
 *     c_top = c_node
 *     while c_current is not NULL:
 */
__pyx_v_c_current = __pyx_v_c_node->parent;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":135
 *         return NULL
 *     c_current = c_node.parent
 *     c_top = c_node             # <<<<<<<<<<<<<< 
 *     while c_current is not NULL:
 *         #print "checking:", c_current.type
 */
__pyx_v_c_top = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":136
 *     c_current = c_node.parent
 *     c_top = c_node
 *     while c_current is not NULL:             # <<<<<<<<<<<<<< 
 *         #print "checking:", c_current.type
 *         if c_current.type == tree.XML_DOCUMENT_NODE or \
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":136
 *     c_current = c_node.parent
 *     c_top = c_node
 *     while c_current is not NULL:             # <<<<<<<<<<<<<< 
 *         #print "checking:", c_current.type
 *         if c_current.type == tree.XML_DOCUMENT_NODE or \
 */
  __pyx_1 = (__pyx_v_c_current != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":138
 *     while c_current is not NULL:
 *         #print "checking:", c_current.type
 *         if c_current.type == tree.XML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<< 
 *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:
 *             #print "not freeing: still in doc"
 */
  __pyx_1 = (__pyx_v_c_current->type == XML_DOCUMENT_NODE);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":139
 *         #print "checking:", c_current.type
 *         if c_current.type == tree.XML_DOCUMENT_NODE or \
 *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:             # <<<<<<<<<<<<<< 
 *             #print "not freeing: still in doc"
 *             return NULL
 */
    __pyx_1 = (__pyx_v_c_current->type == XML_HTML_DOCUMENT_NODE);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":141
 *                c_current.type == tree.XML_HTML_DOCUMENT_NODE:
 *             #print "not freeing: still in doc"
 *             return NULL             # <<<<<<<<<<<<<< 
 *         # if we're still attached to the document, don't deallocate
 *         if c_current._private is not NULL:
 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":143
 *             return NULL
 *         # if we're still attached to the document, don't deallocate
 *         if c_current._private is not NULL:             # <<<<<<<<<<<<<< 
 *             #print "Not freeing: proxies still exist"
 *             return NULL
 */
  __pyx_1 = (__pyx_v_c_current->_private != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":145
 *         if c_current._private is not NULL:
 *             #print "Not freeing: proxies still exist"
 *             return NULL             # <<<<<<<<<<<<<< 
 *         c_top = c_current
 *         c_current = c_current.parent
 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":146
 *             #print "Not freeing: proxies still exist"
 *             return NULL
 *         c_top = c_current             # <<<<<<<<<<<<<< 
 *         c_current = c_current.parent
 *     # see whether we have children to deallocate
 */
  __pyx_v_c_top = __pyx_v_c_current;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":147
 *             return NULL
 *         c_top = c_current
 *         c_current = c_current.parent             # <<<<<<<<<<<<<< 
 *     # see whether we have children to deallocate
 *     if canDeallocateChildNodes(c_top):
 */
  __pyx_v_c_current = __pyx_v_c_current->parent;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":149
 *         c_current = c_current.parent
 *     # see whether we have children to deallocate
 *     if canDeallocateChildNodes(c_top):             # <<<<<<<<<<<<<< 
 *         return c_top
 *     else:
 */
__pyx_2 = __pyx_f_4lxml_5etree_canDeallocateChildNodes(__pyx_v_c_top);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":150
 *     # see whether we have children to deallocate
 *     if canDeallocateChildNodes(c_top):
 *         return c_top             # <<<<<<<<<<<<<< 
 *     else:
 *         return NULL
 */
  __pyx_r = __pyx_v_c_top;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":152
 *         return c_top
 *     else:
 *         return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef int canDeallocateChildNodes(xmlNode* c_parent):
 */
  __pyx_r = NULL;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":154
 *         return NULL
 * 
 * cdef int canDeallocateChildNodes(xmlNode* c_parent):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     c_node = c_parent.children
 */

static  int __pyx_f_4lxml_5etree_canDeallocateChildNodes(xmlNode *__pyx_v_c_parent) {
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":156
 * cdef int canDeallocateChildNodes(xmlNode* c_parent):
 *     cdef xmlNode* c_node
 *     c_node = c_parent.children             # <<<<<<<<<<<<<< 
 *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
 *     if c_node._private is not NULL:
 */
__pyx_v_c_node = __pyx_v_c_parent->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":157
 *     cdef xmlNode* c_node
 *     c_node = c_parent.children
 *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)             # <<<<<<<<<<<<<< 
 *     if c_node._private is not NULL:
 *         return 0
 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_parent,__pyx_v_c_node,1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":158
 *     c_node = c_parent.children
 *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
 *     if c_node._private is not NULL:             # <<<<<<<<<<<<<< 
 *         return 0
 *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":159
 *     tree.BEGIN_FOR_EACH_ELEMENT_FROM(c_parent, c_node, 1)
 *     if c_node._private is not NULL:
 *         return 0             # <<<<<<<<<<<<<< 
 *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *     return 1
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":160
 *     if c_node._private is not NULL:
 *         return 0
 *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)             # <<<<<<<<<<<<<< 
 *     return 1
 * 
 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":161
 *         return 0
 *     tree.END_FOR_EACH_ELEMENT_FROM(c_node)
 *     return 1             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
__pyx_r = 1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":166
 * # fix _Document references and namespaces when a node changes documents
 * 
 * cdef void _copyParentNamespaces(xmlNode* c_from_node, xmlNode* c_to_node):             # <<<<<<<<<<<<<< 
 *     """Copy the namespaces of all ancestors of c_from_node to c_to_node.
 *     """
 */

static  void __pyx_f_4lxml_5etree__copyParentNamespaces(xmlNode *__pyx_v_c_from_node,xmlNode *__pyx_v_c_to_node) {
xmlNode *__pyx_v_c_parent;
xmlNs *__pyx_v_c_ns;
xmlNs *__pyx_v_c_new_ns;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":173
 *     cdef xmlNs* c_new_ns
 *     cdef int prefix_known
 *     c_parent = c_from_node.parent             # <<<<<<<<<<<<<< 
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 */
__pyx_v_c_parent = __pyx_v_c_from_node->parent;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":174
 *     cdef int prefix_known
 *     c_parent = c_from_node.parent
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or             # <<<<<<<<<<<<<< 
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":174
 *     cdef int prefix_known
 *     c_parent = c_from_node.parent
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or             # <<<<<<<<<<<<<< 
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef
 */
  __pyx_1 = (__pyx_v_c_parent != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":174
 *     cdef int prefix_known
 *     c_parent = c_from_node.parent
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or             # <<<<<<<<<<<<<< 
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef
 */
    __pyx_1 = _isElementOrXInclude(__pyx_v_c_parent);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":175
 *     c_parent = c_from_node.parent
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):             # <<<<<<<<<<<<<< 
 *         c_new_ns = c_parent.nsDef
 *         while c_new_ns is not NULL:
 */
      __pyx_1 = (__pyx_v_c_parent->type == XML_DOCUMENT_NODE);
    }
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":176
 *     while c_parent is not NULL and (tree._isElementOrXInclude(c_parent) or
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef             # <<<<<<<<<<<<<< 
 *         while c_new_ns is not NULL:
 *             # check if prefix is already defined
 */
  __pyx_v_c_new_ns = __pyx_v_c_parent->nsDef;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":177
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef
 *         while c_new_ns is not NULL:             # <<<<<<<<<<<<<< 
 *             # check if prefix is already defined
 *             c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":177
 *                                     c_parent.type == tree.XML_DOCUMENT_NODE):
 *         c_new_ns = c_parent.nsDef
 *         while c_new_ns is not NULL:             # <<<<<<<<<<<<<< 
 *             # check if prefix is already defined
 *             c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)
 */
    __pyx_1 = (__pyx_v_c_new_ns != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":179
 *         while c_new_ns is not NULL:
 *             # check if prefix is already defined
 *             c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)             # <<<<<<<<<<<<<< 
 *             if c_ns is NULL:
 *                 tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
 */
    __pyx_v_c_ns = xmlSearchNs(__pyx_v_c_to_node->doc,__pyx_v_c_to_node,__pyx_v_c_new_ns->prefix);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":180
 *             # check if prefix is already defined
 *             c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)
 *             if c_ns is NULL:             # <<<<<<<<<<<<<< 
 *                 tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
 *             c_new_ns = c_new_ns.next
 */
    __pyx_1 = (__pyx_v_c_ns == NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":181
 *             c_ns = tree.xmlSearchNs(c_to_node.doc, c_to_node, c_new_ns.prefix)
 *             if c_ns is NULL:
 *                 tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)             # <<<<<<<<<<<<<< 
 *             c_new_ns = c_new_ns.next
 *         c_parent = c_parent.parent
 */
      xmlNewNs(__pyx_v_c_to_node,__pyx_v_c_new_ns->href,__pyx_v_c_new_ns->prefix);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":182
 *             if c_ns is NULL:
 *                 tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
 *             c_new_ns = c_new_ns.next             # <<<<<<<<<<<<<< 
 *         c_parent = c_parent.parent
 * 
 */
    __pyx_v_c_new_ns = __pyx_v_c_new_ns->next;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":183
 *                 tree.xmlNewNs(c_to_node, c_new_ns.href, c_new_ns.prefix)
 *             c_new_ns = c_new_ns.next
 *         c_parent = c_parent.parent             # <<<<<<<<<<<<<< 
 * 
 * cdef int moveNodeToDocument(_Document doc, xmlNode* c_element) except -1:
 */
  __pyx_v_c_parent = __pyx_v_c_parent->parent;
}

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":185
 *         c_parent = c_parent.parent
 * 
 * cdef int moveNodeToDocument(_Document doc, xmlNode* c_element) except -1:             # <<<<<<<<<<<<<< 
 *     """Fix the xmlNs pointers of a node and its subtree that were moved.
 * 
 */

static  int __pyx_f_4lxml_5etree_moveNodeToDocument(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_element) {
struct LxmlElement *__pyx_v_element;
xmlDoc *__pyx_v_c_doc;
xmlNode *__pyx_v_c_start_node;
xmlNode *__pyx_v_c_node;
xmlNs **__pyx_v_c_ns_new_cache;
xmlNs **__pyx_v_c_ns_old_cache;
xmlNs *__pyx_v_c_ns;
xmlNs *__pyx_v_c_new_ns;
xmlNs *__pyx_v_c_del_ns;
xmlNs *__pyx_v_c_last_del_ns;
size_t __pyx_v_i;
size_t __pyx_v_c_cache_size;
size_t __pyx_v_c_cache_last;
int __pyx_r;
int __pyx_1;
xmlNs *__pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_doc);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":203
 *     cdef cstd.size_t i, c_cache_size, c_cache_last
 * 
 *     if not tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
__pyx_1 = (!_isElementOrXInclude(__pyx_v_c_element));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":204
 * 
 *     if not tree._isElementOrXInclude(c_element):
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     c_doc = c_element.doc
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":206
 *         return 0
 * 
 *     c_doc = c_element.doc             # <<<<<<<<<<<<<< 
 *     c_start_node = c_element
 *     c_ns_new_cache = NULL
 */
__pyx_v_c_doc = __pyx_v_c_element->doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":207
 * 
 *     c_doc = c_element.doc
 *     c_start_node = c_element             # <<<<<<<<<<<<<< 
 *     c_ns_new_cache = NULL
 *     c_ns_old_cache = NULL
 */
__pyx_v_c_start_node = __pyx_v_c_element;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":208
 *     c_doc = c_element.doc
 *     c_start_node = c_element
 *     c_ns_new_cache = NULL             # <<<<<<<<<<<<<< 
 *     c_ns_old_cache = NULL
 *     c_cache_size = 0
 */
__pyx_v_c_ns_new_cache = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":209
 *     c_start_node = c_element
 *     c_ns_new_cache = NULL
 *     c_ns_old_cache = NULL             # <<<<<<<<<<<<<< 
 *     c_cache_size = 0
 *     c_cache_last = 0
 */
__pyx_v_c_ns_old_cache = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":210
 *     c_ns_new_cache = NULL
 *     c_ns_old_cache = NULL
 *     c_cache_size = 0             # <<<<<<<<<<<<<< 
 *     c_cache_last = 0
 *     c_del_ns = c_last_del_ns = NULL
 */
__pyx_v_c_cache_size = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":211
 *     c_ns_old_cache = NULL
 *     c_cache_size = 0
 *     c_cache_last = 0             # <<<<<<<<<<<<<< 
 *     c_del_ns = c_last_del_ns = NULL
 * 
 */
__pyx_v_c_cache_last = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":212
 *     c_cache_size = 0
 *     c_cache_last = 0
 *     c_del_ns = c_last_del_ns = NULL             # <<<<<<<<<<<<<< 
 * 
 *     while c_element is not NULL:
 */
__pyx_v_c_del_ns = NULL;
__pyx_v_c_last_del_ns = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":214
 *     c_del_ns = c_last_del_ns = NULL
 * 
 *     while c_element is not NULL:             # <<<<<<<<<<<<<< 
 *         # remove namespaces defined here that are known in the new ancestors
 *         if c_element.nsDef is not NULL:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":214
 *     c_del_ns = c_last_del_ns = NULL
 * 
 *     while c_element is not NULL:             # <<<<<<<<<<<<<< 
 *         # remove namespaces defined here that are known in the new ancestors
 *         if c_element.nsDef is not NULL:
 */
  __pyx_1 = (__pyx_v_c_element != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":216
 *     while c_element is not NULL:
 *         # remove namespaces defined here that are known in the new ancestors
 *         if c_element.nsDef is not NULL:             # <<<<<<<<<<<<<< 
 *             while c_element.nsDef is not NULL:
 *                 c_ns = tree.xmlSearchNsByHref(
 */
  __pyx_1 = (__pyx_v_c_element->nsDef != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":217
 *         # remove namespaces defined here that are known in the new ancestors
 *         if c_element.nsDef is not NULL:
 *             while c_element.nsDef is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_ns = tree.xmlSearchNsByHref(
 *                     c_element.doc, c_element.parent, c_element.nsDef.href)
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":217
 *         # remove namespaces defined here that are known in the new ancestors
 *         if c_element.nsDef is not NULL:
 *             while c_element.nsDef is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_ns = tree.xmlSearchNsByHref(
 *                     c_element.doc, c_element.parent, c_element.nsDef.href)
 */
      __pyx_1 = (__pyx_v_c_element->nsDef != NULL);
      if (!__pyx_1) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":219
 *             while c_element.nsDef is not NULL:
 *                 c_ns = tree.xmlSearchNsByHref(
 *                     c_element.doc, c_element.parent, c_element.nsDef.href)             # <<<<<<<<<<<<<< 
 *                 if c_ns is NULL:
 *                     break
 */
      __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_c_element->doc,__pyx_v_c_element->parent,__pyx_v_c_element->nsDef->href);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":220
 *                 c_ns = tree.xmlSearchNsByHref(
 *                     c_element.doc, c_element.parent, c_element.nsDef.href)
 *                 if c_ns is NULL:             # <<<<<<<<<<<<<< 
 *                     break
 *                 if c_del_ns is NULL:
 */
      __pyx_1 = (__pyx_v_c_ns == NULL);
      if (__pyx_1) {
        goto __pyx_L7;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":222
 *                 if c_ns is NULL:
 *                     break
 *                 if c_del_ns is NULL:             # <<<<<<<<<<<<<< 
 *                     c_del_ns = c_last_del_ns = c_element.nsDef
 *                 else:
 */
      __pyx_1 = (__pyx_v_c_del_ns == NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":223
 *                     break
 *                 if c_del_ns is NULL:
 *                     c_del_ns = c_last_del_ns = c_element.nsDef             # <<<<<<<<<<<<<< 
 *                 else:
 *                     c_last_del_ns.next = c_element.nsDef
 */
        __pyx_v_c_del_ns = __pyx_v_c_element->nsDef;
        __pyx_v_c_last_del_ns = __pyx_v_c_element->nsDef;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":225
 *                     c_del_ns = c_last_del_ns = c_element.nsDef
 *                 else:
 *                     c_last_del_ns.next = c_element.nsDef             # <<<<<<<<<<<<<< 
 *                     c_last_del_ns = c_element.nsDef
 *                 c_element.nsDef = c_element.nsDef.next
 */
        __pyx_v_c_last_del_ns->next = __pyx_v_c_element->nsDef;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":226
 *                 else:
 *                     c_last_del_ns.next = c_element.nsDef
 *                     c_last_del_ns = c_element.nsDef             # <<<<<<<<<<<<<< 
 *                 c_element.nsDef = c_element.nsDef.next
 *             if c_element.nsDef is not NULL:
 */
        __pyx_v_c_last_del_ns = __pyx_v_c_element->nsDef;
      }
      __pyx_L9:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":227
 *                     c_last_del_ns.next = c_element.nsDef
 *                     c_last_del_ns = c_element.nsDef
 *                 c_element.nsDef = c_element.nsDef.next             # <<<<<<<<<<<<<< 
 *             if c_element.nsDef is not NULL:
 *                 c_new_ns = c_element.nsDef
 */
      __pyx_v_c_element->nsDef = __pyx_v_c_element->nsDef->next;
    }
    __pyx_L7:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":228
 *                     c_last_del_ns = c_element.nsDef
 *                 c_element.nsDef = c_element.nsDef.next
 *             if c_element.nsDef is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_new_ns = c_element.nsDef
 *                 while c_new_ns.next is not NULL:
 */
    __pyx_1 = (__pyx_v_c_element->nsDef != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":229
 *                 c_element.nsDef = c_element.nsDef.next
 *             if c_element.nsDef is not NULL:
 *                 c_new_ns = c_element.nsDef             # <<<<<<<<<<<<<< 
 *                 while c_new_ns.next is not NULL:
 *                     if c_new_ns.next is not c_element.ns:
 */
      __pyx_v_c_new_ns = __pyx_v_c_element->nsDef;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":230
 *             if c_element.nsDef is not NULL:
 *                 c_new_ns = c_element.nsDef
 *                 while c_new_ns.next is not NULL:             # <<<<<<<<<<<<<< 
 *                     if c_new_ns.next is not c_element.ns:
 *                         c_ns = tree.xmlSearchNsByHref(
 */
      while (1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":230
 *             if c_element.nsDef is not NULL:
 *                 c_new_ns = c_element.nsDef
 *                 while c_new_ns.next is not NULL:             # <<<<<<<<<<<<<< 
 *                     if c_new_ns.next is not c_element.ns:
 *                         c_ns = tree.xmlSearchNsByHref(
 */
        __pyx_1 = (__pyx_v_c_new_ns->next != NULL);
        if (!__pyx_1) break;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":231
 *                 c_new_ns = c_element.nsDef
 *                 while c_new_ns.next is not NULL:
 *                     if c_new_ns.next is not c_element.ns:             # <<<<<<<<<<<<<< 
 *                         c_ns = tree.xmlSearchNsByHref(
 *                             c_element.doc, c_element.parent, c_new_ns.next.href)
 */
        __pyx_1 = (__pyx_v_c_new_ns->next != __pyx_v_c_element->ns);
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":233
 *                     if c_new_ns.next is not c_element.ns:
 *                         c_ns = tree.xmlSearchNsByHref(
 *                             c_element.doc, c_element.parent, c_new_ns.next.href)             # <<<<<<<<<<<<<< 
 *                         if c_ns is not NULL:
 *                             # already known or equal to a known definition
 */
          __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_c_element->doc,__pyx_v_c_element->parent,__pyx_v_c_new_ns->next->href);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":234
 *                         c_ns = tree.xmlSearchNsByHref(
 *                             c_element.doc, c_element.parent, c_new_ns.next.href)
 *                         if c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *                             # already known or equal to a known definition
 *                             if c_del_ns is NULL:
 */
          __pyx_1 = (__pyx_v_c_ns != NULL);
          if (__pyx_1) {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":236
 *                         if c_ns is not NULL:
 *                             # already known or equal to a known definition
 *                             if c_del_ns is NULL:             # <<<<<<<<<<<<<< 
 *                                 c_del_ns = c_last_del_ns = c_new_ns.next
 *                             else:
 */
            __pyx_1 = (__pyx_v_c_del_ns == NULL);
            if (__pyx_1) {

              /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":237
 *                             # already known or equal to a known definition
 *                             if c_del_ns is NULL:
 *                                 c_del_ns = c_last_del_ns = c_new_ns.next             # <<<<<<<<<<<<<< 
 *                             else:
 *                                 c_last_del_ns.next = c_new_ns.next
 */
              __pyx_v_c_del_ns = __pyx_v_c_new_ns->next;
              __pyx_v_c_last_del_ns = __pyx_v_c_new_ns->next;
              goto __pyx_L15;
            }
            /*else*/ {

              /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":239
 *                                 c_del_ns = c_last_del_ns = c_new_ns.next
 *                             else:
 *                                 c_last_del_ns.next = c_new_ns.next             # <<<<<<<<<<<<<< 
 *                                 c_last_del_ns = c_new_ns.next
 *                             c_new_ns.next = c_new_ns.next.next
 */
              __pyx_v_c_last_del_ns->next = __pyx_v_c_new_ns->next;

              /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":240
 *                             else:
 *                                 c_last_del_ns.next = c_new_ns.next
 *                                 c_last_del_ns = c_new_ns.next             # <<<<<<<<<<<<<< 
 *                             c_new_ns.next = c_new_ns.next.next
 *                         else:
 */
              __pyx_v_c_last_del_ns = __pyx_v_c_new_ns->next;
            }
            __pyx_L15:;

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":241
 *                                 c_last_del_ns.next = c_new_ns.next
 *                                 c_last_del_ns = c_new_ns.next
 *                             c_new_ns.next = c_new_ns.next.next             # <<<<<<<<<<<<<< 
 *                         else:
 *                             c_new_ns = c_new_ns.next
 */
            __pyx_v_c_new_ns->next = __pyx_v_c_new_ns->next->next;
            goto __pyx_L14;
          }
          /*else*/ {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":243
 *                             c_new_ns.next = c_new_ns.next.next
 *                         else:
 *                             c_new_ns = c_new_ns.next             # <<<<<<<<<<<<<< 
 *                     else:
 *                         c_new_ns = c_new_ns.next
 */
            __pyx_v_c_new_ns = __pyx_v_c_new_ns->next;
          }
          __pyx_L14:;
          goto __pyx_L13;
        }
        /*else*/ {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":245
 *                             c_new_ns = c_new_ns.next
 *                     else:
 *                         c_new_ns = c_new_ns.next             # <<<<<<<<<<<<<< 
 * 
 *         # make sure the namespace of an element and its attributes is declared
 */
          __pyx_v_c_new_ns = __pyx_v_c_new_ns->next;
        }
        __pyx_L13:;
      }
      goto __pyx_L10;
    }
    __pyx_L10:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":249
 *         # make sure the namespace of an element and its attributes is declared
 *         # in this document
 *         c_node = c_element             # <<<<<<<<<<<<<< 
 *         while c_node is not NULL:
 *             if c_node.ns is not NULL:
 */
  __pyx_v_c_node = __pyx_v_c_element;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":250
 *         # in this document
 *         c_node = c_element
 *         while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_node.ns is not NULL:
 *                 c_ns = c_node.ns
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":250
 *         # in this document
 *         c_node = c_element
 *         while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_node.ns is not NULL:
 *                 c_ns = c_node.ns
 */
    __pyx_1 = (__pyx_v_c_node != NULL);
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":251
 *         c_node = c_element
 *         while c_node is not NULL:
 *             if c_node.ns is not NULL:             # <<<<<<<<<<<<<< 
 *                 c_ns = c_node.ns
 *                 for i from 0 <= i < c_cache_last:
 */
    __pyx_1 = (__pyx_v_c_node->ns != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":252
 *         while c_node is not NULL:
 *             if c_node.ns is not NULL:
 *                 c_ns = c_node.ns             # <<<<<<<<<<<<<< 
 *                 for i from 0 <= i < c_cache_last:
 *                     if c_ns is c_ns_old_cache[i]:
 */
      __pyx_v_c_ns = __pyx_v_c_node->ns;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":253
 *             if c_node.ns is not NULL:
 *                 c_ns = c_node.ns
 *                 for i from 0 <= i < c_cache_last:             # <<<<<<<<<<<<<< 
 *                     if c_ns is c_ns_old_cache[i]:
 *                         c_node.ns = c_ns_new_cache[i]
 */
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_c_cache_last; __pyx_v_i++) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":254
 *                 c_ns = c_node.ns
 *                 for i from 0 <= i < c_cache_last:
 *                     if c_ns is c_ns_old_cache[i]:             # <<<<<<<<<<<<<< 
 *                         c_node.ns = c_ns_new_cache[i]
 *                         c_ns = NULL
 */
        __pyx_1 = (__pyx_v_c_ns == (__pyx_v_c_ns_old_cache[__pyx_v_i]));
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":255
 *                 for i from 0 <= i < c_cache_last:
 *                     if c_ns is c_ns_old_cache[i]:
 *                         c_node.ns = c_ns_new_cache[i]             # <<<<<<<<<<<<<< 
 *                         c_ns = NULL
 *                         break
 */
          __pyx_v_c_node->ns = (__pyx_v_c_ns_new_cache[__pyx_v_i]);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":256
 *                     if c_ns is c_ns_old_cache[i]:
 *                         c_node.ns = c_ns_new_cache[i]
 *                         c_ns = NULL             # <<<<<<<<<<<<<< 
 *                         break
 * 
 */
          __pyx_v_c_ns = NULL;

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":257
 *                         c_node.ns = c_ns_new_cache[i]
 *                         c_ns = NULL
 *                         break             # <<<<<<<<<<<<<< 
 * 
 *                 if c_ns is not NULL:
 */
          goto __pyx_L20;
          goto __pyx_L21;
        }
        __pyx_L21:;
      }
      __pyx_L20:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":259
 *                         break
 * 
 *                 if c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *                     # not in cache, must find a replacement from this document
 *                     c_new_ns = doc._findOrBuildNodeNs(c_element,
 */
      __pyx_1 = (__pyx_v_c_ns != NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":262
 *                     # not in cache, must find a replacement from this document
 *                     c_new_ns = doc._findOrBuildNodeNs(c_element,
 *                                                       c_ns.href, c_ns.prefix)             # <<<<<<<<<<<<<< 
 *                     if c_cache_last >= c_cache_size:
 *                         # must resize cache
 */
        __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc,__pyx_v_c_element,__pyx_v_c_ns->href,__pyx_v_c_ns->prefix); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 261; goto __pyx_L1;}
        __pyx_v_c_new_ns = __pyx_2;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":263
 *                     c_new_ns = doc._findOrBuildNodeNs(c_element,
 *                                                       c_ns.href, c_ns.prefix)
 *                     if c_cache_last >= c_cache_size:             # <<<<<<<<<<<<<< 
 *                         # must resize cache
 *                         if c_cache_size == 0:
 */
        __pyx_1 = (__pyx_v_c_cache_last >= __pyx_v_c_cache_size);
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":265
 *                     if c_cache_last >= c_cache_size:
 *                         # must resize cache
 *                         if c_cache_size == 0:             # <<<<<<<<<<<<<< 
 *                             c_cache_size = 20
 *                         else:
 */
          __pyx_1 = (__pyx_v_c_cache_size == 0);
          if (__pyx_1) {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":266
 *                         # must resize cache
 *                         if c_cache_size == 0:
 *                             c_cache_size = 20             # <<<<<<<<<<<<<< 
 *                         else:
 *                             c_cache_size = c_cache_size * 2
 */
            __pyx_v_c_cache_size = 20;
            goto __pyx_L24;
          }
          /*else*/ {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":268
 *                             c_cache_size = 20
 *                         else:
 *                             c_cache_size = c_cache_size * 2             # <<<<<<<<<<<<<< 
 *                         c_ns_new_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_new_cache, c_cache_size * sizeof(xmlNs*))
 */
            __pyx_v_c_cache_size = (__pyx_v_c_cache_size * 2);
          }
          __pyx_L24:;

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":270
 *                             c_cache_size = c_cache_size * 2
 *                         c_ns_new_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_new_cache, c_cache_size * sizeof(xmlNs*))             # <<<<<<<<<<<<<< 
 *                         if c_ns_new_cache is NULL:
 *                             python.PyMem_Free(c_ns_old_cache)
 */
          __pyx_v_c_ns_new_cache = ((xmlNs **)PyMem_Realloc(__pyx_v_c_ns_new_cache,(__pyx_v_c_cache_size * (sizeof(xmlNs *)))));

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":271
 *                         c_ns_new_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_new_cache, c_cache_size * sizeof(xmlNs*))
 *                         if c_ns_new_cache is NULL:             # <<<<<<<<<<<<<< 
 *                             python.PyMem_Free(c_ns_old_cache)
 *                             python.PyErr_NoMemory()
 */
          __pyx_1 = (__pyx_v_c_ns_new_cache == NULL);
          if (__pyx_1) {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":272
 *                             c_ns_new_cache, c_cache_size * sizeof(xmlNs*))
 *                         if c_ns_new_cache is NULL:
 *                             python.PyMem_Free(c_ns_old_cache)             # <<<<<<<<<<<<<< 
 *                             python.PyErr_NoMemory()
 *                         c_ns_old_cache = <xmlNs**> python.PyMem_Realloc(
 */
            PyMem_Free(__pyx_v_c_ns_old_cache);

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":273
 *                         if c_ns_new_cache is NULL:
 *                             python.PyMem_Free(c_ns_old_cache)
 *                             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *                         c_ns_old_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_old_cache, c_cache_size * sizeof(xmlNs*))
 */
            __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 273; goto __pyx_L1;}
            Py_DECREF(__pyx_3); __pyx_3 = 0;
            goto __pyx_L25;
          }
          __pyx_L25:;

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":275
 *                             python.PyErr_NoMemory()
 *                         c_ns_old_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_old_cache, c_cache_size * sizeof(xmlNs*))             # <<<<<<<<<<<<<< 
 *                         if c_ns_old_cache is NULL:
 *                             python.PyMem_Free(c_ns_new_cache)
 */
          __pyx_v_c_ns_old_cache = ((xmlNs **)PyMem_Realloc(__pyx_v_c_ns_old_cache,(__pyx_v_c_cache_size * (sizeof(xmlNs *)))));

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":276
 *                         c_ns_old_cache = <xmlNs**> python.PyMem_Realloc(
 *                             c_ns_old_cache, c_cache_size * sizeof(xmlNs*))
 *                         if c_ns_old_cache is NULL:             # <<<<<<<<<<<<<< 
 *                             python.PyMem_Free(c_ns_new_cache)
 *                             python.PyErr_NoMemory()
 */
          __pyx_1 = (__pyx_v_c_ns_old_cache == NULL);
          if (__pyx_1) {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":277
 *                             c_ns_old_cache, c_cache_size * sizeof(xmlNs*))
 *                         if c_ns_old_cache is NULL:
 *                             python.PyMem_Free(c_ns_new_cache)             # <<<<<<<<<<<<<< 
 *                             python.PyErr_NoMemory()
 *                     c_ns_new_cache[c_cache_last] = c_new_ns
 */
            PyMem_Free(__pyx_v_c_ns_new_cache);

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":278
 *                         if c_ns_old_cache is NULL:
 *                             python.PyMem_Free(c_ns_new_cache)
 *                             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *                     c_ns_new_cache[c_cache_last] = c_new_ns
 *                     c_ns_old_cache[c_cache_last] = c_node.ns
 */
            __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; goto __pyx_L1;}
            Py_DECREF(__pyx_3); __pyx_3 = 0;
            goto __pyx_L26;
          }
          __pyx_L26:;
          goto __pyx_L23;
        }
        __pyx_L23:;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":279
 *                             python.PyMem_Free(c_ns_new_cache)
 *                             python.PyErr_NoMemory()
 *                     c_ns_new_cache[c_cache_last] = c_new_ns             # <<<<<<<<<<<<<< 
 *                     c_ns_old_cache[c_cache_last] = c_node.ns
 *                     c_cache_last = c_cache_last + 1
 */
        (__pyx_v_c_ns_new_cache[__pyx_v_c_cache_last]) = __pyx_v_c_new_ns;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":280
 *                             python.PyErr_NoMemory()
 *                     c_ns_new_cache[c_cache_last] = c_new_ns
 *                     c_ns_old_cache[c_cache_last] = c_node.ns             # <<<<<<<<<<<<<< 
 *                     c_cache_last = c_cache_last + 1
 *                     c_node.ns = c_new_ns
 */
        (__pyx_v_c_ns_old_cache[__pyx_v_c_cache_last]) = __pyx_v_c_node->ns;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":281
 *                     c_ns_new_cache[c_cache_last] = c_new_ns
 *                     c_ns_old_cache[c_cache_last] = c_node.ns
 *                     c_cache_last = c_cache_last + 1             # <<<<<<<<<<<<<< 
 *                     c_node.ns = c_new_ns
 *             if c_node is c_element:
 */
        __pyx_v_c_cache_last = (__pyx_v_c_cache_last + 1);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":282
 *                     c_ns_old_cache[c_cache_last] = c_node.ns
 *                     c_cache_last = c_cache_last + 1
 *                     c_node.ns = c_new_ns             # <<<<<<<<<<<<<< 
 *             if c_node is c_element:
 *                 # after the element, continue with its attributes
 */
        __pyx_v_c_node->ns = __pyx_v_c_new_ns;
        goto __pyx_L22;
      }
      __pyx_L22:;
      goto __pyx_L18;
    }
    __pyx_L18:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":283
 *                     c_cache_last = c_cache_last + 1
 *                     c_node.ns = c_new_ns
 *             if c_node is c_element:             # <<<<<<<<<<<<<< 
 *                 # after the element, continue with its attributes
 *                 c_node = <xmlNode*>c_element.properties
 */
    __pyx_1 = (__pyx_v_c_node == __pyx_v_c_element);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":285
 *             if c_node is c_element:
 *                 # after the element, continue with its attributes
 *                 c_node = <xmlNode*>c_element.properties             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_node = c_node.next
 */
      __pyx_v_c_node = ((xmlNode *)__pyx_v_c_element->properties);
      goto __pyx_L27;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":287
 *                 c_node = <xmlNode*>c_element.properties
 *             else:
 *                 c_node = c_node.next             # <<<<<<<<<<<<<< 
 * 
 *         # traverse to next element, start with children
 */
      __pyx_v_c_node = __pyx_v_c_node->next;
    }
    __pyx_L27:;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":290
 * 
 *         # traverse to next element, start with children
 *         c_node = c_element.children             # <<<<<<<<<<<<<< 
 *         while c_node is not NULL and \
 *               not tree._isElementOrXInclude(c_node):
 */
  __pyx_v_c_node = __pyx_v_c_element->children;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":291
 *         # traverse to next element, start with children
 *         c_node = c_element.children
 *         while c_node is not NULL and \             # <<<<<<<<<<<<<< 
 *               not tree._isElementOrXInclude(c_node):
 *             c_node = c_node.next
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":291
 *         # traverse to next element, start with children
 *         c_node = c_element.children
 *         while c_node is not NULL and \             # <<<<<<<<<<<<<< 
 *               not tree._isElementOrXInclude(c_node):
 *             c_node = c_node.next
 */
    __pyx_1 = (__pyx_v_c_node != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":292
 *         c_node = c_element.children
 *         while c_node is not NULL and \
 *               not tree._isElementOrXInclude(c_node):             # <<<<<<<<<<<<<< 
 *             c_node = c_node.next
 * 
 */
      __pyx_1 = (!_isElementOrXInclude(__pyx_v_c_node));
    }
    if (!__pyx_1) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":293
 *         while c_node is not NULL and \
 *               not tree._isElementOrXInclude(c_node):
 *             c_node = c_node.next             # <<<<<<<<<<<<<< 
 * 
 *         if c_node is NULL:
 */
    __pyx_v_c_node = __pyx_v_c_node->next;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":295
 *             c_node = c_node.next
 * 
 *         if c_node is NULL:             # <<<<<<<<<<<<<< 
 *             # no children => back off and continue with siblings and parents
 * 
 */
  __pyx_1 = (__pyx_v_c_node == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":299
 * 
 *             # fix _Document reference (may dealloc the original document!)
 *             if c_element._private is not NULL:             # <<<<<<<<<<<<<< 
 *                 element = <_Element>c_element._private
 *                 if element._doc is not doc:
 */
    __pyx_1 = (__pyx_v_c_element->_private != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":300
 *             # fix _Document reference (may dealloc the original document!)
 *             if c_element._private is not NULL:
 *                 element = <_Element>c_element._private             # <<<<<<<<<<<<<< 
 *                 if element._doc is not doc:
 *                     python.Py_INCREF(doc)
 */
      __pyx_3 = (PyObject *)__pyx_v_c_element->_private;
      Py_INCREF(__pyx_3);
      Py_DECREF(((PyObject *)__pyx_v_element));
      __pyx_v_element = ((struct LxmlElement *)__pyx_3);
      __pyx_3 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":301
 *             if c_element._private is not NULL:
 *                 element = <_Element>c_element._private
 *                 if element._doc is not doc:             # <<<<<<<<<<<<<< 
 *                     python.Py_INCREF(doc)
 *                     python.Py_DECREF(element._doc)
 */
      __pyx_1 = (__pyx_v_element->_doc != __pyx_v_doc);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":302
 *                 element = <_Element>c_element._private
 *                 if element._doc is not doc:
 *                     python.Py_INCREF(doc)             # <<<<<<<<<<<<<< 
 *                     python.Py_DECREF(element._doc)
 *                     element._doc = doc
 */
        Py_INCREF(((PyObject *)__pyx_v_doc));

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":303
 *                 if element._doc is not doc:
 *                     python.Py_INCREF(doc)
 *                     python.Py_DECREF(element._doc)             # <<<<<<<<<<<<<< 
 *                     element._doc = doc
 *                     element._gc_doc = <python.PyObject*>doc
 */
        Py_DECREF(((PyObject *)__pyx_v_element->_doc));

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":304
 *                     python.Py_INCREF(doc)
 *                     python.Py_DECREF(element._doc)
 *                     element._doc = doc             # <<<<<<<<<<<<<< 
 *                     element._gc_doc = <python.PyObject*>doc
 * 
 */
        Py_INCREF(((PyObject *)__pyx_v_doc));
        Py_DECREF(((PyObject *)__pyx_v_element->_doc));
        __pyx_v_element->_doc = __pyx_v_doc;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":305
 *                     python.Py_DECREF(element._doc)
 *                     element._doc = doc
 *                     element._gc_doc = <python.PyObject*>doc             # <<<<<<<<<<<<<< 
 * 
 *             if c_element is c_start_node:
 */
        __pyx_v_element->_gc_doc = ((PyObject *)__pyx_v_doc);
        goto __pyx_L32;
      }
      __pyx_L32:;
      goto __pyx_L31;
    }
    __pyx_L31:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":307
 *                     element._gc_doc = <python.PyObject*>doc
 * 
 *             if c_element is c_start_node:             # <<<<<<<<<<<<<< 
 *                 break
 * 
 */
    __pyx_1 = (__pyx_v_c_element == __pyx_v_c_start_node);
    if (__pyx_1) {
      goto __pyx_L4;
      goto __pyx_L33;
    }
    __pyx_L33:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":311
 * 
 *             # continue with siblings
 *             c_node = c_element.next             # <<<<<<<<<<<<<< 
 *             while (c_node is not NULL and
 *                    not tree._isElementOrXInclude(c_node)):
 */
    __pyx_v_c_node = __pyx_v_c_element->next;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":312
 *             # continue with siblings
 *             c_node = c_element.next
 *             while (c_node is not NULL and             # <<<<<<<<<<<<<< 
 *                    not tree._isElementOrXInclude(c_node)):
 *                 c_node = c_node.next
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":312
 *             # continue with siblings
 *             c_node = c_element.next
 *             while (c_node is not NULL and             # <<<<<<<<<<<<<< 
 *                    not tree._isElementOrXInclude(c_node)):
 *                 c_node = c_node.next
 */
      __pyx_1 = (__pyx_v_c_node != NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":313
 *             c_node = c_element.next
 *             while (c_node is not NULL and
 *                    not tree._isElementOrXInclude(c_node)):             # <<<<<<<<<<<<<< 
 *                 c_node = c_node.next
 *             # if that didn't help, back off through parents' siblings
 */
        __pyx_1 = (!_isElementOrXInclude(__pyx_v_c_node));
      }
      if (!__pyx_1) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":314
 *             while (c_node is not NULL and
 *                    not tree._isElementOrXInclude(c_node)):
 *                 c_node = c_node.next             # <<<<<<<<<<<<<< 
 *             # if that didn't help, back off through parents' siblings
 *             while c_node is NULL:
 */
      __pyx_v_c_node = __pyx_v_c_node->next;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":316
 *                 c_node = c_node.next
 *             # if that didn't help, back off through parents' siblings
 *             while c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 c_element = c_element.parent
 *                 if c_element is NULL or not tree._isElementOrXInclude(c_element):
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":316
 *                 c_node = c_node.next
 *             # if that didn't help, back off through parents' siblings
 *             while c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 c_element = c_element.parent
 *                 if c_element is NULL or not tree._isElementOrXInclude(c_element):
 */
      __pyx_1 = (__pyx_v_c_node == NULL);
      if (!__pyx_1) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":317
 *             # if that didn't help, back off through parents' siblings
 *             while c_node is NULL:
 *                 c_element = c_element.parent             # <<<<<<<<<<<<<< 
 *                 if c_element is NULL or not tree._isElementOrXInclude(c_element):
 *                     break
 */
      __pyx_v_c_element = __pyx_v_c_element->parent;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":318
 *             while c_node is NULL:
 *                 c_element = c_element.parent
 *                 if c_element is NULL or not tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<< 
 *                     break
 * 
 */
      __pyx_1 = (__pyx_v_c_element == NULL);
      if (!__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":318
 *             while c_node is NULL:
 *                 c_element = c_element.parent
 *                 if c_element is NULL or not tree._isElementOrXInclude(c_element):             # <<<<<<<<<<<<<< 
 *                     break
 * 
 */
        __pyx_1 = (!_isElementOrXInclude(__pyx_v_c_element));
      }
      if (__pyx_1) {
        goto __pyx_L37;
        goto __pyx_L38;
      }
      __pyx_L38:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":322
 * 
 *                 # fix _Document reference (may dealloc the original document!)
 *                 if c_element._private is not NULL:             # <<<<<<<<<<<<<< 
 *                     element = <_Element>c_element._private
 *                     if element._doc is not doc:
 */
      __pyx_1 = (__pyx_v_c_element->_private != NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":323
 *                 # fix _Document reference (may dealloc the original document!)
 *                 if c_element._private is not NULL:
 *                     element = <_Element>c_element._private             # <<<<<<<<<<<<<< 
 *                     if element._doc is not doc:
 *                         python.Py_INCREF(doc)
 */
        __pyx_3 = (PyObject *)__pyx_v_c_element->_private;
        Py_INCREF(__pyx_3);
        Py_DECREF(((PyObject *)__pyx_v_element));
        __pyx_v_element = ((struct LxmlElement *)__pyx_3);
        __pyx_3 = 0;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":324
 *                 if c_element._private is not NULL:
 *                     element = <_Element>c_element._private
 *                     if element._doc is not doc:             # <<<<<<<<<<<<<< 
 *                         python.Py_INCREF(doc)
 *                         python.Py_DECREF(element._doc)
 */
        __pyx_1 = (__pyx_v_element->_doc != __pyx_v_doc);
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":325
 *                     element = <_Element>c_element._private
 *                     if element._doc is not doc:
 *                         python.Py_INCREF(doc)             # <<<<<<<<<<<<<< 
 *                         python.Py_DECREF(element._doc)
 *                         element._doc = doc
 */
          Py_INCREF(((PyObject *)__pyx_v_doc));

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":326
 *                     if element._doc is not doc:
 *                         python.Py_INCREF(doc)
 *                         python.Py_DECREF(element._doc)             # <<<<<<<<<<<<<< 
 *                         element._doc = doc
 *                         element._gc_doc = <python.PyObject*>doc
 */
          Py_DECREF(((PyObject *)__pyx_v_element->_doc));

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":327
 *                         python.Py_INCREF(doc)
 *                         python.Py_DECREF(element._doc)
 *                         element._doc = doc             # <<<<<<<<<<<<<< 
 *                         element._gc_doc = <python.PyObject*>doc
 * 
 */
          Py_INCREF(((PyObject *)__pyx_v_doc));
          Py_DECREF(((PyObject *)__pyx_v_element->_doc));
          __pyx_v_element->_doc = __pyx_v_doc;

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":328
 *                         python.Py_DECREF(element._doc)
 *                         element._doc = doc
 *                         element._gc_doc = <python.PyObject*>doc             # <<<<<<<<<<<<<< 
 * 
 *                 if c_element is c_start_node:
 */
          __pyx_v_element->_gc_doc = ((PyObject *)__pyx_v_doc);
          goto __pyx_L40;
        }
        __pyx_L40:;
        goto __pyx_L39;
      }
      __pyx_L39:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":330
 *                         element._gc_doc = <python.PyObject*>doc
 * 
 *                 if c_element is c_start_node:             # <<<<<<<<<<<<<< 
 *                     break
 *                 # parents already done -> look for their siblings
 */
      __pyx_1 = (__pyx_v_c_element == __pyx_v_c_start_node);
      if (__pyx_1) {
        goto __pyx_L37;
        goto __pyx_L41;
      }
      __pyx_L41:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":333
 *                     break
 *                 # parents already done -> look for their siblings
 *                 c_node = c_element.next             # <<<<<<<<<<<<<< 
 *                 while (c_node is not NULL and
 *                        not tree._isElementOrXInclude(c_node)):
 */
      __pyx_v_c_node = __pyx_v_c_element->next;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":334
 *                 # parents already done -> look for their siblings
 *                 c_node = c_element.next
 *                 while (c_node is not NULL and             # <<<<<<<<<<<<<< 
 *                        not tree._isElementOrXInclude(c_node)):
 *                     c_node = c_node.next
 */
      while (1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":334
 *                 # parents already done -> look for their siblings
 *                 c_node = c_element.next
 *                 while (c_node is not NULL and             # <<<<<<<<<<<<<< 
 *                        not tree._isElementOrXInclude(c_node)):
 *                     c_node = c_node.next
 */
        __pyx_1 = (__pyx_v_c_node != NULL);
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":335
 *                 c_node = c_element.next
 *                 while (c_node is not NULL and
 *                        not tree._isElementOrXInclude(c_node)):             # <<<<<<<<<<<<<< 
 *                     c_node = c_node.next
 *         if c_node is c_start_node:
 */
          __pyx_1 = (!_isElementOrXInclude(__pyx_v_c_node));
        }
        if (!__pyx_1) break;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":336
 *                 while (c_node is not NULL and
 *                        not tree._isElementOrXInclude(c_node)):
 *                     c_node = c_node.next             # <<<<<<<<<<<<<< 
 *         if c_node is c_start_node:
 *             break
 */
        __pyx_v_c_node = __pyx_v_c_node->next;
      }
    }
    __pyx_L37:;
    goto __pyx_L30;
  }
  __pyx_L30:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":337
 *                        not tree._isElementOrXInclude(c_node)):
 *                     c_node = c_node.next
 *         if c_node is c_start_node:             # <<<<<<<<<<<<<< 
 *             break
 *         c_element = c_node
 */
  __pyx_1 = (__pyx_v_c_node == __pyx_v_c_start_node);
  if (__pyx_1) {
    goto __pyx_L4;
    goto __pyx_L44;
  }
  __pyx_L44:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":339
 *         if c_node is c_start_node:
 *             break
 *         c_element = c_node             # <<<<<<<<<<<<<< 
 * 
 *     # free now unused namespace declarations
 */
  __pyx_v_c_element = __pyx_v_c_node;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":342
 * 
 *     # free now unused namespace declarations
 *     if c_del_ns is not NULL:             # <<<<<<<<<<<<<< 
 *         c_last_del_ns.next = NULL
 *         tree.xmlFreeNsList(c_del_ns)
 */
__pyx_1 = (__pyx_v_c_del_ns != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":343
 *     # free now unused namespace declarations
 *     if c_del_ns is not NULL:
 *         c_last_del_ns.next = NULL             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeNsList(c_del_ns)
 * 
 */
  __pyx_v_c_last_del_ns->next = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":344
 *     if c_del_ns is not NULL:
 *         c_last_del_ns.next = NULL
 *         tree.xmlFreeNsList(c_del_ns)             # <<<<<<<<<<<<<< 
 * 
 *     # cleanup
 */
  xmlFreeNsList(__pyx_v_c_del_ns);
  goto __pyx_L45;
}
__pyx_L45:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":347
 * 
 *     # cleanup
 *     if c_ns_new_cache is not NULL:             # <<<<<<<<<<<<<< 
 *         python.PyMem_Free(c_ns_new_cache)
 *     if c_ns_old_cache is not NULL:
 */
__pyx_1 = (__pyx_v_c_ns_new_cache != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":348
 *     # cleanup
 *     if c_ns_new_cache is not NULL:
 *         python.PyMem_Free(c_ns_new_cache)             # <<<<<<<<<<<<<< 
 *     if c_ns_old_cache is not NULL:
 *         python.PyMem_Free(c_ns_old_cache)
 */
  PyMem_Free(__pyx_v_c_ns_new_cache);
  goto __pyx_L46;
}
__pyx_L46:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":349
 *     if c_ns_new_cache is not NULL:
 *         python.PyMem_Free(c_ns_new_cache)
 *     if c_ns_old_cache is not NULL:             # <<<<<<<<<<<<<< 
 *         python.PyMem_Free(c_ns_old_cache)
 * 
 */
__pyx_1 = (__pyx_v_c_ns_old_cache != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":350
 *         python.PyMem_Free(c_ns_new_cache)
 *     if c_ns_old_cache is not NULL:
 *         python.PyMem_Free(c_ns_old_cache)             # <<<<<<<<<<<<<< 
 * 
 *     return 0
 */
  PyMem_Free(__pyx_v_c_ns_old_cache);
  goto __pyx_L47;
}
__pyx_L47:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/proxy.pxi":352
 *         python.PyMem_Free(c_ns_old_cache)
 * 
 *     return 0             # <<<<<<<<<<<<<< 
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.moveNodeToDocument");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":3
 * # Private/public helper functions for API functions
 * 
 * cdef void displayNode(xmlNode* c_node, indent):             # <<<<<<<<<<<<<< 
 *     # to help with debugging
 *     cdef xmlNode* c_child
 */

static PyObject *__pyx_num_1;

static PyObject *__pyx_k410p;

static char __pyx_k410[] = " ";

static  void __pyx_f_4lxml_5etree_displayNode(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_indent) {
xmlNode *__pyx_v_c_child;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_indent);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":6
 *     # to help with debugging
 *     cdef xmlNode* c_child
 *     print indent * ' ', <long>c_node             # <<<<<<<<<<<<<< 
 *     c_child = c_node.children
 *     while c_child is not NULL:
 */
__pyx_1 = PyNumber_Multiply(__pyx_v_indent, __pyx_k410p); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":6
 *     # to help with debugging
 *     cdef xmlNode* c_child
 *     print indent * ' ', <long>c_node             # <<<<<<<<<<<<<< 
 *     c_child = c_node.children
 *     while c_child is not NULL:
 */
__pyx_1 = PyInt_FromLong(((long)__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
if (__Pyx_PrintItem(__pyx_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 6; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":7
 *     cdef xmlNode* c_child
 *     print indent * ' ', <long>c_node
 *     c_child = c_node.children             # <<<<<<<<<<<<<< 
 *     while c_child is not NULL:
 *         displayNode(c_child, indent + 1)
 */
__pyx_v_c_child = __pyx_v_c_node->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":8
 *     print indent * ' ', <long>c_node
 *     c_child = c_node.children
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         displayNode(c_child, indent + 1)
 *         c_child = c_child.next
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":8
 *     print indent * ' ', <long>c_node
 *     c_child = c_node.children
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         displayNode(c_child, indent + 1)
 *         c_child = c_child.next
 */
  __pyx_2 = (__pyx_v_c_child != NULL);
  if (!__pyx_2) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":9
 *     c_child = c_node.children
 *     while c_child is not NULL:
 *         displayNode(c_child, indent + 1)             # <<<<<<<<<<<<<< 
 *         c_child = c_child.next
 * 
 */
  __pyx_1 = PyNumber_Add(__pyx_v_indent, __pyx_num_1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
  __pyx_f_4lxml_5etree_displayNode(__pyx_v_c_child,__pyx_1);
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":10
 *     while c_child is not NULL:
 *         displayNode(c_child, indent + 1)
 *         c_child = c_child.next             # <<<<<<<<<<<<<< 
 * 
 * cdef _Document _documentOrRaise(object input):
 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree.displayNode");
__pyx_L0:;
Py_DECREF(__pyx_v_indent);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":12
 *         c_child = c_child.next
 * 
 * cdef _Document _documentOrRaise(object input):             # <<<<<<<<<<<<<< 
 *     """Call this to get the document of a _Document, _ElementTree or _Element
 *     object, or to raise an exception if it can't be determined.
 */

static PyObject *__pyx_k411p;
static PyObject *__pyx_k412p;

static char __pyx_k411[] = "Invalid input object: %s";
static char __pyx_k412[] = "Input object has no document: %s";

static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentOrRaise(PyObject *__pyx_v_input) {
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_element;
struct LxmlDocument *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_input);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":20
 *     cdef _Document doc
 *     cdef _Element element
 *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<< 
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 20; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":21
 *     cdef _Element element
 *     if isinstance(input, _ElementTree):
 *         element = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<< 
 *         if element is not None:
 *             doc = element._doc
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":22
 *     if isinstance(input, _ElementTree):
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:             # <<<<<<<<<<<<<< 
 *             doc = element._doc
 *     elif isinstance(input, _Element):
 */
  __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":23
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:
 *             doc = element._doc             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Element):
 *         doc = (<_Element>input)._doc
 */
    Py_INCREF(((PyObject *)__pyx_v_element->_doc));
    Py_DECREF(((PyObject *)__pyx_v_doc));
    __pyx_v_doc = __pyx_v_element->_doc;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":24
 *         if element is not None:
 *             doc = element._doc
 *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<< 
 *         doc = (<_Element>input)._doc
 *     elif isinstance(input, _Document):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 24; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":25
 *             doc = element._doc
 *     elif isinstance(input, _Element):
 *         doc = (<_Element>input)._doc             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Document):
 *         doc = <_Document>input
 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)->_doc));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlElement *)__pyx_v_input)->_doc;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":26
 *     elif isinstance(input, _Element):
 *         doc = (<_Element>input)._doc
 *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<< 
 *         doc = <_Document>input
 *     else:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Document)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 26; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":27
 *         doc = (<_Element>input)._doc
 *     elif isinstance(input, _Document):
 *         doc = <_Document>input             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)
 */
  Py_INCREF(((PyObject *)((struct LxmlDocument *)__pyx_v_input)));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_v_input);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":29
 *         doc = <_Document>input
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)             # <<<<<<<<<<<<<< 
 *     if doc is None:
 *         raise ValueError, "Input object has no document: %s" % type(input)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_input);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyNumber_Remainder(__pyx_k411p, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_2, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":30
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)
 *     if doc is None:             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Input object has no document: %s" % type(input)
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_doc) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":31
 *         raise TypeError, "Invalid input object: %s" % type(input)
 *     if doc is None:
 *         raise ValueError, "Input object has no document: %s" % type(input)             # <<<<<<<<<<<<<< 
 *     else:
 *         return doc
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_input);
  __pyx_2 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k412p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":33
 *         raise ValueError, "Input object has no document: %s" % type(input)
 *     else:
 *         return doc             # <<<<<<<<<<<<<< 
 * 
 * cdef _Element _rootNodeOrRaise(object input):
 */
  Py_INCREF(((PyObject *)__pyx_v_doc));
  __pyx_r = __pyx_v_doc;
  goto __pyx_L0;
}
__pyx_L4:;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._documentOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":35
 *         return doc
 * 
 * cdef _Element _rootNodeOrRaise(object input):             # <<<<<<<<<<<<<< 
 *     """Call this to get the root node of a _Document, _ElementTree or
 *      _Element object, or to raise an exception if it can't be determined.
 */

static PyObject *__pyx_k413p;
static PyObject *__pyx_k414p;

static char __pyx_k413[] = "Invalid input object: %s";
static char __pyx_k414[] = "Input object has no element: %s";

static  struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOrRaise(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_v_node;
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_input);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":42
 *      """
 *     cdef _Element node
 *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<< 
 *         node = (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 42; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":43
 *     cdef _Element node
 *     if isinstance(input, _ElementTree):
 *         node = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Element):
 *         node = <_Element>input
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":44
 *     if isinstance(input, _ElementTree):
 *         node = (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<< 
 *         node = <_Element>input
 *     elif isinstance(input, _Document):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 44; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":45
 *         node = (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):
 *         node = <_Element>input             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Document):
 *         node = (<_Document>input).getroot()
 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)));
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_v_input);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":46
 *     elif isinstance(input, _Element):
 *         node = <_Element>input
 *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<< 
 *         node = (<_Document>input).getroot()
 *     else:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Document)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 46; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":47
 *         node = <_Element>input
 *     elif isinstance(input, _Document):
 *         node = (<_Document>input).getroot()             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":49
 *         node = (<_Document>input).getroot()
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)             # <<<<<<<<<<<<<< 
 *     if node is None:
 *         raise ValueError, "Input object has no element: %s" % type(input)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_input);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyNumber_Remainder(__pyx_k413p, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_2, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":50
 *     else:
 *         raise TypeError, "Invalid input object: %s" % type(input)
 *     if node is None:             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Input object has no element: %s" % type(input)
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_node) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":51
 *         raise TypeError, "Invalid input object: %s" % type(input)
 *     if node is None:
 *         raise ValueError, "Input object has no element: %s" % type(input)             # <<<<<<<<<<<<<< 
 *     else:
 *         return node
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_input);
  __pyx_2 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k414p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":53
 *         raise ValueError, "Input object has no element: %s" % type(input)
 *     else:
 *         return node             # <<<<<<<<<<<<<< 
 * 
 * cdef _Document _documentOf(object input):
 */
  Py_INCREF(((PyObject *)__pyx_v_node));
  __pyx_r = __pyx_v_node;
  goto __pyx_L0;
}
__pyx_L3:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._rootNodeOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":55
 *         return node
 * 
 * cdef _Document _documentOf(object input):             # <<<<<<<<<<<<<< 
 *     # call this to get the document of a
 *     # _Document, _ElementTree or _Element object
 */

static  struct LxmlDocument *__pyx_f_4lxml_5etree__documentOf(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_v_element;
struct LxmlDocument *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_input);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":60
 *     # may return None!
 *     cdef _Element element
 *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<< 
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 60; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":61
 *     cdef _Element element
 *     if isinstance(input, _ElementTree):
 *         element = (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<< 
 *         if element is not None:
 *             return element._doc
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":62
 *     if isinstance(input, _ElementTree):
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:             # <<<<<<<<<<<<<< 
 *             return element._doc
 *     elif isinstance(input, _Element):
 */
  __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":63
 *         element = (<_ElementTree>input)._context_node
 *         if element is not None:
 *             return element._doc             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Element):
 *         return (<_Element>input)._doc
 */
    Py_INCREF(((PyObject *)__pyx_v_element->_doc));
    __pyx_r = __pyx_v_element->_doc;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":64
 *         if element is not None:
 *             return element._doc
 *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<< 
 *         return (<_Element>input)._doc
 *     elif isinstance(input, _Document):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":65
 *             return element._doc
 *     elif isinstance(input, _Element):
 *         return (<_Element>input)._doc             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Document):
 *         return <_Document>input
 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)->_doc));
  __pyx_r = ((struct LxmlElement *)__pyx_v_input)->_doc;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":66
 *     elif isinstance(input, _Element):
 *         return (<_Element>input)._doc
 *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<< 
 *         return <_Document>input
 *     return None
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Document)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":67
 *         return (<_Element>input)._doc
 *     elif isinstance(input, _Document):
 *         return <_Document>input             # <<<<<<<<<<<<<< 
 *     return None
 * 
 */
  Py_INCREF(((PyObject *)((struct LxmlDocument *)__pyx_v_input)));
  __pyx_r = ((struct LxmlDocument *)__pyx_v_input);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":68
 *     elif isinstance(input, _Document):
 *         return <_Document>input
 *     return None             # <<<<<<<<<<<<<< 
 * 
 * cdef _Element _rootNodeOf(object input):
 */
Py_INCREF(Py_None);
__pyx_r = ((struct LxmlDocument *)Py_None);
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._documentOf");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":70
 *     return None
 * 
 * cdef _Element _rootNodeOf(object input):             # <<<<<<<<<<<<<< 
 *     # call this to get the root node of a
 *     # _Document, _ElementTree or _Element object
 */

static  struct LxmlElement *__pyx_f_4lxml_5etree__rootNodeOf(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":74
 *     # _Document, _ElementTree or _Element object
 *     # may return None!
 *     if isinstance(input, _ElementTree):             # <<<<<<<<<<<<<< 
 *         return (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":75
 *     # may return None!
 *     if isinstance(input, _ElementTree):
 *         return (<_ElementTree>input)._context_node             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Element):
 *         return <_Element>input
 */
  Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_input)->_context_node));
  __pyx_r = ((struct LxmlElementTree *)__pyx_v_input)->_context_node;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":76
 *     if isinstance(input, _ElementTree):
 *         return (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):             # <<<<<<<<<<<<<< 
 *         return <_Element>input
 *     elif isinstance(input, _Document):
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":77
 *         return (<_ElementTree>input)._context_node
 *     elif isinstance(input, _Element):
 *         return <_Element>input             # <<<<<<<<<<<<<< 
 *     elif isinstance(input, _Document):
 *         return (<_Document>input).getroot()
 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)));
  __pyx_r = ((struct LxmlElement *)__pyx_v_input);
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":78
 *     elif isinstance(input, _Element):
 *         return <_Element>input
 *     elif isinstance(input, _Document):             # <<<<<<<<<<<<<< 
 *         return (<_Document>input).getroot()
 *     else:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_input,((PyObject*)__pyx_ptype_4lxml_5etree__Document)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":79
 *         return <_Element>input
 *     elif isinstance(input, _Document):
 *         return (<_Document>input).getroot()             # <<<<<<<<<<<<<< 
 *     else:
 *         return None
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; goto __pyx_L1;}
  __pyx_r = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":81
 *         return (<_Document>input).getroot()
 *     else:
 *         return None             # <<<<<<<<<<<<<< 
 * 
 * cdef _Element _makeElement(tag, xmlDoc* c_doc, _Document doc,
 */
  Py_INCREF(Py_None);
  __pyx_r = ((struct LxmlElement *)Py_None);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._rootNodeOf");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":83
 *         return None
 * 
 * cdef _Element _makeElement(tag, xmlDoc* c_doc, _Document doc,             # <<<<<<<<<<<<<< 
 *                            _BaseParser parser, text, tail, attrib, nsmap,
 *                            extra_attrs):
 */

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) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_name_utf;
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
xmlDoc *__pyx_6;
xmlNode *__pyx_7;
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_tail);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);
Py_INCREF(__pyx_v_extra_attrs);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":101
 *     """
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":101
 *     """
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":101
 *     """
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":101
 *     """
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":101
 *     """
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":102
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)
 *     if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 */
__pyx_4 = (((PyObject *)__pyx_v_parser) != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":102
 *     cdef xmlNode* c_node
 *     ns_utf, name_utf = _getNsTag(tag)
 *     if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 */
  __pyx_4 = __pyx_v_parser->_for_html;
}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":103
 *     ns_utf, name_utf = _getNsTag(tag)
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)             # <<<<<<<<<<<<<< 
 *     else:
 *         _tagValidOrRaise(name_utf)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 103; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":105
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 *         _tagValidOrRaise(name_utf)             # <<<<<<<<<<<<<< 
 *     if doc is not None:
 *         c_doc = doc._c_doc
 */
  __pyx_5 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 105; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":106
 *     else:
 *         _tagValidOrRaise(name_utf)
 *     if doc is not None:             # <<<<<<<<<<<<<< 
 *         c_doc = doc._c_doc
 *     elif c_doc is NULL:
 */
__pyx_4 = (((PyObject *)__pyx_v_doc) != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":107
 *         _tagValidOrRaise(name_utf)
 *     if doc is not None:
 *         c_doc = doc._c_doc             # <<<<<<<<<<<<<< 
 *     elif c_doc is NULL:
 *         c_doc = _newDoc()
 */
  __pyx_v_c_doc = __pyx_v_doc->_c_doc;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":108
 *     if doc is not None:
 *         c_doc = doc._c_doc
 *     elif c_doc is NULL:             # <<<<<<<<<<<<<< 
 *         c_doc = _newDoc()
 *     c_node = _createElement(c_doc, name_utf)
 */
__pyx_4 = (__pyx_v_c_doc == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":109
 *         c_doc = doc._c_doc
 *     elif c_doc is NULL:
 *         c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *     c_node = _createElement(c_doc, name_utf)
 *     if c_node is NULL:
 */
  __pyx_6 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_v_c_doc = __pyx_6;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":110
 *     elif c_doc is NULL:
 *         c_doc = _newDoc()
 *     c_node = _createElement(c_doc, name_utf)             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return python.PyErr_NoMemory()
 */
__pyx_7 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc,__pyx_v_name_utf); if (unlikely(__pyx_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; goto __pyx_L1;}
__pyx_v_c_node = __pyx_7;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":111
 *         c_doc = _newDoc()
 *     c_node = _createElement(c_doc, name_utf)
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return python.PyErr_NoMemory()
 *     try:
 */
__pyx_4 = (__pyx_v_c_node == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":112
 *     c_node = _createElement(c_doc, name_utf)
 *     if c_node is NULL:
 *         return python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     try:
 *         if text is not None:
 */
  __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_r = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":113
 *     if c_node is NULL:
 *         return python.PyErr_NoMemory()
 *     try:             # <<<<<<<<<<<<<< 
 *         if text is not None:
 *             _setNodeText(c_node, text)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":114
 *         return python.PyErr_NoMemory()
 *     try:
 *         if text is not None:             # <<<<<<<<<<<<<< 
 *             _setNodeText(c_node, text)
 *         if tail is not None:
 */
  __pyx_4 = (__pyx_v_text != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":115
 *     try:
 *         if text is not None:
 *             _setNodeText(c_node, text)             # <<<<<<<<<<<<<< 
 *         if tail is not None:
 *             _setTailText(c_node, tail)
 */
    __pyx_5 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node,__pyx_v_text); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 115; goto __pyx_L5;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":116
 *         if text is not None:
 *             _setNodeText(c_node, text)
 *         if tail is not None:             # <<<<<<<<<<<<<< 
 *             _setTailText(c_node, tail)
 *         if doc is None:
 */
  __pyx_4 = (__pyx_v_tail != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":117
 *             _setNodeText(c_node, text)
 *         if tail is not None:
 *             _setTailText(c_node, tail)             # <<<<<<<<<<<<<< 
 *         if doc is None:
 *             tree.xmlDocSetRootElement(c_doc, c_node)
 */
    __pyx_5 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node,__pyx_v_tail); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; goto __pyx_L5;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":118
 *         if tail is not None:
 *             _setTailText(c_node, tail)
 *         if doc is None:             # <<<<<<<<<<<<<< 
 *             tree.xmlDocSetRootElement(c_doc, c_node)
 *             doc = _documentFactory(c_doc, parser)
 */
  __pyx_4 = (((PyObject *)__pyx_v_doc) == Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":119
 *             _setTailText(c_node, tail)
 *         if doc is None:
 *             tree.xmlDocSetRootElement(c_doc, c_node)             # <<<<<<<<<<<<<< 
 *             doc = _documentFactory(c_doc, parser)
 *         # add namespaces to node if necessary
 */
    xmlDocSetRootElement(__pyx_v_c_doc,__pyx_v_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":120
 *         if doc is None:
 *             tree.xmlDocSetRootElement(c_doc, c_node)
 *             doc = _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 *         # add namespaces to node if necessary
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)
 */
    __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; goto __pyx_L5;}
    Py_DECREF(((PyObject *)__pyx_v_doc));
    __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":122
 *             doc = _documentFactory(c_doc, parser)
 *         # add namespaces to node if necessary
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)             # <<<<<<<<<<<<<< 
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)
 */
  __pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNamespaces(__pyx_v_doc,__pyx_v_c_node,__pyx_v_ns_utf,__pyx_v_nsmap); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 122; goto __pyx_L5;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":123
 *         # add namespaces to node if necessary
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)             # <<<<<<<<<<<<<< 
 *         return _elementFactory(doc, c_node)
 *     except:
 */
  __pyx_2 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node,__pyx_v_doc,__pyx_v_attrib,__pyx_v_extra_attrs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 123; goto __pyx_L5;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":124
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 *     except:
 *         # free allocated c_node/c_doc unless Python does it for us
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; goto __pyx_L5;}
  __pyx_r = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L0;
}
goto __pyx_L6;
__pyx_L5:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":125
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)
 *     except:             # <<<<<<<<<<<<<< 
 *         # free allocated c_node/c_doc unless Python does it for us
 *         if c_node.doc is not c_doc:
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._makeElement");
  if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 125; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":127
 *     except:
 *         # free allocated c_node/c_doc unless Python does it for us
 *         if c_node.doc is not c_doc:             # <<<<<<<<<<<<<< 
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:
 */
  __pyx_4 = (__pyx_v_c_node->doc != __pyx_v_c_doc);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":129
 *         if c_node.doc is not c_doc:
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:             # <<<<<<<<<<<<<< 
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)
 */
    __pyx_4 = (__pyx_v_tail != Py_None);
    if (__pyx_4) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":130
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:
 *                 _removeText(c_node.next) # tail             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeNode(c_node)
 *         if doc is None:
 */
      __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":131
 *             if tail is not None:
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<< 
 *         if doc is None:
 *             # c_doc will not be freed by doc
 */
    xmlFreeNode(__pyx_v_c_node);
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":132
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)
 *         if doc is None:             # <<<<<<<<<<<<<< 
 *             # c_doc will not be freed by doc
 *             tree.xmlFreeDoc(c_doc)
 */
  __pyx_4 = (((PyObject *)__pyx_v_doc) == Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":134
 *         if doc is None:
 *             # c_doc will not be freed by doc
 *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<< 
 *         raise
 * 
 */
    xmlFreeDoc(__pyx_v_c_doc);
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":135
 *             # c_doc will not be freed by doc
 *             tree.xmlFreeDoc(c_doc)
 *         raise             # <<<<<<<<<<<<<< 
 * 
 * cdef _Element _makeSubElement(_Element parent, tag, text, tail,
 */
  __Pyx_Raise(__pyx_1, __pyx_2, __pyx_3);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 135; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._makeElement");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_tail);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_DECREF(__pyx_v_extra_attrs);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":137
 *         raise
 * 
 * cdef _Element _makeSubElement(_Element parent, tag, text, tail,             # <<<<<<<<<<<<<< 
 *                               attrib, nsmap, extra_attrs):
 *     """Create a new child element and initialize text content, namespaces and
 */

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) {
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
struct LxmlDocument *__pyx_v_doc;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_name_utf;
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
xmlNode *__pyx_6;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_tail);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);
Py_INCREF(__pyx_v_extra_attrs);
__pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":157
 *     cdef xmlNode* c_node
 *     cdef xmlDoc* c_doc
 *     if parent is None or parent._doc is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)
 */
__pyx_1 = (((PyObject *)__pyx_v_parent) == Py_None);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":157
 *     cdef xmlNode* c_node
 *     cdef xmlDoc* c_doc
 *     if parent is None or parent._doc is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)
 */
  __pyx_1 = (((PyObject *)__pyx_v_parent->_doc) == Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":158
 *     cdef xmlDoc* c_doc
 *     if parent is None or parent._doc is None:
 *         return None             # <<<<<<<<<<<<<< 
 *     ns_utf, name_utf = _getNsTag(tag)
 *     doc = parent._doc
 */
  Py_INCREF(Py_None);
  __pyx_r = ((struct LxmlElement *)Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":159
 *     if parent is None or parent._doc is None:
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     doc = parent._doc
 *     c_doc = doc._c_doc
 */
__pyx_2 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":159
 *     if parent is None or parent._doc is None:
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     doc = parent._doc
 *     c_doc = doc._c_doc
 */
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 1);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":159
 *     if parent is None or parent._doc is None:
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     doc = parent._doc
 *     c_doc = doc._c_doc
 */
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_4;
  __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
else {
  __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":159
 *     if parent is None or parent._doc is None:
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     doc = parent._doc
 *     c_doc = doc._c_doc
 */
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":159
 *     if parent is None or parent._doc is None:
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *     doc = parent._doc
 *     c_doc = doc._c_doc
 */
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_4;
  __pyx_4 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 159; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":160
 *         return None
 *     ns_utf, name_utf = _getNsTag(tag)
 *     doc = parent._doc             # <<<<<<<<<<<<<< 
 *     c_doc = doc._c_doc
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_parent->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v_parent->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":161
 *     ns_utf, name_utf = _getNsTag(tag)
 *     doc = parent._doc
 *     c_doc = doc._c_doc             # <<<<<<<<<<<<<< 
 * 
 *     parser = doc._parser
 */
__pyx_v_c_doc = __pyx_v_doc->_c_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":163
 *     c_doc = doc._c_doc
 * 
 *     parser = doc._parser             # <<<<<<<<<<<<<< 
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)
 */
Py_INCREF(((PyObject *)__pyx_v_doc->_parser));
Py_DECREF(((PyObject *)__pyx_v_parser));
__pyx_v_parser = __pyx_v_doc->_parser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":164
 * 
 *     parser = doc._parser
 *     if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":164
 * 
 *     parser = doc._parser
 *     if parser is not None and parser._for_html:             # <<<<<<<<<<<<<< 
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 */
  __pyx_1 = __pyx_v_parser->_for_html;
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":165
 *     parser = doc._parser
 *     if parser is not None and parser._for_html:
 *         _htmlTagValidOrRaise(name_utf)             # <<<<<<<<<<<<<< 
 *     else:
 *         _tagValidOrRaise(name_utf)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__htmlTagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":167
 *         _htmlTagValidOrRaise(name_utf)
 *     else:
 *         _tagValidOrRaise(name_utf)             # <<<<<<<<<<<<<< 
 * 
 *     c_node = _createElement(c_doc, name_utf)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__tagValidOrRaise(__pyx_v_name_utf); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; goto __pyx_L1;}
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":169
 *         _tagValidOrRaise(name_utf)
 * 
 *     c_node = _createElement(c_doc, name_utf)             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()
 */
__pyx_6 = __pyx_f_4lxml_5etree__createElement(__pyx_v_c_doc,__pyx_v_name_utf); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 169; goto __pyx_L1;}
__pyx_v_c_node = __pyx_6;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":170
 * 
 *     c_node = _createElement(c_doc, name_utf)
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     tree.xmlAddChild(parent._c_node, c_node)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":171
 *     c_node = _createElement(c_doc, name_utf)
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     tree.xmlAddChild(parent._c_node, c_node)
 * 
 */
  __pyx_4 = PyErr_NoMemory(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 171; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":172
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()
 *     tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     try:
 */
xmlAddChild(__pyx_v_parent->_c_node,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":174
 *     tree.xmlAddChild(parent._c_node, c_node)
 * 
 *     try:             # <<<<<<<<<<<<<< 
 *         if text is not None:
 *             _setNodeText(c_node, text)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":175
 * 
 *     try:
 *         if text is not None:             # <<<<<<<<<<<<<< 
 *             _setNodeText(c_node, text)
 *         if tail is not None:
 */
  __pyx_1 = (__pyx_v_text != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":176
 *     try:
 *         if text is not None:
 *             _setNodeText(c_node, text)             # <<<<<<<<<<<<<< 
 *         if tail is not None:
 *             _setTailText(c_node, tail)
 */
    __pyx_5 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node,__pyx_v_text); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 176; goto __pyx_L5;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":177
 *         if text is not None:
 *             _setNodeText(c_node, text)
 *         if tail is not None:             # <<<<<<<<<<<<<< 
 *             _setTailText(c_node, tail)
 * 
 */
  __pyx_1 = (__pyx_v_tail != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":178
 *             _setNodeText(c_node, text)
 *         if tail is not None:
 *             _setTailText(c_node, tail)             # <<<<<<<<<<<<<< 
 * 
 *         # add namespaces to node if necessary
 */
    __pyx_5 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node,__pyx_v_tail); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; goto __pyx_L5;}
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":181
 * 
 *         # add namespaces to node if necessary
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)             # <<<<<<<<<<<<<< 
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)
 */
  __pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNamespaces(__pyx_v_doc,__pyx_v_c_node,__pyx_v_ns_utf,__pyx_v_nsmap); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 181; goto __pyx_L5;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":182
 *         # add namespaces to node if necessary
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)             # <<<<<<<<<<<<<< 
 *         return _elementFactory(doc, c_node)
 *     except:
 */
  __pyx_2 = __pyx_f_4lxml_5etree__initNodeAttributes(__pyx_v_c_node,__pyx_v_doc,__pyx_v_attrib,__pyx_v_extra_attrs); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L5;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":183
 *         doc._setNodeNamespaces(c_node, ns_utf, nsmap)
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 *     except:
 *         # free allocated c_node/c_doc unless Python does it for us
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 183; goto __pyx_L5;}
  __pyx_r = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L0;
}
goto __pyx_L6;
__pyx_L5:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":184
 *         _initNodeAttributes(c_node, doc, attrib, extra_attrs)
 *         return _elementFactory(doc, c_node)
 *     except:             # <<<<<<<<<<<<<< 
 *         # free allocated c_node/c_doc unless Python does it for us
 *         if c_node.doc is not c_doc:
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._makeSubElement");
  if (__Pyx_GetException(&__pyx_4, &__pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 184; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":186
 *     except:
 *         # free allocated c_node/c_doc unless Python does it for us
 *         if c_node.doc is not c_doc:             # <<<<<<<<<<<<<< 
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:
 */
  __pyx_1 = (__pyx_v_c_node->doc != __pyx_v_c_doc);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":188
 *         if c_node.doc is not c_doc:
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:             # <<<<<<<<<<<<<< 
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)
 */
    __pyx_1 = (__pyx_v_tail != Py_None);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":189
 *             # node not yet in document => will not be freed by document
 *             if tail is not None:
 *                 _removeText(c_node.next) # tail             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeNode(c_node)
 *         raise
 */
      __pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":190
 *             if tail is not None:
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<< 
 *         raise
 * 
 */
    xmlFreeNode(__pyx_v_c_node);
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":191
 *                 _removeText(c_node.next) # tail
 *             tree.xmlFreeNode(c_node)
 *         raise             # <<<<<<<<<<<<<< 
 * 
 * cdef _initNodeAttributes(xmlNode* c_node, _Document doc, attrib, extra):
 */
  __Pyx_Raise(__pyx_4, __pyx_2, __pyx_3);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._makeSubElement");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_tail);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_DECREF(__pyx_v_extra_attrs);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":193
 *         raise
 * 
 * cdef _initNodeAttributes(xmlNode* c_node, _Document doc, attrib, extra):             # <<<<<<<<<<<<<< 
 *     """Initialise the attributes of an element node.
 *     """
 */

static PyObject *__pyx_k416p;

static char __pyx_k416[] = "Invalid attribute dictionary: %s";

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) {
int __pyx_v_is_html;
xmlNs *__pyx_v_c_ns;
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
PyObject *__pyx_v_attr_ns_utf;
PyObject *__pyx_v_attr_name_utf;
PyObject *__pyx_v_value_utf;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
PyObject *__pyx_7 = 0;
int __pyx_8;
xmlNs *__pyx_9;
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_extra);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_attr_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_attr_name_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_value_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":199
 *     cdef xmlNs* c_ns
 *     # 'extra' is not checked here (expected to be a keyword dict)
 *     if attrib is not None and not hasattr(attrib, 'items'):             # <<<<<<<<<<<<<< 
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)
 *     if extra is not None and extra:
 */
__pyx_1 = (__pyx_v_attrib != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":199
 *     cdef xmlNs* c_ns
 *     # 'extra' is not checked here (expected to be a keyword dict)
 *     if attrib is not None and not hasattr(attrib, 'items'):             # <<<<<<<<<<<<<< 
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)
 *     if extra is not None and extra:
 */
  __pyx_2 = PyObject_HasAttr(__pyx_v_attrib,__pyx_n_items); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
  __pyx_1 = (!__pyx_2);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":200
 *     # 'extra' is not checked here (expected to be a keyword dict)
 *     if attrib is not None and not hasattr(attrib, 'items'):
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)             # <<<<<<<<<<<<<< 
 *     if extra is not None and extra:
 *         if attrib is None:
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; goto __pyx_L1;}
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_attrib);
  __pyx_4 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k416p, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 200; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":201
 *     if attrib is not None and not hasattr(attrib, 'items'):
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)
 *     if extra is not None and extra:             # <<<<<<<<<<<<<< 
 *         if attrib is None:
 *             attrib = extra
 */
__pyx_2 = (__pyx_v_extra != Py_None);
__pyx_4 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; goto __pyx_L1;}
if (__pyx_1) {
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":201
 *     if attrib is not None and not hasattr(attrib, 'items'):
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)
 *     if extra is not None and extra:             # <<<<<<<<<<<<<< 
 *         if attrib is None:
 *             attrib = extra
 */
  __pyx_4 = __pyx_v_extra;
  Py_INCREF(__pyx_4);
}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":202
 *         raise TypeError, "Invalid attribute dictionary: %s" % type(attrib)
 *     if extra is not None and extra:
 *         if attrib is None:             # <<<<<<<<<<<<<< 
 *             attrib = extra
 *         else:
 */
  __pyx_1 = (__pyx_v_attrib == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":203
 *     if extra is not None and extra:
 *         if attrib is None:
 *             attrib = extra             # <<<<<<<<<<<<<< 
 *         else:
 *             attrib.update(extra)
 */
    Py_INCREF(__pyx_v_extra);
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_v_extra;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":205
 *             attrib = extra
 *         else:
 *             attrib.update(extra)             # <<<<<<<<<<<<<< 
 *     if attrib:
 *         is_html = doc._parser._for_html
 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_attrib, __pyx_n_update); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":205
 *             attrib = extra
 *         else:
 *             attrib.update(extra)             # <<<<<<<<<<<<<< 
 *     if attrib:
 *         is_html = doc._parser._for_html
 */
    __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; goto __pyx_L1;}
    Py_INCREF(__pyx_v_extra);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_extra);
    __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 205; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":206
 *         else:
 *             attrib.update(extra)
 *     if attrib:             # <<<<<<<<<<<<<< 
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_attrib); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 206; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":207
 *             attrib.update(extra)
 *     if attrib:
 *         is_html = doc._parser._for_html             # <<<<<<<<<<<<<< 
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 */
  __pyx_v_is_html = __pyx_v_doc->_parser->_for_html;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_attrib, __pyx_n_items); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (PyList_CheckExact(__pyx_4)) { __pyx_6 = 0; __pyx_5 = __pyx_4; Py_INCREF(__pyx_5); }
  else { __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;} }
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
    if (PyList_CheckExact(__pyx_5)) { if (__pyx_6 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_3 = PyList_GET_ITEM(__pyx_5, __pyx_6++); Py_INCREF(__pyx_3); }
    else {
      __pyx_3 = PyIter_Next(__pyx_5);
      if (!__pyx_3) {
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
      __pyx_7 = PyTuple_GET_ITEM(__pyx_3, 0);
      Py_INCREF(__pyx_7);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_7;
      __pyx_7 = 0;
      __pyx_7 = PyTuple_GET_ITEM(__pyx_3, 1);
      Py_INCREF(__pyx_7);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
      Py_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_7;
      __pyx_7 = 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
    }
    else {
      __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_7 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_7;
      __pyx_7 = 0;
      __pyx_7 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":208
 *     if attrib:
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():             # <<<<<<<<<<<<<< 
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 */
      Py_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_7;
      __pyx_7 = 0;
      if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 208; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":209
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<< 
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 */
    __pyx_7 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_name); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; goto __pyx_L1;}
    if (PyTuple_CheckExact(__pyx_7) && PyTuple_GET_SIZE(__pyx_7) == 2) {
      __pyx_4 = PyTuple_GET_ITEM(__pyx_7, 0);
      Py_INCREF(__pyx_4);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":209
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<< 
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 */
      Py_DECREF(__pyx_v_attr_ns_utf);
      __pyx_v_attr_ns_utf = __pyx_4;
      __pyx_4 = 0;
      __pyx_4 = PyTuple_GET_ITEM(__pyx_7, 1);
      Py_INCREF(__pyx_4);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":209
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<< 
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 */
      Py_DECREF(__pyx_v_attr_name_utf);
      __pyx_v_attr_name_utf = __pyx_4;
      __pyx_4 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
    }
    else {
      __pyx_3 = PyObject_GetIter(__pyx_7); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":209
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<< 
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 */
      Py_DECREF(__pyx_v_attr_ns_utf);
      __pyx_v_attr_ns_utf = __pyx_4;
      __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":209
 *         is_html = doc._parser._for_html
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)             # <<<<<<<<<<<<<< 
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 */
      Py_DECREF(__pyx_v_attr_name_utf);
      __pyx_v_attr_name_utf = __pyx_4;
      __pyx_4 = 0;
      if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 209; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":210
 *         for name, value in attrib.items():
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:             # <<<<<<<<<<<<<< 
 *                 _attributeValidOrRaise(attr_name_utf)
 *             value_utf = _utf8(value)
 */
    __pyx_1 = (!__pyx_v_is_html);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":211
 *             attr_ns_utf, attr_name_utf = _getNsTag(name)
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)             # <<<<<<<<<<<<<< 
 *             value_utf = _utf8(value)
 *             if attr_ns_utf is None:
 */
      __pyx_8 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_attr_name_utf); if (unlikely(__pyx_8 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 211; goto __pyx_L1;}
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":212
 *             if not is_html:
 *                 _attributeValidOrRaise(attr_name_utf)
 *             value_utf = _utf8(value)             # <<<<<<<<<<<<<< 
 *             if attr_ns_utf is None:
 *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
 */
    __pyx_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 212; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value_utf);
    __pyx_v_value_utf = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":213
 *                 _attributeValidOrRaise(attr_name_utf)
 *             value_utf = _utf8(value)
 *             if attr_ns_utf is None:             # <<<<<<<<<<<<<< 
 *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
 *             else:
 */
    __pyx_2 = (__pyx_v_attr_ns_utf == Py_None);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":214
 *             value_utf = _utf8(value)
 *             if attr_ns_utf is None:
 *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)
 */
      xmlNewProp(__pyx_v_c_node,_cstr(__pyx_v_attr_name_utf),_cstr(__pyx_v_value_utf));
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":216
 *                 tree.xmlNewProp(c_node, _cstr(attr_name_utf), _cstr(value_utf))
 *             else:
 *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)             # <<<<<<<<<<<<<< 
 *                 tree.xmlNewNsProp(c_node, c_ns,
 *                                   _cstr(attr_name_utf), _cstr(value_utf))
 */
      __pyx_9 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc,__pyx_v_c_node,_cstr(__pyx_v_attr_ns_utf),NULL); if (unlikely(__pyx_9 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 216; goto __pyx_L1;}
      __pyx_v_c_ns = __pyx_9;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":218
 *                 c_ns = doc._findOrBuildNodeNs(c_node, _cstr(attr_ns_utf), NULL)
 *                 tree.xmlNewNsProp(c_node, c_ns,
 *                                   _cstr(attr_name_utf), _cstr(value_utf))             # <<<<<<<<<<<<<< 
 * 
 * cdef object _attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
 */
      xmlNewNsProp(__pyx_v_c_node,__pyx_v_c_ns,_cstr(__pyx_v_attr_name_utf),_cstr(__pyx_v_value_utf));
    }
    __pyx_L9:;
  }
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree._initNodeAttributes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_attr_ns_utf);
Py_DECREF(__pyx_v_attr_name_utf);
Py_DECREF(__pyx_v_value_utf);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_extra);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":220
 *                                   _cstr(attr_name_utf), _cstr(value_utf))
 * 
 * cdef object _attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):             # <<<<<<<<<<<<<< 
 *     cdef char* value
 *     cdef char* href
 */

static  PyObject *__pyx_f_4lxml_5etree__attributeValue(xmlNode *__pyx_v_c_element,xmlAttr *__pyx_v_c_attrib_node) {
char *__pyx_v_value;
char *__pyx_v_href;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":223
 *     cdef char* value
 *     cdef char* href
 *     href = _getNs(<xmlNode*>c_attrib_node)             # <<<<<<<<<<<<<< 
 *     if href is NULL:
 *         value = tree.xmlGetNoNsProp(c_element, c_attrib_node.name)
 */
__pyx_v_href = _getNs(((xmlNode *)__pyx_v_c_attrib_node));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":224
 *     cdef char* href
 *     href = _getNs(<xmlNode*>c_attrib_node)
 *     if href is NULL:             # <<<<<<<<<<<<<< 
 *         value = tree.xmlGetNoNsProp(c_element, c_attrib_node.name)
 *     else:
 */
__pyx_1 = (__pyx_v_href == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":225
 *     href = _getNs(<xmlNode*>c_attrib_node)
 *     if href is NULL:
 *         value = tree.xmlGetNoNsProp(c_element, c_attrib_node.name)             # <<<<<<<<<<<<<< 
 *     else:
 *         value = tree.xmlGetNsProp(c_element, c_attrib_node.name, href)
 */
  __pyx_v_value = xmlGetNoNsProp(__pyx_v_c_element,__pyx_v_c_attrib_node->name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":227
 *         value = tree.xmlGetNoNsProp(c_element, c_attrib_node.name)
 *     else:
 *         value = tree.xmlGetNsProp(c_element, c_attrib_node.name, href)             # <<<<<<<<<<<<<< 
 *     result = funicode(value)
 *     tree.xmlFree(value)
 */
  __pyx_v_value = xmlGetNsProp(__pyx_v_c_element,__pyx_v_c_attrib_node->name,__pyx_v_href);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":228
 *     else:
 *         value = tree.xmlGetNsProp(c_element, c_attrib_node.name, href)
 *     result = funicode(value)             # <<<<<<<<<<<<<< 
 *     tree.xmlFree(value)
 *     return result
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_value); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 228; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":229
 *         value = tree.xmlGetNsProp(c_element, c_attrib_node.name, href)
 *     result = funicode(value)
 *     tree.xmlFree(value)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
xmlFree(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":230
 *     result = funicode(value)
 *     tree.xmlFree(value)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef object _attributeValueFromNsName(xmlNode* c_element,
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._attributeValue");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":232
 *     return result
 * 
 * cdef object _attributeValueFromNsName(xmlNode* c_element,             # <<<<<<<<<<<<<< 
 *                                       char* c_href, char* c_name):
 *     cdef char* c_result
 */

static  PyObject *__pyx_f_4lxml_5etree__attributeValueFromNsName(xmlNode *__pyx_v_c_element,char *__pyx_v_c_href,char *__pyx_v_c_name) {
char *__pyx_v_c_result;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":235
 *                                       char* c_href, char* c_name):
 *     cdef char* c_result
 *     if c_href is NULL:             # <<<<<<<<<<<<<< 
 *         c_result = tree.xmlGetNoNsProp(c_element, c_name)
 *     else:
 */
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":236
 *     cdef char* c_result
 *     if c_href is NULL:
 *         c_result = tree.xmlGetNoNsProp(c_element, c_name)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_c_element,__pyx_v_c_name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":238
 *         c_result = tree.xmlGetNoNsProp(c_element, c_name)
 *     else:
 *         c_result = tree.xmlGetNsProp(c_element, c_name, c_href)             # <<<<<<<<<<<<<< 
 *     if c_result is NULL:
 *         return None
 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_element,__pyx_v_c_name,__pyx_v_c_href);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":239
 *     else:
 *         c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
 *     if c_result is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     result = funicode(c_result)
 */
__pyx_1 = (__pyx_v_c_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":240
 *         c_result = tree.xmlGetNsProp(c_element, c_name, c_href)
 *     if c_result is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":241
 *     if c_result is NULL:
 *         return None
 *     result = funicode(c_result)             # <<<<<<<<<<<<<< 
 *     tree.xmlFree(c_result)
 *     return result
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 241; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":242
 *         return None
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
xmlFree(__pyx_v_c_result);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":243
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef object _getAttributeValue(_Element element, key, default):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._attributeValueFromNsName");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":245
 *     return result
 * 
 * cdef object _getAttributeValue(_Element element, key, default):             # <<<<<<<<<<<<<< 
 *     cdef char* c_result
 *     cdef char* c_tag
 */

static  PyObject *__pyx_f_4lxml_5etree__getAttributeValue(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key,PyObject *__pyx_v_default) {
char *__pyx_v_c_result;
char *__pyx_v_c_tag;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_tag;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":248
 *     cdef char* c_result
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if ns is None:
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":248
 *     cdef char* c_result
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if ns is None:
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":248
 *     cdef char* c_result
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if ns is None:
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":248
 *     cdef char* c_result
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if ns is None:
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":248
 *     cdef char* c_result
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if ns is None:
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":249
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)
 *     c_tag = _cstr(tag)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_result = tree.xmlGetNoNsProp(element._c_node, c_tag)
 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":250
 *     ns, tag = _getNsTag(key)
 *     c_tag = _cstr(tag)
 *     if ns is None:             # <<<<<<<<<<<<<< 
 *         c_result = tree.xmlGetNoNsProp(element._c_node, c_tag)
 *     else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":251
 *     c_tag = _cstr(tag)
 *     if ns is None:
 *         c_result = tree.xmlGetNoNsProp(element._c_node, c_tag)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_result = tree.xmlGetNsProp(element._c_node, c_tag, _cstr(ns))
 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_element->_c_node,__pyx_v_c_tag);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":253
 *         c_result = tree.xmlGetNoNsProp(element._c_node, c_tag)
 *     else:
 *         c_result = tree.xmlGetNsProp(element._c_node, c_tag, _cstr(ns))             # <<<<<<<<<<<<<< 
 *     if c_result is NULL:
 *         # XXX free namespace that is not in use..?
 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_element->_c_node,__pyx_v_c_tag,_cstr(__pyx_v_ns));
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":254
 *     else:
 *         c_result = tree.xmlGetNsProp(element._c_node, c_tag, _cstr(ns))
 *     if c_result is NULL:             # <<<<<<<<<<<<<< 
 *         # XXX free namespace that is not in use..?
 *         return default
 */
__pyx_4 = (__pyx_v_c_result == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":256
 *     if c_result is NULL:
 *         # XXX free namespace that is not in use..?
 *         return default             # <<<<<<<<<<<<<< 
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)
 */
  Py_INCREF(__pyx_v_default);
  __pyx_r = __pyx_v_default;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":257
 *         # XXX free namespace that is not in use..?
 *         return default
 *     result = funicode(c_result)             # <<<<<<<<<<<<<< 
 *     tree.xmlFree(c_result)
 *     return result
 */
__pyx_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_result); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":258
 *         return default
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
xmlFree(__pyx_v_c_result);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":259
 *     result = funicode(c_result)
 *     tree.xmlFree(c_result)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef int _setAttributeValue(_Element element, key, value) except -1:
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._getAttributeValue");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":261
 *     return result
 * 
 * cdef int _setAttributeValue(_Element element, key, value) except -1:             # <<<<<<<<<<<<<< 
 *     cdef xmlNs* c_ns
 *     cdef char* c_value
 */

static  int __pyx_f_4lxml_5etree__setAttributeValue(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key,PyObject *__pyx_v_value) {
xmlNs *__pyx_v_c_ns;
char *__pyx_v_c_value;
char *__pyx_v_c_tag;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_tag;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
xmlNs *__pyx_6;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":265
 *     cdef char* c_value
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":265
 *     cdef char* c_value
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":265
 *     cdef char* c_value
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":265
 *     cdef char* c_value
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":265
 *     cdef char* c_value
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 265; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":266
 *     cdef char* c_tag
 *     ns, tag = _getNsTag(key)
 *     if not element._doc._parser._for_html:             # <<<<<<<<<<<<<< 
 *         _attributeValidOrRaise(tag)
 *     c_tag = _cstr(tag)
 */
__pyx_4 = (!__pyx_v_element->_doc->_parser->_for_html);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":267
 *     ns, tag = _getNsTag(key)
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if isinstance(value, QName):
 */
  __pyx_5 = __pyx_f_4lxml_5etree__attributeValidOrRaise(__pyx_v_tag); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 267; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":268
 *     if not element._doc._parser._for_html:
 *         _attributeValidOrRaise(tag)
 *     c_tag = _cstr(tag)             # <<<<<<<<<<<<<< 
 *     if isinstance(value, QName):
 *         value = _resolveQNameText(element, value)
 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":269
 *         _attributeValidOrRaise(tag)
 *     c_tag = _cstr(tag)
 *     if isinstance(value, QName):             # <<<<<<<<<<<<<< 
 *         value = _resolveQNameText(element, value)
 *     else:
 */
__pyx_4 = PyObject_IsInstance(__pyx_v_value,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 269; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":270
 *     c_tag = _cstr(tag)
 *     if isinstance(value, QName):
 *         value = _resolveQNameText(element, value)             # <<<<<<<<<<<<<< 
 *     else:
 *         value = _utf8(value)
 */
  __pyx_3 = __pyx_f_4lxml_5etree__resolveQNameText(__pyx_v_element,__pyx_v_value); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 270; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":272
 *         value = _resolveQNameText(element, value)
 *     else:
 *         value = _utf8(value)             # <<<<<<<<<<<<<< 
 *     c_value = _cstr(value)
 *     if ns is None:
 */
  __pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 272; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":273
 *     else:
 *         value = _utf8(value)
 *     c_value = _cstr(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         tree.xmlSetProp(element._c_node, c_tag, c_value)
 */
__pyx_v_c_value = _cstr(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":274
 *         value = _utf8(value)
 *     c_value = _cstr(value)
 *     if ns is None:             # <<<<<<<<<<<<<< 
 *         tree.xmlSetProp(element._c_node, c_tag, c_value)
 *     else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":275
 *     c_value = _cstr(value)
 *     if ns is None:
 *         tree.xmlSetProp(element._c_node, c_tag, c_value)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
 */
  xmlSetProp(__pyx_v_element->_c_node,__pyx_v_c_tag,__pyx_v_c_value);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":278
 *     else:
 *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
 *                                                _cstr(ns), NULL)             # <<<<<<<<<<<<<< 
 *         tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)
 *     return 0
 */
  __pyx_6 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_element->_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_element->_doc,__pyx_v_element->_c_node,_cstr(__pyx_v_ns),NULL); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; goto __pyx_L1;}
  __pyx_v_c_ns = __pyx_6;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":279
 *         c_ns = element._doc._findOrBuildNodeNs(element._c_node,
 *                                                _cstr(ns), NULL)
 *         tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  xmlSetNsProp(__pyx_v_element->_c_node,__pyx_v_c_ns,__pyx_v_c_tag,__pyx_v_c_value);
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":280
 *                                                _cstr(ns), NULL)
 *         tree.xmlSetNsProp(element._c_node, c_ns, c_tag, c_value)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _delAttribute(_Element element, key) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._setAttributeValue");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":282
 *     return 0
 * 
 * cdef int _delAttribute(_Element element, key) except -1:             # <<<<<<<<<<<<<< 
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 */

static  int __pyx_f_4lxml_5etree__delAttribute(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key) {
char *__pyx_v_c_href;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_tag;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":285
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_href = NULL
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_key); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":285
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_href = NULL
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":285
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_href = NULL
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":285
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_href = NULL
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":285
 *     cdef xmlAttr* c_attr
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         c_href = NULL
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 285; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":286
 *     cdef char* c_href
 *     ns, tag = _getNsTag(key)
 *     if ns is None:             # <<<<<<<<<<<<<< 
 *         c_href = NULL
 *     else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":287
 *     ns, tag = _getNsTag(key)
 *     if ns is None:
 *         c_href = NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         c_href = _cstr(ns)
 */
  __pyx_v_c_href = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":289
 *         c_href = NULL
 *     else:
 *         c_href = _cstr(ns)             # <<<<<<<<<<<<<< 
 *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
 *         raise KeyError, key
 */
  __pyx_v_c_href = _cstr(__pyx_v_ns);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":290
 *     else:
 *         c_href = _cstr(ns)
 *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):             # <<<<<<<<<<<<<< 
 *         raise KeyError, key
 *     return 0
 */
__pyx_5 = __pyx_f_4lxml_5etree__delAttributeFromNsName(__pyx_v_element->_c_node,__pyx_v_c_href,_cstr(__pyx_v_tag));
if (__pyx_5) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":291
 *         c_href = _cstr(ns)
 *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
 *         raise KeyError, key             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_v_key, 0);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 291; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":292
 *     if _delAttributeFromNsName(element._c_node, c_href, _cstr(tag)):
 *         raise KeyError, key
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._delAttribute");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":294
 *     return 0
 * 
 * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<< 
 *     cdef xmlAttr* c_attr
 *     if c_href is NULL:
 */

static  int __pyx_f_4lxml_5etree__delAttributeFromNsName(xmlNode *__pyx_v_c_node,char *__pyx_v_c_href,char *__pyx_v_c_name) {
xmlAttr *__pyx_v_c_attr;
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":296
 * cdef int _delAttributeFromNsName(xmlNode* c_node, char* c_href, char* c_name):
 *     cdef xmlAttr* c_attr
 *     if c_href is NULL:             # <<<<<<<<<<<<<< 
 *         c_attr = tree.xmlHasProp(c_node, c_name)
 *     else:
 */
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":297
 *     cdef xmlAttr* c_attr
 *     if c_href is NULL:
 *         c_attr = tree.xmlHasProp(c_node, c_name)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)
 */
  __pyx_v_c_attr = xmlHasProp(__pyx_v_c_node,__pyx_v_c_name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":299
 *         c_attr = tree.xmlHasProp(c_node, c_name)
 *     else:
 *         c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)             # <<<<<<<<<<<<<< 
 *     if c_attr is NULL:
 *         # XXX free namespace that is not in use..?
 */
  __pyx_v_c_attr = xmlHasNsProp(__pyx_v_c_node,__pyx_v_c_name,__pyx_v_c_href);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":300
 *     else:
 *         c_attr = tree.xmlHasNsProp(c_node, c_name, c_href)
 *     if c_attr is NULL:             # <<<<<<<<<<<<<< 
 *         # XXX free namespace that is not in use..?
 *         return -1
 */
__pyx_1 = (__pyx_v_c_attr == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":302
 *     if c_attr is NULL:
 *         # XXX free namespace that is not in use..?
 *         return -1             # <<<<<<<<<<<<<< 
 *     tree.xmlRemoveProp(c_attr)
 *     return 0
 */
  __pyx_r = -1;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":303
 *         # XXX free namespace that is not in use..?
 *         return -1
 *     tree.xmlRemoveProp(c_attr)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
xmlRemoveProp(__pyx_v_c_attr);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":304
 *         return -1
 *     tree.xmlRemoveProp(c_attr)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef object _collectAttributes(xmlNode* c_node, int collecttype):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":306
 *     return 0
 * 
 * cdef object _collectAttributes(xmlNode* c_node, int collecttype):             # <<<<<<<<<<<<<< 
 *     """Collect all attributes of a node in a list.  Depending on collecttype,
 *     it collects either the name (1), the value (2) or the name-value tuples.
 */

static  PyObject *__pyx_f_4lxml_5etree__collectAttributes(xmlNode *__pyx_v_c_node,int __pyx_v_collecttype) {
Py_ssize_t __pyx_v_count;
xmlAttr *__pyx_v_c_attr;
PyObject *__pyx_v_attributes;
PyObject *__pyx_v_item;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
__pyx_v_attributes = Py_None; Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":312
 *     cdef Py_ssize_t count
 *     cdef xmlAttr* c_attr
 *     c_attr = c_node.properties             # <<<<<<<<<<<<<< 
 *     count = 0
 *     while c_attr is not NULL:
 */
__pyx_v_c_attr = __pyx_v_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":313
 *     cdef xmlAttr* c_attr
 *     c_attr = c_node.properties
 *     count = 0             # <<<<<<<<<<<<<< 
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 */
__pyx_v_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":314
 *     c_attr = c_node.properties
 *     count = 0
 *     while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             count = count + 1
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":314
 *     c_attr = c_node.properties
 *     count = 0
 *     while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             count = count + 1
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":315
 *     count = 0
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             count = count + 1
 *         c_attr = c_attr.next
 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":316
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             count = count + 1             # <<<<<<<<<<<<<< 
 *         c_attr = c_attr.next
 * 
 */
    __pyx_v_count = (__pyx_v_count + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":317
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             count = count + 1
 *         c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 * 
 *     if count == 0:
 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":319
 *         c_attr = c_attr.next
 * 
 *     if count == 0:             # <<<<<<<<<<<<<< 
 *         return []
 * 
 */
__pyx_1 = (__pyx_v_count == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":320
 * 
 *     if count == 0:
 *         return []             # <<<<<<<<<<<<<< 
 * 
 *     attributes = python.PyList_New(count)
 */
  __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":322
 *         return []
 * 
 *     attributes = python.PyList_New(count)             # <<<<<<<<<<<<<< 
 *     c_attr = c_node.properties
 *     count = 0
 */
__pyx_2 = PyList_New(__pyx_v_count); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 322; goto __pyx_L1;}
Py_DECREF(__pyx_v_attributes);
__pyx_v_attributes = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":323
 * 
 *     attributes = python.PyList_New(count)
 *     c_attr = c_node.properties             # <<<<<<<<<<<<<< 
 *     count = 0
 *     while c_attr is not NULL:
 */
__pyx_v_c_attr = __pyx_v_c_node->properties;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":324
 *     attributes = python.PyList_New(count)
 *     c_attr = c_node.properties
 *     count = 0             # <<<<<<<<<<<<<< 
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 */
__pyx_v_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":325
 *     c_attr = c_node.properties
 *     count = 0
 *     while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             if collecttype == 1:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":325
 *     c_attr = c_node.properties
 *     count = 0
 *     while c_attr is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             if collecttype == 1:
 */
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":326
 *     count = 0
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             if collecttype == 1:
 *                 item = _namespacedName(<xmlNode*>c_attr)
 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":327
 *     while c_attr is not NULL:
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             if collecttype == 1:             # <<<<<<<<<<<<<< 
 *                 item = _namespacedName(<xmlNode*>c_attr)
 *             elif collecttype == 2:
 */
    __pyx_1 = (__pyx_v_collecttype == 1);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":328
 *         if c_attr.type == tree.XML_ATTRIBUTE_NODE:
 *             if collecttype == 1:
 *                 item = _namespacedName(<xmlNode*>c_attr)             # <<<<<<<<<<<<<< 
 *             elif collecttype == 2:
 *                 item = _attributeValue(c_node, c_attr)
 */
      __pyx_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 328; goto __pyx_L1;}
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L9;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":329
 *             if collecttype == 1:
 *                 item = _namespacedName(<xmlNode*>c_attr)
 *             elif collecttype == 2:             # <<<<<<<<<<<<<< 
 *                 item = _attributeValue(c_node, c_attr)
 *             else:
 */
    __pyx_1 = (__pyx_v_collecttype == 2);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":330
 *                 item = _namespacedName(<xmlNode*>c_attr)
 *             elif collecttype == 2:
 *                 item = _attributeValue(c_node, c_attr)             # <<<<<<<<<<<<<< 
 *             else:
 *                 item = (_namespacedName(<xmlNode*>c_attr),
 */
      __pyx_2 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node,__pyx_v_c_attr); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 330; goto __pyx_L1;}
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":332
 *                 item = _attributeValue(c_node, c_attr)
 *             else:
 *                 item = (_namespacedName(<xmlNode*>c_attr),             # <<<<<<<<<<<<<< 
 *                         _attributeValue(c_node, c_attr))
 * 
 */
      __pyx_2 = __pyx_f_4lxml_5etree__namespacedName(((xmlNode *)__pyx_v_c_attr)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":333
 *             else:
 *                 item = (_namespacedName(<xmlNode*>c_attr),
 *                         _attributeValue(c_node, c_attr))             # <<<<<<<<<<<<<< 
 * 
 *             python.Py_INCREF(item)
 */
      __pyx_3 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_node,__pyx_v_c_attr); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 333; goto __pyx_L1;}
      __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 332; goto __pyx_L1;}
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
      PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
      __pyx_2 = 0;
      __pyx_3 = 0;
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_4;
      __pyx_4 = 0;
    }
    __pyx_L9:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":335
 *                         _attributeValue(c_node, c_attr))
 * 
 *             python.Py_INCREF(item)             # <<<<<<<<<<<<<< 
 *             python.PyList_SET_ITEM(attributes, count, item)
 *             count = count + 1
 */
    Py_INCREF(__pyx_v_item);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":336
 * 
 *             python.Py_INCREF(item)
 *             python.PyList_SET_ITEM(attributes, count, item)             # <<<<<<<<<<<<<< 
 *             count = count + 1
 *         c_attr = c_attr.next
 */
    PyList_SET_ITEM(__pyx_v_attributes,__pyx_v_count,__pyx_v_item);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":337
 *             python.Py_INCREF(item)
 *             python.PyList_SET_ITEM(attributes, count, item)
 *             count = count + 1             # <<<<<<<<<<<<<< 
 *         c_attr = c_attr.next
 *     return attributes
 */
    __pyx_v_count = (__pyx_v_count + 1);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":338
 *             python.PyList_SET_ITEM(attributes, count, item)
 *             count = count + 1
 *         c_attr = c_attr.next             # <<<<<<<<<<<<<< 
 *     return attributes
 * 
 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":339
 *             count = count + 1
 *         c_attr = c_attr.next
 *     return attributes             # <<<<<<<<<<<<<< 
 * 
 * cdef object __RE_XML_ENCODING
 */
Py_INCREF(__pyx_v_attributes);
__pyx_r = __pyx_v_attributes;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._collectAttributes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_attributes);
Py_DECREF(__pyx_v_item);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":351
 * __HAS_XML_ENCODING = __RE_XML_ENCODING.match
 * 
 * cdef object _stripEncodingDeclaration(object xml_string):             # <<<<<<<<<<<<<< 
 *     # this is a hack to remove the XML encoding declaration from unicode
 *     return __REPLACE_XML_ENCODING(r'\g<1>', xml_string)
 */

static PyObject *__pyx_k417p;

static char __pyx_k417[] = "\\g<1>";

static  PyObject *__pyx_f_4lxml_5etree__stripEncodingDeclaration(PyObject *__pyx_v_xml_string) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_xml_string);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":353
 * cdef object _stripEncodingDeclaration(object xml_string):
 *     # this is a hack to remove the XML encoding declaration from unicode
 *     return __REPLACE_XML_ENCODING(r'\g<1>', xml_string)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _hasEncodingDeclaration(object xml_string):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 353; goto __pyx_L1;}
Py_INCREF(__pyx_k417p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k417p);
Py_INCREF(__pyx_v_xml_string);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_xml_string);
__pyx_2 = PyObject_CallObject(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 353; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._stripEncodingDeclaration");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":355
 *     return __REPLACE_XML_ENCODING(r'\g<1>', xml_string)
 * 
 * cdef int _hasEncodingDeclaration(object xml_string):             # <<<<<<<<<<<<<< 
 *     # check if a (unicode) string has an XML encoding declaration
 *     return __HAS_XML_ENCODING(xml_string) is not None
 */

static  int __pyx_f_4lxml_5etree__hasEncodingDeclaration(PyObject *__pyx_v_xml_string) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_xml_string);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":357
 * cdef int _hasEncodingDeclaration(object xml_string):
 *     # check if a (unicode) string has an XML encoding declaration
 *     return __HAS_XML_ENCODING(xml_string) is not None             # <<<<<<<<<<<<<< 
 * 
 * cdef object _stripDeclaration(object xml_string):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; goto __pyx_L1;}
Py_INCREF(__pyx_v_xml_string);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_xml_string);
__pyx_2 = PyObject_CallObject(__pyx_v_4lxml_5etree___HAS_XML_ENCODING, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":357
 * cdef int _hasEncodingDeclaration(object xml_string):
 *     # check if a (unicode) string has an XML encoding declaration
 *     return __HAS_XML_ENCODING(xml_string) is not None             # <<<<<<<<<<<<<< 
 * 
 * cdef object _stripDeclaration(object xml_string):
 */
__pyx_3 = (__pyx_2 != Py_None);
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("lxml.etree._hasEncodingDeclaration");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":359
 *     return __HAS_XML_ENCODING(xml_string) is not None
 * 
 * cdef object _stripDeclaration(object xml_string):             # <<<<<<<<<<<<<< 
 *     # this is a hack to remove the XML declaration when we encode to UTF-8
 *     xml_string = xml_string.strip()
 */

static PyObject *__pyx_num_neg_1;
static PyObject *__pyx_num_2;

static PyObject *__pyx_n_strip;

static PyObject *__pyx_k418p;
static PyObject *__pyx_k419p;
static PyObject *__pyx_k420p;

static char __pyx_k418[] = "<?xml";
static char __pyx_k419[] = "?>";
static char __pyx_k420[] = "\n\r ";

static  PyObject *__pyx_f_4lxml_5etree__stripDeclaration(PyObject *__pyx_v_xml_string) {
PyObject *__pyx_v_i;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_ssize_t __pyx_5;
Py_ssize_t __pyx_6;
Py_INCREF(__pyx_v_xml_string);
__pyx_v_i = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":361
 * cdef object _stripDeclaration(object xml_string):
 *     # this is a hack to remove the XML declaration when we encode to UTF-8
 *     xml_string = xml_string.strip()             # <<<<<<<<<<<<<< 
 *     if xml_string[:5] == '<?xml':
 *         i = xml_string.find('?>')
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_n_strip); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 361; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 361; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_xml_string);
__pyx_v_xml_string = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":362
 *     # this is a hack to remove the XML declaration when we encode to UTF-8
 *     xml_string = xml_string.strip()
 *     if xml_string[:5] == '<?xml':             # <<<<<<<<<<<<<< 
 *         i = xml_string.find('?>')
 *         if i != -1:
 */
__pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, 0, 5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":362
 *     # this is a hack to remove the XML declaration when we encode to UTF-8
 *     xml_string = xml_string.strip()
 *     if xml_string[:5] == '<?xml':             # <<<<<<<<<<<<<< 
 *         i = xml_string.find('?>')
 *         if i != -1:
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_k418p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 362; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":363
 *     xml_string = xml_string.strip()
 *     if xml_string[:5] == '<?xml':
 *         i = xml_string.find('?>')             # <<<<<<<<<<<<<< 
 *         if i != -1:
 *             i = i + 2
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_n_find); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":363
 *     xml_string = xml_string.strip()
 *     if xml_string[:5] == '<?xml':
 *         i = xml_string.find('?>')             # <<<<<<<<<<<<<< 
 *         if i != -1:
 *             i = i + 2
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; goto __pyx_L1;}
  Py_INCREF(__pyx_k419p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k419p);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_i);
  __pyx_v_i = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":364
 *     if xml_string[:5] == '<?xml':
 *         i = xml_string.find('?>')
 *         if i != -1:             # <<<<<<<<<<<<<< 
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':
 */
  __pyx_1 = PyObject_RichCompare(__pyx_v_i, __pyx_num_neg_1, Py_NE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; goto __pyx_L1;}
  __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 364; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":365
 *         i = xml_string.find('?>')
 *         if i != -1:
 *             i = i + 2             # <<<<<<<<<<<<<< 
 *             while xml_string[i:i+1] in '\n\r ':
 *                 i = i+1
 */
    __pyx_2 = PyNumber_Add(__pyx_v_i, __pyx_num_2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 365; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":366
 *         if i != -1:
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':             # <<<<<<<<<<<<<< 
 *                 i = i+1
 *             xml_string = xml_string[i:]
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":366
 *         if i != -1:
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':             # <<<<<<<<<<<<<< 
 *                 i = i+1
 *             xml_string = xml_string[i:]
 */
      __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":366
 *         if i != -1:
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':             # <<<<<<<<<<<<<< 
 *                 i = i+1
 *             xml_string = xml_string[i:]
 */
      __pyx_4 = PyNumber_Add(__pyx_v_i, __pyx_num_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; goto __pyx_L1;}
      __pyx_6 = __pyx_PyIndex_AsSsize_t(__pyx_4); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_5, __pyx_6); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":366
 *         if i != -1:
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':             # <<<<<<<<<<<<<< 
 *                 i = i+1
 *             xml_string = xml_string[i:]
 */
      __pyx_3 = (PySequence_Contains(__pyx_k420p, __pyx_1)); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      if (!__pyx_3) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":367
 *             i = i + 2
 *             while xml_string[i:i+1] in '\n\r ':
 *                 i = i+1             # <<<<<<<<<<<<<< 
 *             xml_string = xml_string[i:]
 *     return xml_string
 */
      __pyx_2 = PyNumber_Add(__pyx_v_i, __pyx_num_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 367; goto __pyx_L1;}
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_2;
      __pyx_2 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":368
 *             while xml_string[i:i+1] in '\n\r ':
 *                 i = i+1
 *             xml_string = xml_string[i:]             # <<<<<<<<<<<<<< 
 *     return xml_string
 * 
 */
    __pyx_5 = __pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_5 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 368; goto __pyx_L1;}
    __pyx_4 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_5, PY_SSIZE_T_MAX); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 368; goto __pyx_L1;}
    Py_DECREF(__pyx_v_xml_string);
    __pyx_v_xml_string = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":369
 *                 i = i+1
 *             xml_string = xml_string[i:]
 *     return xml_string             # <<<<<<<<<<<<<< 
 * 
 * cdef int _hasText(xmlNode* c_node):
 */
Py_INCREF(__pyx_v_xml_string);
__pyx_r = __pyx_v_xml_string;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._stripDeclaration");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_i);
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":371
 *     return xml_string
 * 
 * cdef int _hasText(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL
 * 
 */

static  int __pyx_f_4lxml_5etree__hasText(xmlNode *__pyx_v_c_node) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":372
 * 
 * cdef int _hasText(xmlNode* c_node):
 *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef int _hasTail(xmlNode* c_node):
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":372
 * 
 * cdef int _hasText(xmlNode* c_node):
 *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef int _hasTail(xmlNode* c_node):
 */
  __pyx_1 = (__pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->children) != NULL);
}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":374
 *     return c_node is not NULL and _textNodeOrSkip(c_node.children) is not NULL
 * 
 * cdef int _hasTail(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL
 * 
 */

static  int __pyx_f_4lxml_5etree__hasTail(xmlNode *__pyx_v_c_node) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":375
 * 
 * cdef int _hasTail(xmlNode* c_node):
 *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef _collectText(xmlNode* c_node):
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":375
 * 
 * cdef int _hasTail(xmlNode* c_node):
 *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef _collectText(xmlNode* c_node):
 */
  __pyx_1 = (__pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next) != NULL);
}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":377
 *     return c_node is not NULL and _textNodeOrSkip(c_node.next) is not NULL
 * 
 * cdef _collectText(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Collect all text nodes and return them as a unicode string.
 * 
 */

static PyObject *__pyx_k421p;
static PyObject *__pyx_k422p;

static char __pyx_k421[] = "";
static char __pyx_k422[] = "";

static  PyObject *__pyx_f_4lxml_5etree__collectText(xmlNode *__pyx_v_c_node) {
Py_ssize_t __pyx_v_scount;
char *__pyx_v_text;
xmlNode *__pyx_v_c_node_cur;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
xmlNode *__pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
char *__pyx_5;
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":388
 *     cdef xmlNode* c_node_cur
 *     # check for multiple text nodes
 *     scount = 0             # <<<<<<<<<<<<<< 
 *     text = NULL
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)
 */
__pyx_v_scount = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":389
 *     # check for multiple text nodes
 *     scount = 0
 *     text = NULL             # <<<<<<<<<<<<<< 
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)
 *     while c_node_cur is not NULL:
 */
__pyx_v_text = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":390
 *     scount = 0
 *     text = NULL
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)             # <<<<<<<<<<<<<< 
 *     while c_node_cur is not NULL:
 *         if c_node_cur.content[0] != c'\0':
 */
__pyx_1 = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node);
__pyx_v_c_node_cur = __pyx_1;
__pyx_v_c_node = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":391
 *     text = NULL
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)
 *     while c_node_cur is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_node_cur.content[0] != c'\0':
 *             text = c_node_cur.content
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":391
 *     text = NULL
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)
 *     while c_node_cur is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_node_cur.content[0] != c'\0':
 *             text = c_node_cur.content
 */
  __pyx_2 = (__pyx_v_c_node_cur != NULL);
  if (!__pyx_2) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":392
 *     c_node_cur = c_node = _textNodeOrSkip(c_node)
 *     while c_node_cur is not NULL:
 *         if c_node_cur.content[0] != c'\0':             # <<<<<<<<<<<<<< 
 *             text = c_node_cur.content
 *         scount = scount + 1
 */
  __pyx_2 = ((__pyx_v_c_node_cur->content[0]) != '\0');
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":393
 *     while c_node_cur is not NULL:
 *         if c_node_cur.content[0] != c'\0':
 *             text = c_node_cur.content             # <<<<<<<<<<<<<< 
 *         scount = scount + 1
 *         c_node_cur = _textNodeOrSkip(c_node_cur.next)
 */
    __pyx_v_text = __pyx_v_c_node_cur->content;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":394
 *         if c_node_cur.content[0] != c'\0':
 *             text = c_node_cur.content
 *         scount = scount + 1             # <<<<<<<<<<<<<< 
 *         c_node_cur = _textNodeOrSkip(c_node_cur.next)
 * 
 */
  __pyx_v_scount = (__pyx_v_scount + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":395
 *             text = c_node_cur.content
 *         scount = scount + 1
 *         c_node_cur = _textNodeOrSkip(c_node_cur.next)             # <<<<<<<<<<<<<< 
 * 
 *     # handle two most common cases first
 */
  __pyx_v_c_node_cur = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node_cur->next);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":398
 * 
 *     # handle two most common cases first
 *     if text is NULL:             # <<<<<<<<<<<<<< 
 *         if scount > 0:
 *             return ''
 */
__pyx_2 = (__pyx_v_text == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":399
 *     # handle two most common cases first
 *     if text is NULL:
 *         if scount > 0:             # <<<<<<<<<<<<<< 
 *             return ''
 *         else:
 */
  __pyx_2 = (__pyx_v_scount > 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":400
 *     if text is NULL:
 *         if scount > 0:
 *             return ''             # <<<<<<<<<<<<<< 
 *         else:
 *             return None
 */
    Py_INCREF(__pyx_k421p);
    __pyx_r = __pyx_k421p;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":402
 *             return ''
 *         else:
 *             return None             # <<<<<<<<<<<<<< 
 *     if scount == 1:
 *         return funicode(text)
 */
    Py_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L6:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":403
 *         else:
 *             return None
 *     if scount == 1:             # <<<<<<<<<<<<<< 
 *         return funicode(text)
 * 
 */
__pyx_2 = (__pyx_v_scount == 1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":404
 *             return None
 *     if scount == 1:
 *         return funicode(text)             # <<<<<<<<<<<<<< 
 * 
 *     # the rest is not performance critical anymore
 */
  __pyx_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_text); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 404; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":407
 * 
 *     # the rest is not performance critical anymore
 *     result = ''             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         result = result + c_node.content
 */
Py_INCREF(__pyx_k422p);
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_k422p;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":408
 *     # the rest is not performance critical anymore
 *     result = ''
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         result = result + c_node.content
 *         c_node = _textNodeOrSkip(c_node.next)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":408
 *     # the rest is not performance critical anymore
 *     result = ''
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         result = result + c_node.content
 *         c_node = _textNodeOrSkip(c_node.next)
 */
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (!__pyx_2) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":409
 *     result = ''
 *     while c_node is not NULL:
 *         result = result + c_node.content             # <<<<<<<<<<<<<< 
 *         c_node = _textNodeOrSkip(c_node.next)
 *     return funicode(result)
 */
  __pyx_3 = PyString_FromString(__pyx_v_c_node->content); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; goto __pyx_L1;}
  __pyx_4 = PyNumber_Add(__pyx_v_result, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 409; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":410
 *     while c_node is not NULL:
 *         result = result + c_node.content
 *         c_node = _textNodeOrSkip(c_node.next)             # <<<<<<<<<<<<<< 
 *     return funicode(result)
 * 
 */
  __pyx_v_c_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":411
 *         result = result + c_node.content
 *         c_node = _textNodeOrSkip(c_node.next)
 *     return funicode(result)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _removeText(xmlNode* c_node):
 */
__pyx_5 = PyString_AsString(__pyx_v_result); if (unlikely((!__pyx_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; goto __pyx_L1;}
__pyx_3 = __pyx_f_4lxml_5etree_funicode(__pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 411; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._collectText");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":413
 *     return funicode(result)
 * 
 * cdef void _removeText(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Remove all text nodes.
 * 
 */

static  void __pyx_f_4lxml_5etree__removeText(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_v_c_next;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":419
 *     """
 *     cdef xmlNode* c_next
 *     c_node = _textNodeOrSkip(c_node)             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         c_next = _textNodeOrSkip(c_node.next)
 */
__pyx_v_c_node = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":420
 *     cdef xmlNode* c_next
 *     c_node = _textNodeOrSkip(c_node)
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         c_next = _textNodeOrSkip(c_node.next)
 *         tree.xmlUnlinkNode(c_node)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":420
 *     cdef xmlNode* c_next
 *     c_node = _textNodeOrSkip(c_node)
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         c_next = _textNodeOrSkip(c_node.next)
 *         tree.xmlUnlinkNode(c_node)
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":421
 *     c_node = _textNodeOrSkip(c_node)
 *     while c_node is not NULL:
 *         c_next = _textNodeOrSkip(c_node.next)             # <<<<<<<<<<<<<< 
 *         tree.xmlUnlinkNode(c_node)
 *         tree.xmlFreeNode(c_node)
 */
  __pyx_v_c_next = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_node->next);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":422
 *     while c_node is not NULL:
 *         c_next = _textNodeOrSkip(c_node.next)
 *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeNode(c_node)
 *         c_node = c_next
 */
  xmlUnlinkNode(__pyx_v_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":423
 *         c_next = _textNodeOrSkip(c_node.next)
 *         tree.xmlUnlinkNode(c_node)
 *         tree.xmlFreeNode(c_node)             # <<<<<<<<<<<<<< 
 *         c_node = c_next
 * 
 */
  xmlFreeNode(__pyx_v_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":424
 *         tree.xmlUnlinkNode(c_node)
 *         tree.xmlFreeNode(c_node)
 *         c_node = c_next             # <<<<<<<<<<<<<< 
 * 
 * cdef int _setNodeText(xmlNode* c_node, value) except -1:
 */
  __pyx_v_c_node = __pyx_v_c_next;
}

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":426
 *         c_node = c_next
 * 
 * cdef int _setNodeText(xmlNode* c_node, value) except -1:             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_text_node
 *     # remove all text nodes at the start first
 */

static  int __pyx_f_4lxml_5etree__setNodeText(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_value) {
xmlNode *__pyx_v_c_text_node;
PyObject *__pyx_v_text;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_value);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":429
 *     cdef xmlNode* c_text_node
 *     # remove all text nodes at the start first
 *     _removeText(c_node.children)             # <<<<<<<<<<<<<< 
 *     if value is None:
 *         return 0
 */
__pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->children);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":430
 *     # remove all text nodes at the start first
 *     _removeText(c_node.children)
 *     if value is None:             # <<<<<<<<<<<<<< 
 *         return 0
 *     # now add new text node with value at start
 */
__pyx_1 = (__pyx_v_value == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":431
 *     _removeText(c_node.children)
 *     if value is None:
 *         return 0             # <<<<<<<<<<<<<< 
 *     # now add new text node with value at start
 *     text = _utf8(value)
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":433
 *         return 0
 *     # now add new text node with value at start
 *     text = _utf8(value)             # <<<<<<<<<<<<<< 
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 *     if c_node.children is NULL:
 */
__pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":434
 *     # now add new text node with value at start
 *     text = _utf8(value)
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))             # <<<<<<<<<<<<<< 
 *     if c_node.children is NULL:
 *         tree.xmlAddChild(c_node, c_text_node)
 */
__pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc,_cstr(__pyx_v_text));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":435
 *     text = _utf8(value)
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 *     if c_node.children is NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlAddChild(c_node, c_text_node)
 *     else:
 */
__pyx_1 = (__pyx_v_c_node->children == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":436
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 *     if c_node.children is NULL:
 *         tree.xmlAddChild(c_node, c_text_node)             # <<<<<<<<<<<<<< 
 *     else:
 *         tree.xmlAddPrevSibling(c_node.children, c_text_node)
 */
  xmlAddChild(__pyx_v_c_node,__pyx_v_c_text_node);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":438
 *         tree.xmlAddChild(c_node, c_text_node)
 *     else:
 *         tree.xmlAddPrevSibling(c_node.children, c_text_node)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  xmlAddPrevSibling(__pyx_v_c_node->children,__pyx_v_c_text_node);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":439
 *     else:
 *         tree.xmlAddPrevSibling(c_node.children, c_text_node)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _setTailText(xmlNode* c_node, value) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._setNodeText");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":441
 *     return 0
 * 
 * cdef int _setTailText(xmlNode* c_node, value) except -1:             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_text_node
 *     # remove all text nodes at the start first
 */

static  int __pyx_f_4lxml_5etree__setTailText(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_value) {
xmlNode *__pyx_v_c_text_node;
PyObject *__pyx_v_text;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_value);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":444
 *     cdef xmlNode* c_text_node
 *     # remove all text nodes at the start first
 *     _removeText(c_node.next)             # <<<<<<<<<<<<<< 
 *     if value is None:
 *         return 0
 */
__pyx_f_4lxml_5etree__removeText(__pyx_v_c_node->next);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":445
 *     # remove all text nodes at the start first
 *     _removeText(c_node.next)
 *     if value is None:             # <<<<<<<<<<<<<< 
 *         return 0
 *     text = _utf8(value)
 */
__pyx_1 = (__pyx_v_value == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":446
 *     _removeText(c_node.next)
 *     if value is None:
 *         return 0             # <<<<<<<<<<<<<< 
 *     text = _utf8(value)
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":447
 *     if value is None:
 *         return 0
 *     text = _utf8(value)             # <<<<<<<<<<<<<< 
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 *     # XXX what if we're the top element?
 */
__pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 447; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":448
 *         return 0
 *     text = _utf8(value)
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))             # <<<<<<<<<<<<<< 
 *     # XXX what if we're the top element?
 *     tree.xmlAddNextSibling(c_node, c_text_node)
 */
__pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc,_cstr(__pyx_v_text));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":450
 *     c_text_node = tree.xmlNewDocText(c_node.doc, _cstr(text))
 *     # XXX what if we're the top element?
 *     tree.xmlAddNextSibling(c_node, c_text_node)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
xmlAddNextSibling(__pyx_v_c_node,__pyx_v_c_text_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":451
 *     # XXX what if we're the top element?
 *     tree.xmlAddNextSibling(c_node, c_text_node)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef _resolveQNameText(_Element element, value):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._setTailText");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":453
 *     return 0
 * 
 * cdef _resolveQNameText(_Element element, value):             # <<<<<<<<<<<<<< 
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)
 */

static PyObject *__pyx_k423p;

static char __pyx_k423[] = "%s:%s";

static  PyObject *__pyx_f_4lxml_5etree__resolveQNameText(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_value) {
xmlNs *__pyx_v_c_ns;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_tag;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
xmlNs *__pyx_5;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_value);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":455
 * cdef _resolveQNameText(_Element element, value):
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         return tag
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":455
 * cdef _resolveQNameText(_Element element, value):
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         return tag
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":455
 * cdef _resolveQNameText(_Element element, value):
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         return tag
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":455
 * cdef _resolveQNameText(_Element element, value):
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         return tag
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":455
 * cdef _resolveQNameText(_Element element, value):
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)             # <<<<<<<<<<<<<< 
 *     if ns is None:
 *         return tag
 */
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":456
 *     cdef xmlNs* c_ns
 *     ns, tag = _getNsTag(value)
 *     if ns is None:             # <<<<<<<<<<<<<< 
 *         return tag
 *     else:
 */
__pyx_4 = (__pyx_v_ns == Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":457
 *     ns, tag = _getNsTag(value)
 *     if ns is None:
 *         return tag             # <<<<<<<<<<<<<< 
 *     else:
 *         c_ns = element._doc._findOrBuildNodeNs(
 */
  Py_INCREF(__pyx_v_tag);
  __pyx_r = __pyx_v_tag;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":460
 *     else:
 *         c_ns = element._doc._findOrBuildNodeNs(
 *             element._c_node, _cstr(ns), NULL)             # <<<<<<<<<<<<<< 
 *         return '%s:%s' % (c_ns.prefix, tag)
 * 
 */
  __pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_element->_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_element->_doc,__pyx_v_element->_c_node,_cstr(__pyx_v_ns),NULL); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 459; goto __pyx_L1;}
  __pyx_v_c_ns = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":461
 *         c_ns = element._doc._findOrBuildNodeNs(
 *             element._c_node, _cstr(ns), NULL)
 *         return '%s:%s' % (c_ns.prefix, tag)             # <<<<<<<<<<<<<< 
 * 
 * cdef bint _hasChild(xmlNode* c_node):
 */
  __pyx_3 = PyString_FromString(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":461
 *         c_ns = element._doc._findOrBuildNodeNs(
 *             element._c_node, _cstr(ns), NULL)
 *         return '%s:%s' % (c_ns.prefix, tag)             # <<<<<<<<<<<<<< 
 * 
 * cdef bint _hasChild(xmlNode* c_node):
 */
  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_tag);
  __pyx_3 = 0;
  __pyx_2 = PyNumber_Remainder(__pyx_k423p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._resolveQNameText");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":463
 *         return '%s:%s' % (c_ns.prefix, tag)
 * 
 * cdef bint _hasChild(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL
 * 
 */

static  int __pyx_f_4lxml_5etree__hasChild(xmlNode *__pyx_v_c_node) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":464
 * 
 * cdef bint _hasChild(xmlNode* c_node):
 *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef Py_ssize_t _countElements(xmlNode* c_node):
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":464
 * 
 * cdef bint _hasChild(xmlNode* c_node):
 *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef Py_ssize_t _countElements(xmlNode* c_node):
 */
  __pyx_1 = (__pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node,0) != NULL);
}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":466
 *     return c_node is not NULL and _findChildForwards(c_node, 0) is not NULL
 * 
 * cdef Py_ssize_t _countElements(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     "Counts the elements within the following siblings and the node itself."
 *     cdef Py_ssize_t count
 */

static  Py_ssize_t __pyx_f_4lxml_5etree__countElements(xmlNode *__pyx_v_c_node) {
Py_ssize_t __pyx_v_count;
Py_ssize_t __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":469
 *     "Counts the elements within the following siblings and the node itself."
 *     cdef Py_ssize_t count
 *     count = 0             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 */
__pyx_v_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":470
 *     cdef Py_ssize_t count
 *     count = 0
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             count = count + 1
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":470
 *     cdef Py_ssize_t count
 *     count = 0
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             count = count + 1
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":471
 *     count = 0
 *     while c_node is not NULL:
 *         if _isElement(c_node):             # <<<<<<<<<<<<<< 
 *             count = count + 1
 *         c_node = c_node.next
 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":472
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 *             count = count + 1             # <<<<<<<<<<<<<< 
 *         c_node = c_node.next
 *     return count
 */
    __pyx_v_count = (__pyx_v_count + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":473
 *         if _isElement(c_node):
 *             count = count + 1
 *         c_node = c_node.next             # <<<<<<<<<<<<<< 
 *     return count
 * 
 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":474
 *             count = count + 1
 *         c_node = c_node.next
 *     return count             # <<<<<<<<<<<<<< 
 * 
 * cdef int _findChildSlice(
 */
__pyx_r = __pyx_v_count;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":476
 *     return count
 * 
 * cdef int _findChildSlice(             # <<<<<<<<<<<<<< 
 *     python.slice sliceobject, xmlNode* c_parent,
 *     xmlNode** c_start_node, Py_ssize_t* c_step, Py_ssize_t* c_length) except -1:
 */

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) {
Py_ssize_t __pyx_v_start;
Py_ssize_t __pyx_v_stop;
Py_ssize_t __pyx_v_childcount;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_sliceobject);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":485
 *     """
 *     cdef Py_ssize_t start, stop, childcount
 *     childcount = _countElements(c_parent.children)             # <<<<<<<<<<<<<< 
 *     if childcount == 0:
 *         c_start_node[0] = NULL
 */
__pyx_v_childcount = __pyx_f_4lxml_5etree__countElements(__pyx_v_c_parent->children);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":486
 *     cdef Py_ssize_t start, stop, childcount
 *     childcount = _countElements(c_parent.children)
 *     if childcount == 0:             # <<<<<<<<<<<<<< 
 *         c_start_node[0] = NULL
 *         c_length[0] = 0
 */
__pyx_1 = (__pyx_v_childcount == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":487
 *     childcount = _countElements(c_parent.children)
 *     if childcount == 0:
 *         c_start_node[0] = NULL             # <<<<<<<<<<<<<< 
 *         c_length[0] = 0
 *         if sliceobject.step is None:
 */
  (__pyx_v_c_start_node[0]) = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":488
 *     if childcount == 0:
 *         c_start_node[0] = NULL
 *         c_length[0] = 0             # <<<<<<<<<<<<<< 
 *         if sliceobject.step is None:
 *             c_step[0] = 1
 */
  (__pyx_v_c_length[0]) = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":489
 *         c_start_node[0] = NULL
 *         c_length[0] = 0
 *         if sliceobject.step is None:             # <<<<<<<<<<<<<< 
 *             c_step[0] = 1
 *         else:
 */
  __pyx_1 = (__pyx_v_sliceobject->step == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":490
 *         c_length[0] = 0
 *         if sliceobject.step is None:
 *             c_step[0] = 1             # <<<<<<<<<<<<<< 
 *         else:
 *             python._PyEval_SliceIndex(sliceobject.step, c_step)
 */
    (__pyx_v_c_step[0]) = 1;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":492
 *             c_step[0] = 1
 *         else:
 *             python._PyEval_SliceIndex(sliceobject.step, c_step)             # <<<<<<<<<<<<<< 
 *         return 0
 *     python.PySlice_GetIndicesEx(
 */
    __pyx_2 = _PyEval_SliceIndex(__pyx_v_sliceobject->step,__pyx_v_c_step); if (unlikely(__pyx_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 492; goto __pyx_L1;}
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":493
 *         else:
 *             python._PyEval_SliceIndex(sliceobject.step, c_step)
 *         return 0             # <<<<<<<<<<<<<< 
 *     python.PySlice_GetIndicesEx(
 *         sliceobject, childcount, &start, &stop, c_step, c_length)
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":495
 *         return 0
 *     python.PySlice_GetIndicesEx(
 *         sliceobject, childcount, &start, &stop, c_step, c_length)             # <<<<<<<<<<<<<< 
 *     if start > childcount / 2:
 *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
 */
__pyx_2 = PySlice_GetIndicesEx(((PyObject *)__pyx_v_sliceobject),__pyx_v_childcount,(&__pyx_v_start),(&__pyx_v_stop),__pyx_v_c_step,__pyx_v_c_length); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 494; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":496
 *     python.PySlice_GetIndicesEx(
 *         sliceobject, childcount, &start, &stop, c_step, c_length)
 *     if start > childcount / 2:             # <<<<<<<<<<<<<< 
 *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
 *     else:
 */
__pyx_1 = (__pyx_v_start > (__pyx_v_childcount / 2));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":497
 *         sliceobject, childcount, &start, &stop, c_step, c_length)
 *     if start > childcount / 2:
 *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_start_node[0] = _findChild(c_parent, start)
 */
  (__pyx_v_c_start_node[0]) = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_parent,((__pyx_v_childcount - __pyx_v_start) - 1));
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":499
 *         c_start_node[0] = _findChildBackwards(c_parent, childcount - start - 1)
 *     else:
 *         c_start_node[0] = _findChild(c_parent, start)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  (__pyx_v_c_start_node[0]) = __pyx_f_4lxml_5etree__findChild(__pyx_v_c_parent,__pyx_v_start);
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":500
 *     else:
 *         c_start_node[0] = _findChild(c_parent, start)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef bint _isFullSlice(python.slice sliceobject):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._findChildSlice");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_sliceobject);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":502
 *     return 0
 * 
 * cdef bint _isFullSlice(python.slice sliceobject):             # <<<<<<<<<<<<<< 
 *     """Conservative guess if this slice is a full slice as in ``s[:]``.
 *     """
 */

static  int __pyx_f_4lxml_5etree__isFullSlice(PySliceObject *__pyx_v_sliceobject) {
Py_ssize_t __pyx_v_step;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_sliceobject);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":506
 *     """
 *     cdef Py_ssize_t step
 *     if sliceobject is None:             # <<<<<<<<<<<<<< 
 *         return 0
 *     if sliceobject.start is None and \
 */
__pyx_1 = (((PyObject *)__pyx_v_sliceobject) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":507
 *     cdef Py_ssize_t step
 *     if sliceobject is None:
 *         return 0             # <<<<<<<<<<<<<< 
 *     if sliceobject.start is None and \
 *             sliceobject.stop is None:
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":508
 *     if sliceobject is None:
 *         return 0
 *     if sliceobject.start is None and \             # <<<<<<<<<<<<<< 
 *             sliceobject.stop is None:
 *         if sliceobject.step is None:
 */
__pyx_1 = (__pyx_v_sliceobject->start == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":509
 *         return 0
 *     if sliceobject.start is None and \
 *             sliceobject.stop is None:             # <<<<<<<<<<<<<< 
 *         if sliceobject.step is None:
 *             return 1
 */
  __pyx_1 = (__pyx_v_sliceobject->stop == Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":510
 *     if sliceobject.start is None and \
 *             sliceobject.stop is None:
 *         if sliceobject.step is None:             # <<<<<<<<<<<<<< 
 *             return 1
 *         python._PyEval_SliceIndex(sliceobject.step, &step)
 */
  __pyx_1 = (__pyx_v_sliceobject->step == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":511
 *             sliceobject.stop is None:
 *         if sliceobject.step is None:
 *             return 1             # <<<<<<<<<<<<<< 
 *         python._PyEval_SliceIndex(sliceobject.step, &step)
 *         if step == 1:
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":512
 *         if sliceobject.step is None:
 *             return 1
 *         python._PyEval_SliceIndex(sliceobject.step, &step)             # <<<<<<<<<<<<<< 
 *         if step == 1:
 *             return 1
 */
  __pyx_2 = _PyEval_SliceIndex(__pyx_v_sliceobject->step,(&__pyx_v_step)); if (unlikely(__pyx_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 512; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":513
 *             return 1
 *         python._PyEval_SliceIndex(sliceobject.step, &step)
 *         if step == 1:             # <<<<<<<<<<<<<< 
 *             return 1
 *         return 0
 */
  __pyx_1 = (__pyx_v_step == 1);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":514
 *         python._PyEval_SliceIndex(sliceobject.step, &step)
 *         if step == 1:
 *             return 1             # <<<<<<<<<<<<<< 
 *         return 0
 *     return 0
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":515
 *         if step == 1:
 *             return 1
 *         return 0             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":516
 *             return 1
 *         return 0
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef _collectChildren(_Element element):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree._isFullSlice");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_sliceobject);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":518
 *     return 0
 * 
 * cdef _collectChildren(_Element element):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     result = []
 */

static  PyObject *__pyx_f_4lxml_5etree__collectChildren(struct LxmlElement *__pyx_v_element) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
Py_INCREF(__pyx_v_element);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":520
 * cdef _collectChildren(_Element element):
 *     cdef xmlNode* c_node
 *     result = []             # <<<<<<<<<<<<<< 
 *     c_node = element._c_node.children
 *     if c_node is not NULL:
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 520; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":521
 *     cdef xmlNode* c_node
 *     result = []
 *     c_node = element._c_node.children             # <<<<<<<<<<<<<< 
 *     if c_node is not NULL:
 *         if not _isElement(c_node):
 */
__pyx_v_c_node = __pyx_v_element->_c_node->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":522
 *     result = []
 *     c_node = element._c_node.children
 *     if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if not _isElement(c_node):
 *             c_node = _nextElement(c_node)
 */
__pyx_2 = (__pyx_v_c_node != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":523
 *     c_node = element._c_node.children
 *     if c_node is not NULL:
 *         if not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *             c_node = _nextElement(c_node)
 *         while c_node is not NULL:
 */
  __pyx_2 = (!_isElement(__pyx_v_c_node));
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":524
 *     if c_node is not NULL:
 *         if not _isElement(c_node):
 *             c_node = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *         while c_node is not NULL:
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))
 */
    __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":525
 *         if not _isElement(c_node):
 *             c_node = _nextElement(c_node)
 *         while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))
 *             c_node = _nextElement(c_node)
 */
  while (1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":525
 *         if not _isElement(c_node):
 *             c_node = _nextElement(c_node)
 *         while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))
 *             c_node = _nextElement(c_node)
 */
    __pyx_2 = (__pyx_v_c_node != NULL);
    if (!__pyx_2) break;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":526
 *             c_node = _nextElement(c_node)
 *         while c_node is not NULL:
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))             # <<<<<<<<<<<<<< 
 *             c_node = _nextElement(c_node)
 *     return result
 */
    __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_element->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 526; goto __pyx_L1;}
    __pyx_3 = PyList_Append(__pyx_v_result,__pyx_1); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 526; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":527
 *         while c_node is not NULL:
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))
 *             c_node = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
    __pyx_v_c_node = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
  }
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":528
 *             python.PyList_Append(result, _elementFactory(element._doc, c_node))
 *             c_node = _nextElement(c_node)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._collectChildren");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":530
 *     return result
 * 
 * cdef xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     if index < 0:
 *         return _findChildBackwards(c_node, -index - 1)
 */

static  xmlNode *__pyx_f_4lxml_5etree__findChild(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":531
 * 
 * cdef xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
 *     if index < 0:             # <<<<<<<<<<<<<< 
 *         return _findChildBackwards(c_node, -index - 1)
 *     else:
 */
__pyx_1 = (__pyx_v_index < 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":532
 * cdef xmlNode* _findChild(xmlNode* c_node, Py_ssize_t index):
 *     if index < 0:
 *         return _findChildBackwards(c_node, -index - 1)             # <<<<<<<<<<<<<< 
 *     else:
 *         return _findChildForwards(c_node, index)
 */
  __pyx_r = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_node,((-__pyx_v_index) - 1));
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":534
 *         return _findChildBackwards(c_node, -index - 1)
 *     else:
 *         return _findChildForwards(c_node, index)             # <<<<<<<<<<<<<< 
 *     
 * cdef xmlNode* _findChildForwards(xmlNode* c_node, Py_ssize_t index):
 */
  __pyx_r = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node,__pyx_v_index);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":536
 *         return _findChildForwards(c_node, index)
 *     
 * cdef xmlNode* _findChildForwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     """Return child element of c_node with index, or return NULL if not found.
 *     """
 */

static  xmlNode *__pyx_f_4lxml_5etree__findChildForwards(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_v_c_child;
Py_ssize_t __pyx_v_c;
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":541
 *     cdef xmlNode* c_child
 *     cdef Py_ssize_t c
 *     c_child = c_node.children             # <<<<<<<<<<<<<< 
 *     c = 0
 *     while c_child is not NULL:
 */
__pyx_v_c_child = __pyx_v_c_node->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":542
 *     cdef Py_ssize_t c
 *     c_child = c_node.children
 *     c = 0             # <<<<<<<<<<<<<< 
 *     while c_child is not NULL:
 *         if _isElement(c_child):
 */
__pyx_v_c = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":543
 *     c_child = c_node.children
 *     c = 0
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_child):
 *             if c == index:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":543
 *     c_child = c_node.children
 *     c = 0
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_child):
 *             if c == index:
 */
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":544
 *     c = 0
 *     while c_child is not NULL:
 *         if _isElement(c_child):             # <<<<<<<<<<<<<< 
 *             if c == index:
 *                 return c_child
 */
  __pyx_1 = _isElement(__pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":545
 *     while c_child is not NULL:
 *         if _isElement(c_child):
 *             if c == index:             # <<<<<<<<<<<<<< 
 *                 return c_child
 *             c = c + 1
 */
    __pyx_1 = (__pyx_v_c == __pyx_v_index);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":546
 *         if _isElement(c_child):
 *             if c == index:
 *                 return c_child             # <<<<<<<<<<<<<< 
 *             c = c + 1
 *         c_child = c_child.next
 */
      __pyx_r = __pyx_v_c_child;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":547
 *             if c == index:
 *                 return c_child
 *             c = c + 1             # <<<<<<<<<<<<<< 
 *         c_child = c_child.next
 *     return NULL
 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":548
 *                 return c_child
 *             c = c + 1
 *         c_child = c_child.next             # <<<<<<<<<<<<<< 
 *     return NULL
 * 
 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":549
 *             c = c + 1
 *         c_child = c_child.next
 *     return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _findChildBackwards(xmlNode* c_node, Py_ssize_t index):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":551
 *     return NULL
 * 
 * cdef xmlNode* _findChildBackwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     """Return child element of c_node with index, or return NULL if not found.
 *     Search from the end.
 */

static  xmlNode *__pyx_f_4lxml_5etree__findChildBackwards(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_v_c_child;
Py_ssize_t __pyx_v_c;
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":557
 *     cdef xmlNode* c_child
 *     cdef Py_ssize_t c
 *     c_child = c_node.last             # <<<<<<<<<<<<<< 
 *     c = 0
 *     while c_child is not NULL:
 */
__pyx_v_c_child = __pyx_v_c_node->last;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":558
 *     cdef Py_ssize_t c
 *     c_child = c_node.last
 *     c = 0             # <<<<<<<<<<<<<< 
 *     while c_child is not NULL:
 *         if _isElement(c_child):
 */
__pyx_v_c = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":559
 *     c_child = c_node.last
 *     c = 0
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_child):
 *             if c == index:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":559
 *     c_child = c_node.last
 *     c = 0
 *     while c_child is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_child):
 *             if c == index:
 */
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":560
 *     c = 0
 *     while c_child is not NULL:
 *         if _isElement(c_child):             # <<<<<<<<<<<<<< 
 *             if c == index:
 *                 return c_child
 */
  __pyx_1 = _isElement(__pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":561
 *     while c_child is not NULL:
 *         if _isElement(c_child):
 *             if c == index:             # <<<<<<<<<<<<<< 
 *                 return c_child
 *             c = c + 1
 */
    __pyx_1 = (__pyx_v_c == __pyx_v_index);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":562
 *         if _isElement(c_child):
 *             if c == index:
 *                 return c_child             # <<<<<<<<<<<<<< 
 *             c = c + 1
 *         c_child = c_child.prev
 */
      __pyx_r = __pyx_v_c_child;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":563
 *             if c == index:
 *                 return c_child
 *             c = c + 1             # <<<<<<<<<<<<<< 
 *         c_child = c_child.prev
 *     return NULL
 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":564
 *                 return c_child
 *             c = c + 1
 *         c_child = c_child.prev             # <<<<<<<<<<<<<< 
 *     return NULL
 *     
 */
  __pyx_v_c_child = __pyx_v_c_child->prev;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":565
 *             c = c + 1
 *         c_child = c_child.prev
 *     return NULL             # <<<<<<<<<<<<<< 
 *     
 * cdef xmlNode* _textNodeOrSkip(xmlNode* c_node):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":567
 *     return NULL
 *     
 * cdef xmlNode* _textNodeOrSkip(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Return the node if it's a text node.  Skip over ignorable nodes in a
 *     series of text nodes.  Return NULL if a non-ignorable node is found.
 */

static  xmlNode *__pyx_f_4lxml_5etree__textNodeOrSkip(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":574
 *     nodes.
 *     """
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_node.type == tree.XML_TEXT_NODE:
 *             return c_node
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":574
 *     nodes.
 *     """
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_node.type == tree.XML_TEXT_NODE:
 *             return c_node
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":575
 *     """
 *     while c_node is not NULL:
 *         if c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<< 
 *             return c_node
 *         elif c_node.type == tree.XML_XINCLUDE_START or \
 */
  __pyx_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":576
 *     while c_node is not NULL:
 *         if c_node.type == tree.XML_TEXT_NODE:
 *             return c_node             # <<<<<<<<<<<<<< 
 *         elif c_node.type == tree.XML_XINCLUDE_START or \
 *                  c_node.type == tree.XML_XINCLUDE_END:
 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":577
 *         if c_node.type == tree.XML_TEXT_NODE:
 *             return c_node
 *         elif c_node.type == tree.XML_XINCLUDE_START or \             # <<<<<<<<<<<<<< 
 *                  c_node.type == tree.XML_XINCLUDE_END:
 *             c_node = c_node.next
 */
  __pyx_1 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":578
 *             return c_node
 *         elif c_node.type == tree.XML_XINCLUDE_START or \
 *                  c_node.type == tree.XML_XINCLUDE_END:             # <<<<<<<<<<<<<< 
 *             c_node = c_node.next
 *         else:
 */
    __pyx_1 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":579
 *         elif c_node.type == tree.XML_XINCLUDE_START or \
 *                  c_node.type == tree.XML_XINCLUDE_END:
 *             c_node = c_node.next             # <<<<<<<<<<<<<< 
 *         else:
 *             return NULL
 */
    __pyx_v_c_node = __pyx_v_c_node->next;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":581
 *             c_node = c_node.next
 *         else:
 *             return NULL             # <<<<<<<<<<<<<< 
 *     return NULL
 * 
 */
    __pyx_r = NULL;
    goto __pyx_L0;
  }
  __pyx_L4:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":582
 *         else:
 *             return NULL
 *     return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _nextElement(xmlNode* c_node):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":584
 *     return NULL
 * 
 * cdef xmlNode* _nextElement(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Given a node, find the next sibling that is an element.
 *     """
 */

static  xmlNode *__pyx_f_4lxml_5etree__nextElement(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":587
 *     """Given a node, find the next sibling that is an element.
 *     """
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return NULL
 *     c_node = c_node.next
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":588
 *     """
 *     if c_node is NULL:
 *         return NULL             # <<<<<<<<<<<<<< 
 *     c_node = c_node.next
 *     while c_node is not NULL:
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":589
 *     if c_node is NULL:
 *         return NULL
 *     c_node = c_node.next             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 */
__pyx_v_c_node = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":590
 *         return NULL
 *     c_node = c_node.next
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             return c_node
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":590
 *         return NULL
 *     c_node = c_node.next
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             return c_node
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":591
 *     c_node = c_node.next
 *     while c_node is not NULL:
 *         if _isElement(c_node):             # <<<<<<<<<<<<<< 
 *             return c_node
 *         c_node = c_node.next
 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":592
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 *             return c_node             # <<<<<<<<<<<<<< 
 *         c_node = c_node.next
 *     return NULL
 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":593
 *         if _isElement(c_node):
 *             return c_node
 *         c_node = c_node.next             # <<<<<<<<<<<<<< 
 *     return NULL
 * 
 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":594
 *             return c_node
 *         c_node = c_node.next
 *     return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _previousElement(xmlNode* c_node):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":596
 *     return NULL
 * 
 * cdef xmlNode* _previousElement(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     """Given a node, find the next sibling that is an element.
 *     """
 */

static  xmlNode *__pyx_f_4lxml_5etree__previousElement(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":599
 *     """Given a node, find the next sibling that is an element.
 *     """
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return NULL
 *     c_node = c_node.prev
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":600
 *     """
 *     if c_node is NULL:
 *         return NULL             # <<<<<<<<<<<<<< 
 *     c_node = c_node.prev
 *     while c_node is not NULL:
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":601
 *     if c_node is NULL:
 *         return NULL
 *     c_node = c_node.prev             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 */
__pyx_v_c_node = __pyx_v_c_node->prev;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":602
 *         return NULL
 *     c_node = c_node.prev
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             return c_node
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":602
 *         return NULL
 *     c_node = c_node.prev
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             return c_node
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":603
 *     c_node = c_node.prev
 *     while c_node is not NULL:
 *         if _isElement(c_node):             # <<<<<<<<<<<<<< 
 *             return c_node
 *         c_node = c_node.prev
 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":604
 *     while c_node is not NULL:
 *         if _isElement(c_node):
 *             return c_node             # <<<<<<<<<<<<<< 
 *         c_node = c_node.prev
 *     return NULL
 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":605
 *         if _isElement(c_node):
 *             return c_node
 *         c_node = c_node.prev             # <<<<<<<<<<<<<< 
 *     return NULL
 * 
 */
  __pyx_v_c_node = __pyx_v_c_node->prev;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":606
 *             return c_node
 *         c_node = c_node.prev
 *     return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _parentElement(xmlNode* c_node):
 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":608
 *     return NULL
 * 
 * cdef xmlNode* _parentElement(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     "Given a node, find the parent element."
 *     if c_node is NULL or not _isElement(c_node):
 */

static  xmlNode *__pyx_f_4lxml_5etree__parentElement(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":610
 * cdef xmlNode* _parentElement(xmlNode* c_node):
 *     "Given a node, find the parent element."
 *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *         return NULL
 *     c_node = c_node.parent
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":610
 * cdef xmlNode* _parentElement(xmlNode* c_node):
 *     "Given a node, find the parent element."
 *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *         return NULL
 *     c_node = c_node.parent
 */
  __pyx_1 = (!_isElement(__pyx_v_c_node));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":611
 *     "Given a node, find the parent element."
 *     if c_node is NULL or not _isElement(c_node):
 *         return NULL             # <<<<<<<<<<<<<< 
 *     c_node = c_node.parent
 *     if c_node is NULL or not _isElement(c_node):
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":612
 *     if c_node is NULL or not _isElement(c_node):
 *         return NULL
 *     c_node = c_node.parent             # <<<<<<<<<<<<<< 
 *     if c_node is NULL or not _isElement(c_node):
 *         return NULL
 */
__pyx_v_c_node = __pyx_v_c_node->parent;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":613
 *         return NULL
 *     c_node = c_node.parent
 *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *         return NULL
 *     return c_node
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":613
 *         return NULL
 *     c_node = c_node.parent
 *     if c_node is NULL or not _isElement(c_node):             # <<<<<<<<<<<<<< 
 *         return NULL
 *     return c_node
 */
  __pyx_1 = (!_isElement(__pyx_v_c_node));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":614
 *     c_node = c_node.parent
 *     if c_node is NULL or not _isElement(c_node):
 *         return NULL             # <<<<<<<<<<<<<< 
 *     return c_node
 * 
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":615
 *     if c_node is NULL or not _isElement(c_node):
 *         return NULL
 *     return c_node             # <<<<<<<<<<<<<< 
 * 
 * cdef bint _tagMatches(xmlNode* c_node, char* c_href, char* c_name):
 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":617
 *     return c_node
 * 
 * cdef bint _tagMatches(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<< 
 *     """Tests if the node matches namespace URI and tag name.
 * 
 */

static  int __pyx_f_4lxml_5etree__tagMatches(xmlNode *__pyx_v_c_node,char *__pyx_v_c_href,char *__pyx_v_c_name) {
char *__pyx_v_c_node_href;
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":632
 *     """
 *     cdef char* c_node_href
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return 0
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":633
 *     cdef char* c_node_href
 *     if c_node is NULL:
 *         return 0             # <<<<<<<<<<<<<< 
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 *         # not an element, only succeed if we match everything
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":634
 *     if c_node is NULL:
 *         return 0
 *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *         # not an element, only succeed if we match everything
 *         return c_name is NULL and c_href is NULL
 */
__pyx_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":636
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 *         # not an element, only succeed if we match everything
 *         return c_name is NULL and c_href is NULL             # <<<<<<<<<<<<<< 
 *     if c_name is NULL:
 *         if c_href is NULL:
 */
  __pyx_1 = (__pyx_v_c_name == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":636
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 *         # not an element, only succeed if we match everything
 *         return c_name is NULL and c_href is NULL             # <<<<<<<<<<<<<< 
 *     if c_name is NULL:
 *         if c_href is NULL:
 */
    __pyx_1 = (__pyx_v_c_href == NULL);
  }
  __pyx_r = __pyx_1;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":637
 *         # not an element, only succeed if we match everything
 *         return c_name is NULL and c_href is NULL
 *     if c_name is NULL:             # <<<<<<<<<<<<<< 
 *         if c_href is NULL:
 *             # always match
 */
__pyx_1 = (__pyx_v_c_name == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":638
 *         return c_name is NULL and c_href is NULL
 *     if c_name is NULL:
 *         if c_href is NULL:             # <<<<<<<<<<<<<< 
 *             # always match
 *             return 1
 */
  __pyx_1 = (__pyx_v_c_href == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":640
 *         if c_href is NULL:
 *             # always match
 *             return 1             # <<<<<<<<<<<<<< 
 *         else:
 *             c_node_href = _getNs(c_node)
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":642
 *             return 1
 *         else:
 *             c_node_href = _getNs(c_node)             # <<<<<<<<<<<<<< 
 *             if c_node_href is NULL:
 *                 return c_href[0] == c'\0'
 */
    __pyx_v_c_node_href = _getNs(__pyx_v_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":643
 *         else:
 *             c_node_href = _getNs(c_node)
 *             if c_node_href is NULL:             # <<<<<<<<<<<<<< 
 *                 return c_href[0] == c'\0'
 *             else:
 */
    __pyx_1 = (__pyx_v_c_node_href == NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":644
 *             c_node_href = _getNs(c_node)
 *             if c_node_href is NULL:
 *                 return c_href[0] == c'\0'             # <<<<<<<<<<<<<< 
 *             else:
 *                 return cstd.strcmp(c_node_href, c_href) == 0
 */
      __pyx_r = ((__pyx_v_c_href[0]) == '\0');
      goto __pyx_L0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":646
 *                 return c_href[0] == c'\0'
 *             else:
 *                 return cstd.strcmp(c_node_href, c_href) == 0             # <<<<<<<<<<<<<< 
 *     elif c_href is NULL:
 *         if _getNs(c_node) is not NULL:
 */
      __pyx_r = (strcmp(__pyx_v_c_node_href,__pyx_v_c_href) == 0);
      goto __pyx_L0;
    }
    __pyx_L6:;
  }
  __pyx_L5:;
  goto __pyx_L4;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":647
 *             else:
 *                 return cstd.strcmp(c_node_href, c_href) == 0
 *     elif c_href is NULL:             # <<<<<<<<<<<<<< 
 *         if _getNs(c_node) is not NULL:
 *             return 0
 */
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":648
 *                 return cstd.strcmp(c_node_href, c_href) == 0
 *     elif c_href is NULL:
 *         if _getNs(c_node) is not NULL:             # <<<<<<<<<<<<<< 
 *             return 0
 *         return cstd.strcmp(c_node.name, c_name) == 0
 */
  __pyx_1 = (_getNs(__pyx_v_c_node) != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":649
 *     elif c_href is NULL:
 *         if _getNs(c_node) is not NULL:
 *             return 0             # <<<<<<<<<<<<<< 
 *         return cstd.strcmp(c_node.name, c_name) == 0
 *     elif cstd.strcmp(c_node.name, c_name) == 0:
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":650
 *         if _getNs(c_node) is not NULL:
 *             return 0
 *         return cstd.strcmp(c_node.name, c_name) == 0             # <<<<<<<<<<<<<< 
 *     elif cstd.strcmp(c_node.name, c_name) == 0:
 *         c_node_href = _getNs(c_node)
 */
  __pyx_r = (strcmp(__pyx_v_c_node->name,__pyx_v_c_name) == 0);
  goto __pyx_L0;
  goto __pyx_L4;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":651
 *             return 0
 *         return cstd.strcmp(c_node.name, c_name) == 0
 *     elif cstd.strcmp(c_node.name, c_name) == 0:             # <<<<<<<<<<<<<< 
 *         c_node_href = _getNs(c_node)
 *         if c_node_href is NULL:
 */
__pyx_1 = (strcmp(__pyx_v_c_node->name,__pyx_v_c_name) == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":652
 *         return cstd.strcmp(c_node.name, c_name) == 0
 *     elif cstd.strcmp(c_node.name, c_name) == 0:
 *         c_node_href = _getNs(c_node)             # <<<<<<<<<<<<<< 
 *         if c_node_href is NULL:
 *             return c_href[0] == c'\0'
 */
  __pyx_v_c_node_href = _getNs(__pyx_v_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":653
 *     elif cstd.strcmp(c_node.name, c_name) == 0:
 *         c_node_href = _getNs(c_node)
 *         if c_node_href is NULL:             # <<<<<<<<<<<<<< 
 *             return c_href[0] == c'\0'
 *         else:
 */
  __pyx_1 = (__pyx_v_c_node_href == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":654
 *         c_node_href = _getNs(c_node)
 *         if c_node_href is NULL:
 *             return c_href[0] == c'\0'             # <<<<<<<<<<<<<< 
 *         else:
 *             return cstd.strcmp(c_node_href, c_href) == 0
 */
    __pyx_r = ((__pyx_v_c_href[0]) == '\0');
    goto __pyx_L0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":656
 *             return c_href[0] == c'\0'
 *         else:
 *             return cstd.strcmp(c_node_href, c_href) == 0             # <<<<<<<<<<<<<< 
 *     else:
 *         return 0
 */
    __pyx_r = (strcmp(__pyx_v_c_node_href,__pyx_v_c_href) == 0);
    goto __pyx_L0;
  }
  __pyx_L8:;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":658
 *             return cstd.strcmp(c_node_href, c_href) == 0
 *     else:
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _removeNode(_Document doc, xmlNode* c_node) except -1:
 */
  __pyx_r = 0;
  goto __pyx_L0;
}
__pyx_L4:;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":660
 *         return 0
 * 
 * cdef int _removeNode(_Document doc, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<< 
 *     """Unlink and free a node and subnodes if possible.  Otherwise, make sure
 *     it's self-contained.
 */

static  int __pyx_f_4lxml_5etree__removeNode(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_v_c_next;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":665
 *     """
 *     cdef xmlNode* c_next
 *     c_next = c_node.next             # <<<<<<<<<<<<<< 
 *     tree.xmlUnlinkNode(c_node)
 *     _moveTail(c_next, c_node)
 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":666
 *     cdef xmlNode* c_next
 *     c_next = c_node.next
 *     tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<< 
 *     _moveTail(c_next, c_node)
 *     if not attemptDeallocation(c_node):
 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":667
 *     c_next = c_node.next
 *     tree.xmlUnlinkNode(c_node)
 *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *     if not attemptDeallocation(c_node):
 *         # make namespaces absolute
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":668
 *     tree.xmlUnlinkNode(c_node)
 *     _moveTail(c_next, c_node)
 *     if not attemptDeallocation(c_node):             # <<<<<<<<<<<<<< 
 *         # make namespaces absolute
 *         moveNodeToDocument(doc, c_node)
 */
__pyx_1 = (!__pyx_f_4lxml_5etree_attemptDeallocation(__pyx_v_c_node));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":670
 *     if not attemptDeallocation(c_node):
 *         # make namespaces absolute
 *         moveNodeToDocument(doc, c_node)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 670; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":671
 *         # make namespaces absolute
 *         moveNodeToDocument(doc, c_node)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef void _moveTail(xmlNode* c_tail, xmlNode* c_target):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._removeNode");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":673
 *     return 0
 * 
 * cdef void _moveTail(xmlNode* c_tail, xmlNode* c_target):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_next
 *     # tail support: look for any text nodes trailing this node and 
 */

static  void __pyx_f_4lxml_5etree__moveTail(xmlNode *__pyx_v_c_tail,xmlNode *__pyx_v_c_target) {
xmlNode *__pyx_v_c_next;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":677
 *     # tail support: look for any text nodes trailing this node and 
 *     # move them too
 *     c_tail = _textNodeOrSkip(c_tail)             # <<<<<<<<<<<<<< 
 *     while c_tail is not NULL:
 *         c_next = _textNodeOrSkip(c_tail.next)
 */
__pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":678
 *     # move them too
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:             # <<<<<<<<<<<<<< 
 *         c_next = _textNodeOrSkip(c_tail.next)
 *         tree.xmlUnlinkNode(c_tail)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":678
 *     # move them too
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:             # <<<<<<<<<<<<<< 
 *         c_next = _textNodeOrSkip(c_tail.next)
 *         tree.xmlUnlinkNode(c_tail)
 */
  __pyx_1 = (__pyx_v_c_tail != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":679
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:
 *         c_next = _textNodeOrSkip(c_tail.next)             # <<<<<<<<<<<<<< 
 *         tree.xmlUnlinkNode(c_tail)
 *         tree.xmlAddNextSibling(c_target, c_tail)
 */
  __pyx_v_c_next = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail->next);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":680
 *     while c_tail is not NULL:
 *         c_next = _textNodeOrSkip(c_tail.next)
 *         tree.xmlUnlinkNode(c_tail)             # <<<<<<<<<<<<<< 
 *         tree.xmlAddNextSibling(c_target, c_tail)
 *         c_target = c_tail
 */
  xmlUnlinkNode(__pyx_v_c_tail);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":681
 *         c_next = _textNodeOrSkip(c_tail.next)
 *         tree.xmlUnlinkNode(c_tail)
 *         tree.xmlAddNextSibling(c_target, c_tail)             # <<<<<<<<<<<<<< 
 *         c_target = c_tail
 *         c_tail = c_next
 */
  xmlAddNextSibling(__pyx_v_c_target,__pyx_v_c_tail);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":682
 *         tree.xmlUnlinkNode(c_tail)
 *         tree.xmlAddNextSibling(c_target, c_tail)
 *         c_target = c_tail             # <<<<<<<<<<<<<< 
 *         c_tail = c_next
 * 
 */
  __pyx_v_c_target = __pyx_v_c_tail;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":683
 *         tree.xmlAddNextSibling(c_target, c_tail)
 *         c_target = c_tail
 *         c_tail = c_next             # <<<<<<<<<<<<<< 
 * 
 * cdef void _copyTail(xmlNode* c_tail, xmlNode* c_target):
 */
  __pyx_v_c_tail = __pyx_v_c_next;
}

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":685
 *         c_tail = c_next
 * 
 * cdef void _copyTail(xmlNode* c_tail, xmlNode* c_target):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_new_tail
 *     # tail copying support: look for any text nodes trailing this node and
 */

static  void __pyx_f_4lxml_5etree__copyTail(xmlNode *__pyx_v_c_tail,xmlNode *__pyx_v_c_target) {
xmlNode *__pyx_v_c_new_tail;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":689
 *     # tail copying support: look for any text nodes trailing this node and
 *     # copy it to the target node
 *     c_tail = _textNodeOrSkip(c_tail)             # <<<<<<<<<<<<<< 
 *     while c_tail is not NULL:
 *         if c_target.doc is not c_tail.doc:
 */
__pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":690
 *     # copy it to the target node
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_target.doc is not c_tail.doc:
 *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":690
 *     # copy it to the target node
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_target.doc is not c_tail.doc:
 *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
 */
  __pyx_1 = (__pyx_v_c_tail != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":691
 *     c_tail = _textNodeOrSkip(c_tail)
 *     while c_tail is not NULL:
 *         if c_target.doc is not c_tail.doc:             # <<<<<<<<<<<<<< 
 *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
 *         else:
 */
  __pyx_1 = (__pyx_v_c_target->doc != __pyx_v_c_tail->doc);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":692
 *     while c_tail is not NULL:
 *         if c_target.doc is not c_tail.doc:
 *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
 */
    __pyx_v_c_new_tail = xmlDocCopyNode(__pyx_v_c_tail,__pyx_v_c_target->doc,0);
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":694
 *             c_new_tail = tree.xmlDocCopyNode(c_tail, c_target.doc, 0)
 *         else:
 *             c_new_tail = tree.xmlCopyNode(c_tail, 0)             # <<<<<<<<<<<<<< 
 *         tree.xmlAddNextSibling(c_target, c_new_tail)
 *         c_target = c_new_tail
 */
    __pyx_v_c_new_tail = xmlCopyNode(__pyx_v_c_tail,0);
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":695
 *         else:
 *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
 *         tree.xmlAddNextSibling(c_target, c_new_tail)             # <<<<<<<<<<<<<< 
 *         c_target = c_new_tail
 *         c_tail = _textNodeOrSkip(c_tail.next)
 */
  xmlAddNextSibling(__pyx_v_c_target,__pyx_v_c_new_tail);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":696
 *             c_new_tail = tree.xmlCopyNode(c_tail, 0)
 *         tree.xmlAddNextSibling(c_target, c_new_tail)
 *         c_target = c_new_tail             # <<<<<<<<<<<<<< 
 *         c_tail = _textNodeOrSkip(c_tail.next)
 * 
 */
  __pyx_v_c_target = __pyx_v_c_new_tail;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":697
 *         tree.xmlAddNextSibling(c_target, c_new_tail)
 *         c_target = c_new_tail
 *         c_tail = _textNodeOrSkip(c_tail.next)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _deleteSlice(_Document doc, xmlNode* c_node,
 */
  __pyx_v_c_tail = __pyx_f_4lxml_5etree__textNodeOrSkip(__pyx_v_c_tail->next);
}

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":699
 *         c_tail = _textNodeOrSkip(c_tail.next)
 * 
 * cdef int _deleteSlice(_Document doc, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                       Py_ssize_t count, Py_ssize_t step) except -1:
 *     """Delete slice, ``count`` items starting with ``c_node`` with a step
 */

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) {
xmlNode *__pyx_v_c_next;
Py_ssize_t __pyx_v_c;
Py_ssize_t __pyx_v_i;
_node_to_node_function __pyx_v_next_element;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":707
 *     cdef Py_ssize_t c, i
 *     cdef _node_to_node_function next_element
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return 0
 *     if step > 0:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":708
 *     cdef _node_to_node_function next_element
 *     if c_node is NULL:
 *         return 0             # <<<<<<<<<<<<<< 
 *     if step > 0:
 *         next_element = _nextElement
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":709
 *     if c_node is NULL:
 *         return 0
 *     if step > 0:             # <<<<<<<<<<<<<< 
 *         next_element = _nextElement
 *     else:
 */
__pyx_1 = (__pyx_v_step > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":710
 *         return 0
 *     if step > 0:
 *         next_element = _nextElement             # <<<<<<<<<<<<<< 
 *     else:
 *         step = -step
 */
  __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":712
 *         next_element = _nextElement
 *     else:
 *         step = -step             # <<<<<<<<<<<<<< 
 *         next_element = _previousElement
 *     # now start deleting nodes
 */
  __pyx_v_step = (-__pyx_v_step);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":713
 *     else:
 *         step = -step
 *         next_element = _previousElement             # <<<<<<<<<<<<<< 
 *     # now start deleting nodes
 *     c = 0
 */
  __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":715
 *         next_element = _previousElement
 *     # now start deleting nodes
 *     c = 0             # <<<<<<<<<<<<<< 
 *     c_next = c_node
 *     while c_node is not NULL and c < count:
 */
__pyx_v_c = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":716
 *     # now start deleting nodes
 *     c = 0
 *     c_next = c_node             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL and c < count:
 *         for i from 0 <= i < step:
 */
__pyx_v_c_next = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":717
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < count:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":717
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < count:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":717
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < count:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
    __pyx_1 = (__pyx_v_c < __pyx_v_count);
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":718
 *     c_next = c_node
 *     while c_node is not NULL and c < count:
 *         for i from 0 <= i < step:             # <<<<<<<<<<<<<< 
 *             c_next = next_element(c_next)
 *         _removeNode(doc, c_node)
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_step; __pyx_v_i++) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":719
 *     while c_node is not NULL and c < count:
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)             # <<<<<<<<<<<<<< 
 *         _removeNode(doc, c_node)
 *         c = c + 1
 */
    __pyx_v_c_next = __pyx_v_next_element(__pyx_v_c_next);
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":720
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 *         _removeNode(doc, c_node)             # <<<<<<<<<<<<<< 
 *         c = c + 1
 *         c_node = c_next
 */
  __pyx_2 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 720; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":721
 *             c_next = next_element(c_next)
 *         _removeNode(doc, c_node)
 *         c = c + 1             # <<<<<<<<<<<<<< 
 *         c_node = c_next
 *     return 0
 */
  __pyx_v_c = (__pyx_v_c + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":722
 *         _removeNode(doc, c_node)
 *         c = c + 1
 *         c_node = c_next             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_v_c_node = __pyx_v_c_next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":723
 *         c = c + 1
 *         c_node = c_next
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _replaceSlice(_Element parent, xmlNode* c_node,
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._deleteSlice");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":725
 *     return 0
 * 
 * cdef int _replaceSlice(_Element parent, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                        Py_ssize_t slicelength, Py_ssize_t step,
 *                        bint left_to_right, elements) except -1:
 */

static PyObject *__pyx_k424p;
static PyObject *__pyx_k425p;
static PyObject *__pyx_k426p;
static PyObject *__pyx_k427p;
static PyObject *__pyx_k428p;
static PyObject *__pyx_k429p;
static PyObject *__pyx_k430p;

static char __pyx_k424[] = "attempt to assign sequence of size %d to extended slice of size %d";
static char __pyx_k425[] = "Node must not be None";
static char __pyx_k426[] = "Node must not be None";
static char __pyx_k427[] = "Node must not be None";
static char __pyx_k428[] = "Node must not be None";
static char __pyx_k429[] = "Node must not be None";
static char __pyx_k430[] = "Node must not be None";

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) {
xmlNode *__pyx_v_c_orig_neighbour;
xmlNode *__pyx_v_c_next;
struct LxmlElement *__pyx_v_element;
Py_ssize_t __pyx_v_seqlength;
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_c;
_node_to_node_function __pyx_v_next_element;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
PyObject *__pyx_5 = 0;
int __pyx_6;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_elements);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":739
 *     cdef Py_ssize_t seqlength, i, c
 *     cdef _node_to_node_function next_element
 *     assert step > 0             # <<<<<<<<<<<<<< 
 *     if left_to_right:
 *         next_element = _nextElement
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":739
 *     cdef Py_ssize_t seqlength, i, c
 *     cdef _node_to_node_function next_element
 *     assert step > 0             # <<<<<<<<<<<<<< 
 *     if left_to_right:
 *         next_element = _nextElement
 */
if (unlikely(!(__pyx_v_step > 0))) {
  PyErr_SetNone(PyExc_AssertionError);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":740
 *     cdef _node_to_node_function next_element
 *     assert step > 0
 *     if left_to_right:             # <<<<<<<<<<<<<< 
 *         next_element = _nextElement
 *     else:
 */
__pyx_1 = __pyx_v_left_to_right;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":741
 *     assert step > 0
 *     if left_to_right:
 *         next_element = _nextElement             # <<<<<<<<<<<<<< 
 *     else:
 *         next_element = _previousElement
 */
  __pyx_v_next_element = __pyx_f_4lxml_5etree__nextElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":743
 *         next_element = _nextElement
 *     else:
 *         next_element = _previousElement             # <<<<<<<<<<<<<< 
 * 
 *     if not python.PyList_Check(elements) and \
 */
  __pyx_v_next_element = __pyx_f_4lxml_5etree__previousElement;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":745
 *         next_element = _previousElement
 * 
 *     if not python.PyList_Check(elements) and \             # <<<<<<<<<<<<<< 
 *             not python.PyTuple_Check(elements):
 *         elements = list(elements)
 */
__pyx_1 = (!PyList_Check(__pyx_v_elements));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":746
 * 
 *     if not python.PyList_Check(elements) and \
 *             not python.PyTuple_Check(elements):             # <<<<<<<<<<<<<< 
 *         elements = list(elements)
 * 
 */
  __pyx_1 = (!PyTuple_Check(__pyx_v_elements));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":747
 *     if not python.PyList_Check(elements) and \
 *             not python.PyTuple_Check(elements):
 *         elements = list(elements)             # <<<<<<<<<<<<<< 
 * 
 *     if step > 1:
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 747; goto __pyx_L1;}
  Py_INCREF(__pyx_v_elements);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_elements);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyList_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 747; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_elements);
  __pyx_v_elements = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":749
 *         elements = list(elements)
 * 
 *     if step > 1:             # <<<<<<<<<<<<<< 
 *         # *replacing* children stepwise with list => check size!
 *         seqlength = len(elements)
 */
__pyx_1 = (__pyx_v_step > 1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":751
 *     if step > 1:
 *         # *replacing* children stepwise with list => check size!
 *         seqlength = len(elements)             # <<<<<<<<<<<<<< 
 *         if seqlength != slicelength:
 *             raise ValueError(
 */
  __pyx_4 = PyObject_Length(__pyx_v_elements); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 751; goto __pyx_L1;}
  __pyx_v_seqlength = __pyx_4;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":752
 *         # *replacing* children stepwise with list => check size!
 *         seqlength = len(elements)
 *         if seqlength != slicelength:             # <<<<<<<<<<<<<< 
 *             raise ValueError(
 *                 "attempt to assign sequence of size %d "
 */
  __pyx_1 = (__pyx_v_seqlength != __pyx_v_slicelength);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":755
 *             raise ValueError(
 *                 "attempt to assign sequence of size %d "
 *                 "to extended slice of size %d" % (seqlength, c))             # <<<<<<<<<<<<<< 
 * 
 *     if c_node is NULL:
 */
    __pyx_2 = PyInt_FromSsize_t(__pyx_v_seqlength); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":755
 *             raise ValueError(
 *                 "attempt to assign sequence of size %d "
 *                 "to extended slice of size %d" % (seqlength, c))             # <<<<<<<<<<<<<< 
 * 
 *     if c_node is NULL:
 */
    __pyx_3 = PyInt_FromSsize_t(__pyx_v_c); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_3);
    __pyx_2 = 0;
    __pyx_3 = 0;
    __pyx_2 = PyNumber_Remainder(__pyx_k424p, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 755; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
    __pyx_2 = 0;
    __pyx_5 = PyObject_CallObject(__pyx_builtin_ValueError, __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __Pyx_Raise(__pyx_5, 0, 0);
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 753; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":757
 *                 "to extended slice of size %d" % (seqlength, c))
 * 
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         # no children yet => add all elements straight away
 *         if left_to_right:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":759
 *     if c_node is NULL:
 *         # no children yet => add all elements straight away
 *         if left_to_right:             # <<<<<<<<<<<<<< 
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"
 */
  __pyx_1 = __pyx_v_left_to_right;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":760
 *         # no children yet => add all elements straight away
 *         if left_to_right:
 *             for element in elements:             # <<<<<<<<<<<<<< 
 *                 assert element is not None, "Node must not be None"
 *                 _appendChild(parent, element)
 */
    if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_2 = __pyx_v_elements; Py_INCREF(__pyx_2); }
    else { __pyx_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; goto __pyx_L1;} }
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":760
 *         # no children yet => add all elements straight away
 *         if left_to_right:
 *             for element in elements:             # <<<<<<<<<<<<<< 
 *                 assert element is not None, "Node must not be None"
 *                 _appendChild(parent, element)
 */
      if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_3); }
      else {
        __pyx_3 = PyIter_Next(__pyx_2);
        if (!__pyx_3) {
          break;
        }
      }
      if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 760; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_element));
      __pyx_v_element = ((struct LxmlElement *)__pyx_3);
      __pyx_3 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":761
 *         if left_to_right:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _appendChild(parent, element)
 *         else:
 */
      #ifndef PYREX_WITHOUT_ASSERTIONS

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":761
 *         if left_to_right:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _appendChild(parent, element)
 *         else:
 */
      __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
      if (unlikely(!__pyx_1)) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":761
 *         if left_to_right:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _appendChild(parent, element)
 *         else:
 */
        PyErr_SetObject(PyExc_AssertionError, __pyx_k425p);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 761; goto __pyx_L1;}
      }
      #endif

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":762
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"
 *                 _appendChild(parent, element)             # <<<<<<<<<<<<<< 
 *         else:
 *             for element in elements:
 */
      __pyx_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent,__pyx_v_element); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 762; goto __pyx_L1;}
    }
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":764
 *                 _appendChild(parent, element)
 *         else:
 *             for element in elements:             # <<<<<<<<<<<<<< 
 *                 assert element is not None, "Node must not be None"
 *                 _prependChild(parent, element)
 */
    if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_5 = __pyx_v_elements; Py_INCREF(__pyx_5); }
    else { __pyx_5 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; goto __pyx_L1;} }
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":764
 *                 _appendChild(parent, element)
 *         else:
 *             for element in elements:             # <<<<<<<<<<<<<< 
 *                 assert element is not None, "Node must not be None"
 *                 _prependChild(parent, element)
 */
      if (PyList_CheckExact(__pyx_5)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_3 = PyList_GET_ITEM(__pyx_5, __pyx_4++); Py_INCREF(__pyx_3); }
      else {
        __pyx_3 = PyIter_Next(__pyx_5);
        if (!__pyx_3) {
          break;
        }
      }
      if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 764; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_element));
      __pyx_v_element = ((struct LxmlElement *)__pyx_3);
      __pyx_3 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":765
 *         else:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _prependChild(parent, element)
 *         return 0
 */
      #ifndef PYREX_WITHOUT_ASSERTIONS

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":765
 *         else:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _prependChild(parent, element)
 *         return 0
 */
      __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
      if (unlikely(!__pyx_1)) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":765
 *         else:
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *                 _prependChild(parent, element)
 *         return 0
 */
        PyErr_SetObject(PyExc_AssertionError, __pyx_k426p);
        {__pyx_filename = __pyx_f[2]; __pyx_lineno = 765; goto __pyx_L1;}
      }
      #endif

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":766
 *             for element in elements:
 *                 assert element is not None, "Node must not be None"
 *                 _prependChild(parent, element)             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
      __pyx_6 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent,__pyx_v_element); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 766; goto __pyx_L1;}
    }
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":767
 *                 assert element is not None, "Node must not be None"
 *                 _prependChild(parent, element)
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     # remove the elements first as some might be re-added
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":770
 * 
 *     # remove the elements first as some might be re-added
 *     if left_to_right:             # <<<<<<<<<<<<<< 
 *         # L->R, remember left neighbour
 *         c_orig_neighbour = _previousElement(c_node)
 */
__pyx_1 = __pyx_v_left_to_right;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":772
 *     if left_to_right:
 *         # L->R, remember left neighbour
 *         c_orig_neighbour = _previousElement(c_node)             # <<<<<<<<<<<<<< 
 *     else:
 *         # R->L, remember right neighbour
 */
  __pyx_v_c_orig_neighbour = __pyx_f_4lxml_5etree__previousElement(__pyx_v_c_node);
  goto __pyx_L12;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":775
 *     else:
 *         # R->L, remember right neighbour
 *         c_orig_neighbour = _nextElement(c_node)             # <<<<<<<<<<<<<< 
 * 
 *     c = 0
 */
  __pyx_v_c_orig_neighbour = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
}
__pyx_L12:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":777
 *         c_orig_neighbour = _nextElement(c_node)
 * 
 *     c = 0             # <<<<<<<<<<<<<< 
 *     c_next = c_node
 *     while c_node is not NULL and c < slicelength:
 */
__pyx_v_c = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":778
 * 
 *     c = 0
 *     c_next = c_node             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL and c < slicelength:
 *         for i from 0 <= i < step:
 */
__pyx_v_c_next = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":779
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":779
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":779
 *     c = 0
 *     c_next = c_node
 *     while c_node is not NULL and c < slicelength:             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 */
    __pyx_1 = (__pyx_v_c < __pyx_v_slicelength);
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":780
 *     c_next = c_node
 *     while c_node is not NULL and c < slicelength:
 *         for i from 0 <= i < step:             # <<<<<<<<<<<<<< 
 *             c_next = next_element(c_next)
 *         _removeNode(parent._doc, c_node)
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_step; __pyx_v_i++) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":781
 *     while c_node is not NULL and c < slicelength:
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)             # <<<<<<<<<<<<<< 
 *         _removeNode(parent._doc, c_node)
 *         c = c + 1
 */
    __pyx_v_c_next = __pyx_v_next_element(__pyx_v_c_next);
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":782
 *         for i from 0 <= i < step:
 *             c_next = next_element(c_next)
 *         _removeNode(parent._doc, c_node)             # <<<<<<<<<<<<<< 
 *         c = c + 1
 *         c_node = c_next
 */
  __pyx_6 = __pyx_f_4lxml_5etree__removeNode(__pyx_v_parent->_doc,__pyx_v_c_node); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 782; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":783
 *             c_next = next_element(c_next)
 *         _removeNode(parent._doc, c_node)
 *         c = c + 1             # <<<<<<<<<<<<<< 
 *         c_node = c_next
 * 
 */
  __pyx_v_c = (__pyx_v_c + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":784
 *         _removeNode(parent._doc, c_node)
 *         c = c + 1
 *         c_node = c_next             # <<<<<<<<<<<<<< 
 * 
 *     # make sure each element is inserted only once
 */
  __pyx_v_c_node = __pyx_v_c_next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":787
 * 
 *     # make sure each element is inserted only once
 *     elements = iter(elements)             # <<<<<<<<<<<<<< 
 * 
 *     # find the first node right of the new insertion point
 */
__pyx_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 787; goto __pyx_L1;}
Py_DECREF(__pyx_v_elements);
__pyx_v_elements = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":790
 * 
 *     # find the first node right of the new insertion point
 *     if left_to_right:             # <<<<<<<<<<<<<< 
 *         if c_orig_neighbour is not NULL:
 *             c_node = next_element(c_orig_neighbour)
 */
__pyx_1 = __pyx_v_left_to_right;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":791
 *     # find the first node right of the new insertion point
 *     if left_to_right:
 *         if c_orig_neighbour is not NULL:             # <<<<<<<<<<<<<< 
 *             c_node = next_element(c_orig_neighbour)
 *         else:
 */
  __pyx_1 = (__pyx_v_c_orig_neighbour != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":792
 *     if left_to_right:
 *         if c_orig_neighbour is not NULL:
 *             c_node = next_element(c_orig_neighbour)             # <<<<<<<<<<<<<< 
 *         else:
 *             # before the first element
 */
    __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_orig_neighbour);
    goto __pyx_L18;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":795
 *         else:
 *             # before the first element
 *             c_node = _findChildForwards(parent._c_node, 0)             # <<<<<<<<<<<<<< 
 *     elif c_orig_neighbour is NULL:
 *         # at the end, but reversed stepping
 */
    __pyx_v_c_node = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_parent->_c_node,0);
  }
  __pyx_L18:;
  goto __pyx_L17;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":796
 *             # before the first element
 *             c_node = _findChildForwards(parent._c_node, 0)
 *     elif c_orig_neighbour is NULL:             # <<<<<<<<<<<<<< 
 *         # at the end, but reversed stepping
 *         # append one element and go to the next insertion point
 */
__pyx_1 = (__pyx_v_c_orig_neighbour == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":799
 *         # at the end, but reversed stepping
 *         # append one element and go to the next insertion point
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)
 */
  if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_3 = __pyx_v_elements; Py_INCREF(__pyx_3); }
  else { __pyx_3 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":799
 *         # at the end, but reversed stepping
 *         # append one element and go to the next insertion point
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)
 */
    if (PyList_CheckExact(__pyx_3)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_5 = PyList_GET_ITEM(__pyx_3, __pyx_4++); Py_INCREF(__pyx_5); }
    else {
      __pyx_5 = PyIter_Next(__pyx_3);
      if (!__pyx_5) {
        break;
      }
    }
    if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 799; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_5);
    __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":800
 *         # append one element and go to the next insertion point
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *             c_node = element._c_node
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":800
 *         # append one element and go to the next insertion point
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *             c_node = element._c_node
 */
    __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
    if (unlikely(!__pyx_1)) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":800
 *         # append one element and go to the next insertion point
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *             c_node = element._c_node
 */
      PyErr_SetObject(PyExc_AssertionError, __pyx_k427p);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; goto __pyx_L1;}
    }
    #endif

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":801
 *         for element in elements:
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)             # <<<<<<<<<<<<<< 
 *             c_node = element._c_node
 *             if slicelength > 0:
 */
    __pyx_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent,__pyx_v_element); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 801; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":802
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)
 *             c_node = element._c_node             # <<<<<<<<<<<<<< 
 *             if slicelength > 0:
 *                 slicelength = slicelength - 1
 */
    __pyx_v_c_node = __pyx_v_element->_c_node;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":803
 *             _appendChild(parent, element)
 *             c_node = element._c_node
 *             if slicelength > 0:             # <<<<<<<<<<<<<< 
 *                 slicelength = slicelength - 1
 *                 for i from 1 <= i < step:
 */
    __pyx_1 = (__pyx_v_slicelength > 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":804
 *             c_node = element._c_node
 *             if slicelength > 0:
 *                 slicelength = slicelength - 1             # <<<<<<<<<<<<<< 
 *                 for i from 1 <= i < step:
 *                     c_node = next_element(c_node)
 */
      __pyx_v_slicelength = (__pyx_v_slicelength - 1);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":805
 *             if slicelength > 0:
 *                 slicelength = slicelength - 1
 *                 for i from 1 <= i < step:             # <<<<<<<<<<<<<< 
 *                     c_node = next_element(c_node)
 *             break
 */
      for (__pyx_v_i = 1; __pyx_v_i < __pyx_v_step; __pyx_v_i++) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":806
 *                 slicelength = slicelength - 1
 *                 for i from 1 <= i < step:
 *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<< 
 *             break
 * 
 */
        __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
      }
      goto __pyx_L21;
    }
    __pyx_L21:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":807
 *                 for i from 1 <= i < step:
 *                     c_node = next_element(c_node)
 *             break             # <<<<<<<<<<<<<< 
 * 
 *     if left_to_right:
 */
    goto __pyx_L20;
  }
  __pyx_L20:;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L17;
}
__pyx_L17:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":809
 *             break
 * 
 *     if left_to_right:             # <<<<<<<<<<<<<< 
 *         # adjust step size after removing slice as we are not stepping
 *         # over the newly inserted elements
 */
__pyx_1 = __pyx_v_left_to_right;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":812
 *         # adjust step size after removing slice as we are not stepping
 *         # over the newly inserted elements
 *         step = step - 1             # <<<<<<<<<<<<<< 
 * 
 *     # now insert elements where we removed them
 */
  __pyx_v_step = (__pyx_v_step - 1);
  goto __pyx_L24;
}
__pyx_L24:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":815
 * 
 *     # now insert elements where we removed them
 *     if c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         for element in elements:
 *             assert element is not None, "Node must not be None"
 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":816
 *     # now insert elements where we removed them
 *     if c_node is not NULL:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             # move element and tail over
 */
  if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_2 = __pyx_v_elements; Py_INCREF(__pyx_2); }
  else { __pyx_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":816
 *     # now insert elements where we removed them
 *     if c_node is not NULL:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             # move element and tail over
 */
    if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_5 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_5); }
    else {
      __pyx_5 = PyIter_Next(__pyx_2);
      if (!__pyx_5) {
        break;
      }
    }
    if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 816; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_5);
    __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":817
 *     if c_node is not NULL:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             # move element and tail over
 *             c_next = element._c_node.next
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":817
 *     if c_node is not NULL:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             # move element and tail over
 *             c_next = element._c_node.next
 */
    __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
    if (unlikely(!__pyx_1)) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":817
 *     if c_node is not NULL:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             # move element and tail over
 *             c_next = element._c_node.next
 */
      PyErr_SetObject(PyExc_AssertionError, __pyx_k428p);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 817; goto __pyx_L1;}
    }
    #endif

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":819
 *             assert element is not None, "Node must not be None"
 *             # move element and tail over
 *             c_next = element._c_node.next             # <<<<<<<<<<<<<< 
 *             tree.xmlAddPrevSibling(c_node, element._c_node)
 *             _moveTail(c_next, element._c_node)
 */
    __pyx_v_c_next = __pyx_v_element->_c_node->next;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":820
 *             # move element and tail over
 *             c_next = element._c_node.next
 *             tree.xmlAddPrevSibling(c_node, element._c_node)             # <<<<<<<<<<<<<< 
 *             _moveTail(c_next, element._c_node)
 * 
 */
    xmlAddPrevSibling(__pyx_v_c_node,__pyx_v_element->_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":821
 *             c_next = element._c_node.next
 *             tree.xmlAddPrevSibling(c_node, element._c_node)
 *             _moveTail(c_next, element._c_node)             # <<<<<<<<<<<<<< 
 * 
 *             # integrate element into new document
 */
    __pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_element->_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":824
 * 
 *             # integrate element into new document
 *             moveNodeToDocument(parent._doc, element._c_node)             # <<<<<<<<<<<<<< 
 * 
 *             # stop at the end of the slice
 */
    __pyx_6 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc,__pyx_v_element->_c_node); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 824; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":827
 * 
 *             # stop at the end of the slice
 *             if slicelength > 0:             # <<<<<<<<<<<<<< 
 *                 slicelength = slicelength - 1
 *                 for i from 0 <= i < step:
 */
    __pyx_1 = (__pyx_v_slicelength > 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":828
 *             # stop at the end of the slice
 *             if slicelength > 0:
 *                 slicelength = slicelength - 1             # <<<<<<<<<<<<<< 
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)
 */
      __pyx_v_slicelength = (__pyx_v_slicelength - 1);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":829
 *             if slicelength > 0:
 *                 slicelength = slicelength - 1
 *                 for i from 0 <= i < step:             # <<<<<<<<<<<<<< 
 *                     c_node = next_element(c_node)
 *                 if c_node is NULL:
 */
      for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_step; __pyx_v_i++) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":830
 *                 slicelength = slicelength - 1
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)             # <<<<<<<<<<<<<< 
 *                 if c_node is NULL:
 *                     break
 */
        __pyx_v_c_node = __pyx_v_next_element(__pyx_v_c_node);
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":831
 *                 for i from 0 <= i < step:
 *                     c_node = next_element(c_node)
 *                 if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                     break
 *         else:
 */
      __pyx_1 = (__pyx_v_c_node == NULL);
      if (__pyx_1) {
        goto __pyx_L27;
        goto __pyx_L31;
      }
      __pyx_L31:;
      goto __pyx_L28;
    }
    __pyx_L28:;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":835
 *         else:
 *             # everything inserted
 *             return 0             # <<<<<<<<<<<<<< 
 * 
 *     # append the remaining elements at the respective end
 */
    __pyx_r = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L27:;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L25;
}
__pyx_L25:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":838
 * 
 *     # append the remaining elements at the respective end
 *     if left_to_right:             # <<<<<<<<<<<<<< 
 *         for element in elements:
 *             assert element is not None, "Node must not be None"
 */
__pyx_1 = __pyx_v_left_to_right;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":839
 *     # append the remaining elements at the respective end
 *     if left_to_right:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)
 */
  if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_3 = __pyx_v_elements; Py_INCREF(__pyx_3); }
  else { __pyx_3 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":839
 *     # append the remaining elements at the respective end
 *     if left_to_right:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)
 */
    if (PyList_CheckExact(__pyx_3)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_5 = PyList_GET_ITEM(__pyx_3, __pyx_4++); Py_INCREF(__pyx_5); }
    else {
      __pyx_5 = PyIter_Next(__pyx_3);
      if (!__pyx_5) {
        break;
      }
    }
    if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 839; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_5);
    __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":840
 *     if left_to_right:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *     else:
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":840
 *     if left_to_right:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *     else:
 */
    __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
    if (unlikely(!__pyx_1)) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":840
 *     if left_to_right:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _appendChild(parent, element)
 *     else:
 */
      PyErr_SetObject(PyExc_AssertionError, __pyx_k429p);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 840; goto __pyx_L1;}
    }
    #endif

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":841
 *         for element in elements:
 *             assert element is not None, "Node must not be None"
 *             _appendChild(parent, element)             # <<<<<<<<<<<<<< 
 *     else:
 *         for element in elements:
 */
    __pyx_6 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent,__pyx_v_element); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 841; goto __pyx_L1;}
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L32;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":843
 *             _appendChild(parent, element)
 *     else:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _prependChild(parent, element)
 */
  if (PyList_CheckExact(__pyx_v_elements)) { __pyx_4 = 0; __pyx_2 = __pyx_v_elements; Py_INCREF(__pyx_2); }
  else { __pyx_2 = PyObject_GetIter(__pyx_v_elements); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":843
 *             _appendChild(parent, element)
 *     else:
 *         for element in elements:             # <<<<<<<<<<<<<< 
 *             assert element is not None, "Node must not be None"
 *             _prependChild(parent, element)
 */
    if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_5 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_5); }
    else {
      __pyx_5 = PyIter_Next(__pyx_2);
      if (!__pyx_5) {
        break;
      }
    }
    if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 843; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_5);
    __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":844
 *     else:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _prependChild(parent, element)
 * 
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":844
 *     else:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _prependChild(parent, element)
 * 
 */
    __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
    if (unlikely(!__pyx_1)) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":844
 *     else:
 *         for element in elements:
 *             assert element is not None, "Node must not be None"             # <<<<<<<<<<<<<< 
 *             _prependChild(parent, element)
 * 
 */
      PyErr_SetObject(PyExc_AssertionError, __pyx_k430p);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 844; goto __pyx_L1;}
    }
    #endif

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":845
 *         for element in elements:
 *             assert element is not None, "Node must not be None"
 *             _prependChild(parent, element)             # <<<<<<<<<<<<<< 
 * 
 *     return 0
 */
    __pyx_6 = __pyx_f_4lxml_5etree__prependChild(__pyx_v_parent,__pyx_v_element); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 845; goto __pyx_L1;}
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
__pyx_L32:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":847
 *             _prependChild(parent, element)
 * 
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _appendChild(_Element parent, _Element child) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._replaceSlice");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_elements);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":849
 *     return 0
 * 
 * cdef int _appendChild(_Element parent, _Element child) except -1:             # <<<<<<<<<<<<<< 
 *     """Append a new child to a parent element.
 *     """
 */

static  int __pyx_f_4lxml_5etree__appendChild(struct LxmlElement *__pyx_v_parent,struct LxmlElement *__pyx_v_child) {
xmlNode *__pyx_v_c_next;
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_child);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":854
 *     cdef xmlNode* c_next
 *     cdef xmlNode* c_node
 *     c_node = child._c_node             # <<<<<<<<<<<<<< 
 *     # store possible text node
 *     c_next = c_node.next
 */
__pyx_v_c_node = __pyx_v_child->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":856
 *     c_node = child._c_node
 *     # store possible text node
 *     c_next = c_node.next             # <<<<<<<<<<<<<< 
 *     # move node itself
 *     tree.xmlUnlinkNode(c_node)
 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":858
 *     c_next = c_node.next
 *     # move node itself
 *     tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<< 
 *     tree.xmlAddChild(parent._c_node, c_node)
 *     _moveTail(c_next, c_node)
 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":859
 *     # move node itself
 *     tree.xmlUnlinkNode(c_node)
 *     tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<< 
 *     _moveTail(c_next, c_node)
 *     # uh oh, elements may be pointing to different doc when
 */
xmlAddChild(__pyx_v_parent->_c_node,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":860
 *     tree.xmlUnlinkNode(c_node)
 *     tree.xmlAddChild(parent._c_node, c_node)
 *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":863
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 *     moveNodeToDocument(parent._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _prependChild(_Element parent, _Element child) except -1:
 */
__pyx_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc,__pyx_v_c_node); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 863; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._appendChild");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_child);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":865
 *     moveNodeToDocument(parent._doc, c_node)
 * 
 * cdef int _prependChild(_Element parent, _Element child) except -1:             # <<<<<<<<<<<<<< 
 *     """Prepend a new child to a parent element.
 *     """
 */

static  int __pyx_f_4lxml_5etree__prependChild(struct LxmlElement *__pyx_v_parent,struct LxmlElement *__pyx_v_child) {
xmlNode *__pyx_v_c_next;
xmlNode *__pyx_v_c_child;
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_child);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":871
 *     cdef xmlNode* c_child
 *     cdef xmlNode* c_node
 *     c_node = child._c_node             # <<<<<<<<<<<<<< 
 *     # store possible text node
 *     c_next = c_node.next
 */
__pyx_v_c_node = __pyx_v_child->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":873
 *     c_node = child._c_node
 *     # store possible text node
 *     c_next = c_node.next             # <<<<<<<<<<<<<< 
 *     # move node itself
 *     c_child = _findChildForwards(parent._c_node, 0)
 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":875
 *     c_next = c_node.next
 *     # move node itself
 *     c_child = _findChildForwards(parent._c_node, 0)             # <<<<<<<<<<<<<< 
 *     if c_child is NULL:
 *         tree.xmlUnlinkNode(c_node)
 */
__pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_parent->_c_node,0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":876
 *     # move node itself
 *     c_child = _findChildForwards(parent._c_node, 0)
 *     if c_child is NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlUnlinkNode(c_node)
 *         tree.xmlAddChild(parent._c_node, c_node)
 */
__pyx_1 = (__pyx_v_c_child == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":877
 *     c_child = _findChildForwards(parent._c_node, 0)
 *     if c_child is NULL:
 *         tree.xmlUnlinkNode(c_node)             # <<<<<<<<<<<<<< 
 *         tree.xmlAddChild(parent._c_node, c_node)
 *     else:
 */
  xmlUnlinkNode(__pyx_v_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":878
 *     if c_child is NULL:
 *         tree.xmlUnlinkNode(c_node)
 *         tree.xmlAddChild(parent._c_node, c_node)             # <<<<<<<<<<<<<< 
 *     else:
 *         tree.xmlAddPrevSibling(c_child, c_node)
 */
  xmlAddChild(__pyx_v_parent->_c_node,__pyx_v_c_node);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":880
 *         tree.xmlAddChild(parent._c_node, c_node)
 *     else:
 *         tree.xmlAddPrevSibling(c_child, c_node)             # <<<<<<<<<<<<<< 
 *     _moveTail(c_next, c_node)
 *     # uh oh, elements may be pointing to different doc when
 */
  xmlAddPrevSibling(__pyx_v_c_child,__pyx_v_c_node);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":881
 *     else:
 *         tree.xmlAddPrevSibling(c_child, c_node)
 *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":884
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 *     moveNodeToDocument(parent._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _appendSibling(_Element element, _Element sibling) except -1:
 */
__pyx_2 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_parent->_doc,__pyx_v_c_node); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 884; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._prependChild");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_child);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":886
 *     moveNodeToDocument(parent._doc, c_node)
 * 
 * cdef int _appendSibling(_Element element, _Element sibling) except -1:             # <<<<<<<<<<<<<< 
 *     """Append a new child to a parent element.
 *     """
 */

static  int __pyx_f_4lxml_5etree__appendSibling(struct LxmlElement *__pyx_v_element,struct LxmlElement *__pyx_v_sibling) {
xmlNode *__pyx_v_c_next;
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_sibling);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":891
 *     cdef xmlNode* c_next
 *     cdef xmlNode* c_node
 *     c_node = sibling._c_node             # <<<<<<<<<<<<<< 
 *     # store possible text node
 *     c_next = c_node.next
 */
__pyx_v_c_node = __pyx_v_sibling->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":893
 *     c_node = sibling._c_node
 *     # store possible text node
 *     c_next = c_node.next             # <<<<<<<<<<<<<< 
 *     # move node itself
 *     tree.xmlAddNextSibling(element._c_node, c_node)
 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":895
 *     c_next = c_node.next
 *     # move node itself
 *     tree.xmlAddNextSibling(element._c_node, c_node)             # <<<<<<<<<<<<<< 
 *     _moveTail(c_next, c_node)
 *     # uh oh, elements may be pointing to different doc when
 */
xmlAddNextSibling(__pyx_v_element->_c_node,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":896
 *     # move node itself
 *     tree.xmlAddNextSibling(element._c_node, c_node)
 *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":899
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 *     moveNodeToDocument(element._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _prependSibling(_Element element, _Element sibling) except -1:
 */
__pyx_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_element->_doc,__pyx_v_c_node); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 899; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._appendSibling");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_sibling);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":901
 *     moveNodeToDocument(element._doc, c_node)
 * 
 * cdef int _prependSibling(_Element element, _Element sibling) except -1:             # <<<<<<<<<<<<<< 
 *     """Append a new child to a parent element.
 *     """
 */

static  int __pyx_f_4lxml_5etree__prependSibling(struct LxmlElement *__pyx_v_element,struct LxmlElement *__pyx_v_sibling) {
xmlNode *__pyx_v_c_next;
xmlNode *__pyx_v_c_node;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_sibling);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":906
 *     cdef xmlNode* c_next
 *     cdef xmlNode* c_node
 *     c_node = sibling._c_node             # <<<<<<<<<<<<<< 
 *     # store possible text node
 *     c_next = c_node.next
 */
__pyx_v_c_node = __pyx_v_sibling->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":908
 *     c_node = sibling._c_node
 *     # store possible text node
 *     c_next = c_node.next             # <<<<<<<<<<<<<< 
 *     # move node itself
 *     tree.xmlAddPrevSibling(element._c_node, c_node)
 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":910
 *     c_next = c_node.next
 *     # move node itself
 *     tree.xmlAddPrevSibling(element._c_node, c_node)             # <<<<<<<<<<<<<< 
 *     _moveTail(c_next, c_node)
 *     # uh oh, elements may be pointing to different doc when
 */
xmlAddPrevSibling(__pyx_v_element->_c_node,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":911
 *     # move node itself
 *     tree.xmlAddPrevSibling(element._c_node, c_node)
 *     _moveTail(c_next, c_node)             # <<<<<<<<<<<<<< 
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 */
__pyx_f_4lxml_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":914
 *     # uh oh, elements may be pointing to different doc when
 *     # parent element has moved; change them too..
 *     moveNodeToDocument(element._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef int isutf8(char* s):
 */
__pyx_1 = __pyx_f_4lxml_5etree_moveNodeToDocument(__pyx_v_element->_doc,__pyx_v_c_node); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 914; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._prependSibling");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_sibling);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":916
 *     moveNodeToDocument(element._doc, c_node)
 * 
 * cdef int isutf8(char* s):             # <<<<<<<<<<<<<< 
 *     cdef char c
 *     c = s[0]
 */

static  int __pyx_f_4lxml_5etree_isutf8(char *__pyx_v_s) {
char __pyx_v_c;
int __pyx_r;
int __pyx_1;
long __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":918
 * cdef int isutf8(char* s):
 *     cdef char c
 *     c = s[0]             # <<<<<<<<<<<<<< 
 *     while c != c'\0':
 *         if c & 0x80:
 */
__pyx_v_c = (__pyx_v_s[0]);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":919
 *     cdef char c
 *     c = s[0]
 *     while c != c'\0':             # <<<<<<<<<<<<<< 
 *         if c & 0x80:
 *             return 1
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":919
 *     cdef char c
 *     c = s[0]
 *     while c != c'\0':             # <<<<<<<<<<<<<< 
 *         if c & 0x80:
 *             return 1
 */
  __pyx_1 = (__pyx_v_c != '\0');
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":920
 *     c = s[0]
 *     while c != c'\0':
 *         if c & 0x80:             # <<<<<<<<<<<<<< 
 *             return 1
 *         s = s + 1
 */
  __pyx_2 = (__pyx_v_c & 0x80);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":921
 *     while c != c'\0':
 *         if c & 0x80:
 *             return 1             # <<<<<<<<<<<<<< 
 *         s = s + 1
 *         c = s[0]
 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":922
 *         if c & 0x80:
 *             return 1
 *         s = s + 1             # <<<<<<<<<<<<<< 
 *         c = s[0]
 *     return 0
 */
  __pyx_v_s = (__pyx_v_s + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":923
 *             return 1
 *         s = s + 1
 *         c = s[0]             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_v_c = (__pyx_v_s[0]);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":924
 *         s = s + 1
 *         c = s[0]
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int isutf8py(pystring):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":926
 *     return 0
 * 
 * cdef int isutf8py(pystring):             # <<<<<<<<<<<<<< 
 *     cdef char* s
 *     cdef char* c_end
 */

static  int __pyx_f_4lxml_5etree_isutf8py(PyObject *__pyx_v_pystring) {
char *__pyx_v_s;
char *__pyx_v_c_end;
char __pyx_v_c;
int __pyx_v_is_non_ascii;
int __pyx_r;
int __pyx_1;
long __pyx_2;
Py_INCREF(__pyx_v_pystring);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":931
 *     cdef char c
 *     cdef bint is_non_ascii
 *     s = _cstr(pystring)             # <<<<<<<<<<<<<< 
 *     c_end = s + python.PyString_GET_SIZE(pystring)
 *     is_non_ascii = 0
 */
__pyx_v_s = _cstr(__pyx_v_pystring);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":932
 *     cdef bint is_non_ascii
 *     s = _cstr(pystring)
 *     c_end = s + python.PyString_GET_SIZE(pystring)             # <<<<<<<<<<<<<< 
 *     is_non_ascii = 0
 *     while s < c_end:
 */
__pyx_v_c_end = (__pyx_v_s + PyString_GET_SIZE(__pyx_v_pystring));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":933
 *     s = _cstr(pystring)
 *     c_end = s + python.PyString_GET_SIZE(pystring)
 *     is_non_ascii = 0             # <<<<<<<<<<<<<< 
 *     while s < c_end:
 *         c = s[0]
 */
__pyx_v_is_non_ascii = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":934
 *     c_end = s + python.PyString_GET_SIZE(pystring)
 *     is_non_ascii = 0
 *     while s < c_end:             # <<<<<<<<<<<<<< 
 *         c = s[0]
 *         if c & 0x80:
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":934
 *     c_end = s + python.PyString_GET_SIZE(pystring)
 *     is_non_ascii = 0
 *     while s < c_end:             # <<<<<<<<<<<<<< 
 *         c = s[0]
 *         if c & 0x80:
 */
  __pyx_1 = (__pyx_v_s < __pyx_v_c_end);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":935
 *     is_non_ascii = 0
 *     while s < c_end:
 *         c = s[0]             # <<<<<<<<<<<<<< 
 *         if c & 0x80:
 *             is_non_ascii = 1
 */
  __pyx_v_c = (__pyx_v_s[0]);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":936
 *     while s < c_end:
 *         c = s[0]
 *         if c & 0x80:             # <<<<<<<<<<<<<< 
 *             is_non_ascii = 1
 *         elif c == c'\0':
 */
  __pyx_2 = (__pyx_v_c & 0x80);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":937
 *         c = s[0]
 *         if c & 0x80:
 *             is_non_ascii = 1             # <<<<<<<<<<<<<< 
 *         elif c == c'\0':
 *             return -1 # invalid!
 */
    __pyx_v_is_non_ascii = 1;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":938
 *         if c & 0x80:
 *             is_non_ascii = 1
 *         elif c == c'\0':             # <<<<<<<<<<<<<< 
 *             return -1 # invalid!
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):
 */
  __pyx_1 = (__pyx_v_c == '\0');
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":939
 *             is_non_ascii = 1
 *         elif c == c'\0':
 *             return -1 # invalid!             # <<<<<<<<<<<<<< 
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):
 *             return -1 # invalid!
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":940
 *         elif c == c'\0':
 *             return -1 # invalid!
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):             # <<<<<<<<<<<<<< 
 *             return -1 # invalid!
 *         s = s + 1
 */
  __pyx_1 = (__pyx_v_is_non_ascii == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":940
 *         elif c == c'\0':
 *             return -1 # invalid!
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):             # <<<<<<<<<<<<<< 
 *             return -1 # invalid!
 *         s = s + 1
 */
    __pyx_1 = (!xmlIsChar_ch(__pyx_v_c));
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":941
 *             return -1 # invalid!
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):
 *             return -1 # invalid!             # <<<<<<<<<<<<<< 
 *         s = s + 1
 *     return is_non_ascii
 */
    __pyx_r = -1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":942
 *         elif is_non_ascii == 0 and not tree.xmlIsChar_ch(c):
 *             return -1 # invalid!
 *         s = s + 1             # <<<<<<<<<<<<<< 
 *     return is_non_ascii
 * 
 */
  __pyx_v_s = (__pyx_v_s + 1);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":943
 *             return -1 # invalid!
 *         s = s + 1
 *     return is_non_ascii             # <<<<<<<<<<<<<< 
 * 
 * cdef object funicode(char* s):
 */
__pyx_r = __pyx_v_is_non_ascii;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_pystring);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":945
 *     return is_non_ascii
 * 
 * cdef object funicode(char* s):             # <<<<<<<<<<<<<< 
 *     cdef Py_ssize_t slen
 *     cdef char* spos
 */

static  PyObject *__pyx_f_4lxml_5etree_funicode(char *__pyx_v_s) {
Py_ssize_t __pyx_v_slen;
char *__pyx_v_spos;
char __pyx_v_c;
PyObject *__pyx_r;
int __pyx_1;
long __pyx_2;
PyObject *__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":949
 *     cdef char* spos
 *     cdef char c
 *     spos = s             # <<<<<<<<<<<<<< 
 *     c = spos[0]
 *     while c != c'\0':
 */
__pyx_v_spos = __pyx_v_s;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":950
 *     cdef char c
 *     spos = s
 *     c = spos[0]             # <<<<<<<<<<<<<< 
 *     while c != c'\0':
 *         if c & 0x80:
 */
__pyx_v_c = (__pyx_v_spos[0]);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":951
 *     spos = s
 *     c = spos[0]
 *     while c != c'\0':             # <<<<<<<<<<<<<< 
 *         if c & 0x80:
 *             break
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":951
 *     spos = s
 *     c = spos[0]
 *     while c != c'\0':             # <<<<<<<<<<<<<< 
 *         if c & 0x80:
 *             break
 */
  __pyx_1 = (__pyx_v_c != '\0');
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":952
 *     c = spos[0]
 *     while c != c'\0':
 *         if c & 0x80:             # <<<<<<<<<<<<<< 
 *             break
 *         spos = spos + 1
 */
  __pyx_2 = (__pyx_v_c & 0x80);
  if (__pyx_2) {
    goto __pyx_L3;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":954
 *         if c & 0x80:
 *             break
 *         spos = spos + 1             # <<<<<<<<<<<<<< 
 *         c = spos[0]
 *     slen = spos - s
 */
  __pyx_v_spos = (__pyx_v_spos + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":955
 *             break
 *         spos = spos + 1
 *         c = spos[0]             # <<<<<<<<<<<<<< 
 *     slen = spos - s
 *     if c != c'\0':
 */
  __pyx_v_c = (__pyx_v_spos[0]);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":956
 *         spos = spos + 1
 *         c = spos[0]
 *     slen = spos - s             # <<<<<<<<<<<<<< 
 *     if c != c'\0':
 *         return python.PyUnicode_DecodeUTF8(s, slen+cstd.strlen(spos), NULL)
 */
__pyx_v_slen = (__pyx_v_spos - __pyx_v_s);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":957
 *         c = spos[0]
 *     slen = spos - s
 *     if c != c'\0':             # <<<<<<<<<<<<<< 
 *         return python.PyUnicode_DecodeUTF8(s, slen+cstd.strlen(spos), NULL)
 *     return python.PyString_FromStringAndSize(s, slen)
 */
__pyx_1 = (__pyx_v_c != '\0');
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":958
 *     slen = spos - s
 *     if c != c'\0':
 *         return python.PyUnicode_DecodeUTF8(s, slen+cstd.strlen(spos), NULL)             # <<<<<<<<<<<<<< 
 *     return python.PyString_FromStringAndSize(s, slen)
 * 
 */
  __pyx_3 = PyUnicode_DecodeUTF8(__pyx_v_s,(__pyx_v_slen + strlen(__pyx_v_spos)),NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 958; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":959
 *     if c != c'\0':
 *         return python.PyUnicode_DecodeUTF8(s, slen+cstd.strlen(spos), NULL)
 *     return python.PyString_FromStringAndSize(s, slen)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _utf8(object s):
 */
__pyx_3 = PyString_FromStringAndSize(__pyx_v_s,__pyx_v_slen); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 959; goto __pyx_L1;}
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.funicode");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":961
 *     return python.PyString_FromStringAndSize(s, slen)
 * 
 * cdef object _utf8(object s):             # <<<<<<<<<<<<<< 
 *     if python.PyString_Check(s):
 *         assert not isutf8py(s), \
 */

static PyObject *__pyx_k431p;
static PyObject *__pyx_k432p;
static PyObject *__pyx_k433p;

static char __pyx_k431[] = "All strings must be XML compatible, either Unicode or ASCII";
static char __pyx_k432[] = "All strings must be XML compatible, either Unicode or ASCII";
static char __pyx_k433[] = "Argument must be string or unicode.";

static  PyObject *__pyx_f_4lxml_5etree__utf8(PyObject *__pyx_v_s) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_s);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":962
 * 
 * cdef object _utf8(object s):
 *     if python.PyString_Check(s):             # <<<<<<<<<<<<<< 
 *         assert not isutf8py(s), \
 *                "All strings must be XML compatible, either Unicode or ASCII"
 */
__pyx_1 = PyString_Check(__pyx_v_s);
if (__pyx_1) {
  #ifndef PYREX_WITHOUT_ASSERTIONS

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":963
 * cdef object _utf8(object s):
 *     if python.PyString_Check(s):
 *         assert not isutf8py(s), \             # <<<<<<<<<<<<<< 
 *                "All strings must be XML compatible, either Unicode or ASCII"
 *     elif python.PyUnicode_Check(s):
 */
  if (unlikely(!(!__pyx_f_4lxml_5etree_isutf8py(__pyx_v_s)))) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":964
 *     if python.PyString_Check(s):
 *         assert not isutf8py(s), \
 *                "All strings must be XML compatible, either Unicode or ASCII"             # <<<<<<<<<<<<<< 
 *     elif python.PyUnicode_Check(s):
 *         # FIXME: we should test these strings, too ...
 */
    PyErr_SetObject(PyExc_AssertionError, __pyx_k431p);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 963; goto __pyx_L1;}
  }
  #endif
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":965
 *         assert not isutf8py(s), \
 *                "All strings must be XML compatible, either Unicode or ASCII"
 *     elif python.PyUnicode_Check(s):             # <<<<<<<<<<<<<< 
 *         # FIXME: we should test these strings, too ...
 *         s = python.PyUnicode_AsUTF8String(s)
 */
__pyx_1 = PyUnicode_Check(__pyx_v_s);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":967
 *     elif python.PyUnicode_Check(s):
 *         # FIXME: we should test these strings, too ...
 *         s = python.PyUnicode_AsUTF8String(s)             # <<<<<<<<<<<<<< 
 *         assert isutf8py(s) != -1, \
 *                "All strings must be XML compatible, either Unicode or ASCII"
 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_s); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 967; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":968
 *         # FIXME: we should test these strings, too ...
 *         s = python.PyUnicode_AsUTF8String(s)
 *         assert isutf8py(s) != -1, \             # <<<<<<<<<<<<<< 
 *                "All strings must be XML compatible, either Unicode or ASCII"
 *     else:
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":968
 *         # FIXME: we should test these strings, too ...
 *         s = python.PyUnicode_AsUTF8String(s)
 *         assert isutf8py(s) != -1, \             # <<<<<<<<<<<<<< 
 *                "All strings must be XML compatible, either Unicode or ASCII"
 *     else:
 */
  if (unlikely(!(__pyx_f_4lxml_5etree_isutf8py(__pyx_v_s) != -1))) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":969
 *         s = python.PyUnicode_AsUTF8String(s)
 *         assert isutf8py(s) != -1, \
 *                "All strings must be XML compatible, either Unicode or ASCII"             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Argument must be string or unicode."
 */
    PyErr_SetObject(PyExc_AssertionError, __pyx_k432p);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 968; goto __pyx_L1;}
  }
  #endif
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":971
 *                "All strings must be XML compatible, either Unicode or ASCII"
 *     else:
 *         raise TypeError, "Argument must be string or unicode."             # <<<<<<<<<<<<<< 
 *     return s
 * 
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k433p, 0);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 971; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":972
 *     else:
 *         raise TypeError, "Argument must be string or unicode."
 *     return s             # <<<<<<<<<<<<<< 
 * 
 * cdef object _encodeFilename(object filename):
 */
Py_INCREF(__pyx_v_s);
__pyx_r = __pyx_v_s;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._utf8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":974
 *     return s
 * 
 * cdef object _encodeFilename(object filename):             # <<<<<<<<<<<<<< 
 *     if filename is None:
 *         return None
 */

static PyObject *__pyx_k434p;

static char __pyx_k434[] = "Argument must be string or unicode.";

static  PyObject *__pyx_f_4lxml_5etree__encodeFilename(PyObject *__pyx_v_filename) {
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":975
 * 
 * cdef object _encodeFilename(object filename):
 *     if filename is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     elif python.PyString_Check(filename):
 */
__pyx_1 = (__pyx_v_filename == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":976
 * cdef object _encodeFilename(object filename):
 *     if filename is None:
 *         return None             # <<<<<<<<<<<<<< 
 *     elif python.PyString_Check(filename):
 *         return filename
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":977
 *     if filename is None:
 *         return None
 *     elif python.PyString_Check(filename):             # <<<<<<<<<<<<<< 
 *         return filename
 *     elif python.PyUnicode_Check(filename):
 */
__pyx_2 = PyString_Check(__pyx_v_filename);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":978
 *         return None
 *     elif python.PyString_Check(filename):
 *         return filename             # <<<<<<<<<<<<<< 
 *     elif python.PyUnicode_Check(filename):
 *         return python.PyUnicode_AsEncodedString(
 */
  Py_INCREF(__pyx_v_filename);
  __pyx_r = __pyx_v_filename;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":979
 *     elif python.PyString_Check(filename):
 *         return filename
 *     elif python.PyUnicode_Check(filename):             # <<<<<<<<<<<<<< 
 *         return python.PyUnicode_AsEncodedString(
 *             filename, _C_FILENAME_ENCODING, NULL)
 */
__pyx_2 = PyUnicode_Check(__pyx_v_filename);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":981
 *     elif python.PyUnicode_Check(filename):
 *         return python.PyUnicode_AsEncodedString(
 *             filename, _C_FILENAME_ENCODING, NULL)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Argument must be string or unicode."
 */
  __pyx_3 = PyUnicode_AsEncodedString(__pyx_v_filename,__pyx_v_4lxml_5etree__C_FILENAME_ENCODING,NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 980; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":983
 *             filename, _C_FILENAME_ENCODING, NULL)
 *     else:
 *         raise TypeError, "Argument must be string or unicode."             # <<<<<<<<<<<<<< 
 * 
 * cdef object _encodeFilenameUTF8(object filename):
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k434p, 0);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 983; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._encodeFilename");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":985
 *         raise TypeError, "Argument must be string or unicode."
 * 
 * cdef object _encodeFilenameUTF8(object filename):             # <<<<<<<<<<<<<< 
 *     """Recode filename as UTF-8. Tries ASCII, local filesystem encoding and
 *     UTF-8 as source encoding.
 */

static PyObject *__pyx_n_UnicodeDecodeError;

static PyObject *__pyx_k435p;

static PyObject *__pyx_builtin_UnicodeDecodeError;

static char __pyx_k435[] = "Argument must be string or unicode.";

static  PyObject *__pyx_f_4lxml_5etree__encodeFilenameUTF8(PyObject *__pyx_v_filename) {
char *__pyx_v_c_filename;
PyObject *__pyx_v_decode_exc;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
PyObject *__pyx_8 = 0;
Py_INCREF(__pyx_v_filename);
__pyx_v_decode_exc = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":990
 *     """
 *     cdef char* c_filename
 *     if filename is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     elif python.PyString_Check(filename):
 */
__pyx_1 = (__pyx_v_filename == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":991
 *     cdef char* c_filename
 *     if filename is None:
 *         return None             # <<<<<<<<<<<<<< 
 *     elif python.PyString_Check(filename):
 *         if not isutf8py(filename):
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":992
 *     if filename is None:
 *         return None
 *     elif python.PyString_Check(filename):             # <<<<<<<<<<<<<< 
 *         if not isutf8py(filename):
 *             # plain ASCII!
 */
__pyx_2 = PyString_Check(__pyx_v_filename);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":993
 *         return None
 *     elif python.PyString_Check(filename):
 *         if not isutf8py(filename):             # <<<<<<<<<<<<<< 
 *             # plain ASCII!
 *             return filename
 */
  __pyx_1 = (!__pyx_f_4lxml_5etree_isutf8py(__pyx_v_filename));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":995
 *         if not isutf8py(filename):
 *             # plain ASCII!
 *             return filename             # <<<<<<<<<<<<<< 
 *         c_filename = _cstr(filename)
 *         try:
 */
    Py_INCREF(__pyx_v_filename);
    __pyx_r = __pyx_v_filename;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":996
 *             # plain ASCII!
 *             return filename
 *         c_filename = _cstr(filename)             # <<<<<<<<<<<<<< 
 *         try:
 *             # try to decode with default encoding
 */
  __pyx_v_c_filename = _cstr(__pyx_v_filename);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":997
 *             return filename
 *         c_filename = _cstr(filename)
 *         try:             # <<<<<<<<<<<<<< 
 *             # try to decode with default encoding
 *             filename = python.PyUnicode_Decode(
 */
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1001
 *             filename = python.PyUnicode_Decode(
 *                 c_filename, python.PyString_GET_SIZE(filename),
 *                 _C_FILENAME_ENCODING, NULL)             # <<<<<<<<<<<<<< 
 *         except UnicodeDecodeError, decode_exc:
 *             try:
 */
    __pyx_3 = PyUnicode_Decode(__pyx_v_c_filename,PyString_GET_SIZE(__pyx_v_filename),__pyx_v_4lxml_5etree__C_FILENAME_ENCODING,NULL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 999; goto __pyx_L4;}
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_3;
    __pyx_3 = 0;
  }
  goto __pyx_L5;
  __pyx_L4:;
  Py_XDECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1002
 *                 c_filename, python.PyString_GET_SIZE(filename),
 *                 _C_FILENAME_ENCODING, NULL)
 *         except UnicodeDecodeError, decode_exc:             # <<<<<<<<<<<<<< 
 *             try:
 *                 # try if it's UTF-8
 */
  __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
  if (__pyx_2) {
    __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
    if (__Pyx_GetException(&__pyx_3, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1002
 *                 c_filename, python.PyString_GET_SIZE(filename),
 *                 _C_FILENAME_ENCODING, NULL)
 *         except UnicodeDecodeError, decode_exc:             # <<<<<<<<<<<<<< 
 *             try:
 *                 # try if it's UTF-8
 */
    Py_INCREF(__pyx_4);
    Py_DECREF(__pyx_v_decode_exc);
    __pyx_v_decode_exc = __pyx_4;
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1006
 *                 # try if it's UTF-8
 *                 filename = python.PyUnicode_DecodeUTF8(
 *                     c_filename, python.PyString_GET_SIZE(filename), NULL)             # <<<<<<<<<<<<<< 
 *             except UnicodeDecodeError:
 *                 raise decode_exc # otherwise re-raise original exception
 */
      __pyx_6 = PyUnicode_DecodeUTF8(__pyx_v_c_filename,PyString_GET_SIZE(__pyx_v_filename),NULL); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1005; goto __pyx_L6;}
      Py_DECREF(__pyx_v_filename);
      __pyx_v_filename = __pyx_6;
      __pyx_6 = 0;
    }
    goto __pyx_L7;
    __pyx_L6:;
    Py_XDECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1007
 *                 filename = python.PyUnicode_DecodeUTF8(
 *                     c_filename, python.PyString_GET_SIZE(filename), NULL)
 *             except UnicodeDecodeError:             # <<<<<<<<<<<<<< 
 *                 raise decode_exc # otherwise re-raise original exception
 *     if python.PyUnicode_Check(filename):
 */
    __pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_UnicodeDecodeError);
    if (__pyx_2) {
      __Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
      if (__Pyx_GetException(&__pyx_6, &__pyx_7, &__pyx_8) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1007; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1008
 *                     c_filename, python.PyString_GET_SIZE(filename), NULL)
 *             except UnicodeDecodeError:
 *                 raise decode_exc # otherwise re-raise original exception             # <<<<<<<<<<<<<< 
 *     if python.PyUnicode_Check(filename):
 *         return python.PyUnicode_AsUTF8String(filename)
 */
      __Pyx_Raise(__pyx_v_decode_exc, 0, 0);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1008; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      goto __pyx_L7;
    }
    goto __pyx_L1;
    __pyx_L7:;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    goto __pyx_L5;
  }
  goto __pyx_L1;
  __pyx_L5:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1009
 *             except UnicodeDecodeError:
 *                 raise decode_exc # otherwise re-raise original exception
 *     if python.PyUnicode_Check(filename):             # <<<<<<<<<<<<<< 
 *         return python.PyUnicode_AsUTF8String(filename)
 *     else:
 */
__pyx_2 = PyUnicode_Check(__pyx_v_filename);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1010
 *                 raise decode_exc # otherwise re-raise original exception
 *     if python.PyUnicode_Check(filename):
 *         return python.PyUnicode_AsUTF8String(filename)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise TypeError, "Argument must be string or unicode."
 */
  __pyx_6 = PyUnicode_AsUTF8String(__pyx_v_filename); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1010; goto __pyx_L1;}
  __pyx_r = __pyx_6;
  __pyx_6 = 0;
  goto __pyx_L0;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1012
 *         return python.PyUnicode_AsUTF8String(filename)
 *     else:
 *         raise TypeError, "Argument must be string or unicode."             # <<<<<<<<<<<<<< 
 * 
 * cdef _getNsTag(tag):
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k435p, 0);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1012; goto __pyx_L1;}
}
__pyx_L8:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
Py_XDECREF(__pyx_8);
__Pyx_AddTraceback("lxml.etree._encodeFilenameUTF8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_decode_exc);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1014
 *         raise TypeError, "Argument must be string or unicode."
 * 
 * cdef _getNsTag(tag):             # <<<<<<<<<<<<<< 
 *     """Given a tag, find namespace URI and tag name.
 *     Return None for NS uri if no namespace URI available.
 */

static PyObject *__pyx_k436p;
static PyObject *__pyx_k437p;
static PyObject *__pyx_k438p;

static char __pyx_k436[] = "Invalid tag name";
static char __pyx_k437[] = "Empty tag name";
static char __pyx_k438[] = "Empty tag name";

static  PyObject *__pyx_f_4lxml_5etree__getNsTag(PyObject *__pyx_v_tag) {
char *__pyx_v_c_tag;
char *__pyx_v_c_ns_end;
Py_ssize_t __pyx_v_taglen;
Py_ssize_t __pyx_v_nslen;
PyObject *__pyx_v_ns;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_tag);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1022
 *     cdef Py_ssize_t taglen
 *     cdef Py_ssize_t nslen
 *     if isinstance(tag, QName):             # <<<<<<<<<<<<<< 
 *         tag = (<QName>tag).text
 *     tag = _utf8(tag)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_tag,((PyObject*)__pyx_ptype_4lxml_5etree_QName)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1022; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1023
 *     cdef Py_ssize_t nslen
 *     if isinstance(tag, QName):
 *         tag = (<QName>tag).text             # <<<<<<<<<<<<<< 
 *     tag = _utf8(tag)
 *     c_tag = _cstr(tag)
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_tag)->text);
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = ((struct __pyx_obj_4lxml_5etree_QName *)__pyx_v_tag)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1024
 *     if isinstance(tag, QName):
 *         tag = (<QName>tag).text
 *     tag = _utf8(tag)             # <<<<<<<<<<<<<< 
 *     c_tag = _cstr(tag)
 *     if c_tag[0] == c'{':
 */
__pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_tag); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1024; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1025
 *         tag = (<QName>tag).text
 *     tag = _utf8(tag)
 *     c_tag = _cstr(tag)             # <<<<<<<<<<<<<< 
 *     if c_tag[0] == c'{':
 *         c_tag = c_tag + 1
 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1026
 *     tag = _utf8(tag)
 *     c_tag = _cstr(tag)
 *     if c_tag[0] == c'{':             # <<<<<<<<<<<<<< 
 *         c_tag = c_tag + 1
 *         c_ns_end = cstd.strchr(c_tag, c'}')
 */
__pyx_1 = ((__pyx_v_c_tag[0]) == '{');
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1027
 *     c_tag = _cstr(tag)
 *     if c_tag[0] == c'{':
 *         c_tag = c_tag + 1             # <<<<<<<<<<<<<< 
 *         c_ns_end = cstd.strchr(c_tag, c'}')
 *         if c_ns_end is NULL:
 */
    __pyx_v_c_tag = (__pyx_v_c_tag + 1);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1028
 *     if c_tag[0] == c'{':
 *         c_tag = c_tag + 1
 *         c_ns_end = cstd.strchr(c_tag, c'}')             # <<<<<<<<<<<<<< 
 *         if c_ns_end is NULL:
 *             raise ValueError, "Invalid tag name"
 */
  __pyx_v_c_ns_end = strchr(__pyx_v_c_tag,'}');

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1029
 *         c_tag = c_tag + 1
 *         c_ns_end = cstd.strchr(c_tag, c'}')
 *         if c_ns_end is NULL:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Invalid tag name"
 *         nslen  = c_ns_end - c_tag
 */
  __pyx_1 = (__pyx_v_c_ns_end == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1030
 *         c_ns_end = cstd.strchr(c_tag, c'}')
 *         if c_ns_end is NULL:
 *             raise ValueError, "Invalid tag name"             # <<<<<<<<<<<<<< 
 *         nslen  = c_ns_end - c_tag
 *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k436p, 0);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1030; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1031
 *         if c_ns_end is NULL:
 *             raise ValueError, "Invalid tag name"
 *         nslen  = c_ns_end - c_tag             # <<<<<<<<<<<<<< 
 *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
 *         if taglen == 0:
 */
  __pyx_v_nslen = (__pyx_v_c_ns_end - __pyx_v_c_tag);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1032
 *             raise ValueError, "Invalid tag name"
 *         nslen  = c_ns_end - c_tag
 *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2             # <<<<<<<<<<<<<< 
 *         if taglen == 0:
 *             raise ValueError, "Empty tag name"
 */
  __pyx_v_taglen = ((PyString_GET_SIZE(__pyx_v_tag) - __pyx_v_nslen) - 2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1033
 *         nslen  = c_ns_end - c_tag
 *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
 *         if taglen == 0:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Empty tag name"
 *         if nslen > 0:
 */
  __pyx_1 = (__pyx_v_taglen == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1034
 *         taglen = python.PyString_GET_SIZE(tag) - nslen - 2
 *         if taglen == 0:
 *             raise ValueError, "Empty tag name"             # <<<<<<<<<<<<<< 
 *         if nslen > 0:
 *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k437p, 0);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1034; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1035
 *         if taglen == 0:
 *             raise ValueError, "Empty tag name"
 *         if nslen > 0:             # <<<<<<<<<<<<<< 
 *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
 *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
 */
  __pyx_1 = (__pyx_v_nslen > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1036
 *             raise ValueError, "Empty tag name"
 *         if nslen > 0:
 *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)             # <<<<<<<<<<<<<< 
 *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
 *     elif python.PyString_GET_SIZE(tag) == 0:
 */
    __pyx_2 = PyString_FromStringAndSize(__pyx_v_c_tag,__pyx_v_nslen); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1036; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ns);
    __pyx_v_ns = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1037
 *         if nslen > 0:
 *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
 *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)             # <<<<<<<<<<<<<< 
 *     elif python.PyString_GET_SIZE(tag) == 0:
 *         raise ValueError, "Empty tag name"
 */
  __pyx_2 = PyString_FromStringAndSize((__pyx_v_c_ns_end + 1),__pyx_v_taglen); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1037; goto __pyx_L1;}
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1038
 *             ns = python.PyString_FromStringAndSize(c_tag,   nslen)
 *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
 *     elif python.PyString_GET_SIZE(tag) == 0:             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Empty tag name"
 *     return ns, tag
 */
__pyx_1 = (PyString_GET_SIZE(__pyx_v_tag) == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1039
 *         tag = python.PyString_FromStringAndSize(c_ns_end+1, taglen)
 *     elif python.PyString_GET_SIZE(tag) == 0:
 *         raise ValueError, "Empty tag name"             # <<<<<<<<<<<<<< 
 *     return ns, tag
 * 
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k438p, 0);
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1039; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1040
 *     elif python.PyString_GET_SIZE(tag) == 0:
 *         raise ValueError, "Empty tag name"
 *     return ns, tag             # <<<<<<<<<<<<<< 
 * 
 * cdef int _pyXmlNameIsValid(name_utf8):
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1040; goto __pyx_L1;}
Py_INCREF(__pyx_v_ns);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_tag);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._getNsTag");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1042
 *     return ns, tag
 * 
 * cdef int _pyXmlNameIsValid(name_utf8):             # <<<<<<<<<<<<<< 
 *     return _xmlNameIsValid(_cstr(name_utf8))
 * 
 */

static  int __pyx_f_4lxml_5etree__pyXmlNameIsValid(PyObject *__pyx_v_name_utf8) {
int __pyx_r;
Py_INCREF(__pyx_v_name_utf8);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1043
 * 
 * cdef int _pyXmlNameIsValid(name_utf8):
 *     return _xmlNameIsValid(_cstr(name_utf8))             # <<<<<<<<<<<<<< 
 * 
 * cdef int _pyHtmlNameIsValid(name_utf8):
 */
__pyx_r = __pyx_f_4lxml_5etree__xmlNameIsValid(_cstr(__pyx_v_name_utf8));
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf8);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1045
 *     return _xmlNameIsValid(_cstr(name_utf8))
 * 
 * cdef int _pyHtmlNameIsValid(name_utf8):             # <<<<<<<<<<<<<< 
 *     return _htmlNameIsValid(_cstr(name_utf8))
 * 
 */

static  int __pyx_f_4lxml_5etree__pyHtmlNameIsValid(PyObject *__pyx_v_name_utf8) {
int __pyx_r;
Py_INCREF(__pyx_v_name_utf8);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1046
 * 
 * cdef int _pyHtmlNameIsValid(name_utf8):
 *     return _htmlNameIsValid(_cstr(name_utf8))             # <<<<<<<<<<<<<< 
 * 
 * cdef int _xmlNameIsValid(char* c_name):
 */
__pyx_r = __pyx_f_4lxml_5etree__htmlNameIsValid(_cstr(__pyx_v_name_utf8));
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf8);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1048
 *     return _htmlNameIsValid(_cstr(name_utf8))
 * 
 * cdef int _xmlNameIsValid(char* c_name):             # <<<<<<<<<<<<<< 
 *     return tree.xmlValidateNCName(c_name, 0) == 0
 * 
 */

static  int __pyx_f_4lxml_5etree__xmlNameIsValid(char *__pyx_v_c_name) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1049
 * 
 * cdef int _xmlNameIsValid(char* c_name):
 *     return tree.xmlValidateNCName(c_name, 0) == 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _htmlNameIsValid(char* c_name):
 */
__pyx_r = (xmlValidateNCName(__pyx_v_c_name,0) == 0);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1051
 *     return tree.xmlValidateNCName(c_name, 0) == 0
 * 
 * cdef int _htmlNameIsValid(char* c_name):             # <<<<<<<<<<<<<< 
 *     if c_name is NULL or c_name[0] == c'\0':
 *         return 0
 */

static  int __pyx_f_4lxml_5etree__htmlNameIsValid(char *__pyx_v_c_name) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1052
 * 
 * cdef int _htmlNameIsValid(char* c_name):
 *     if c_name is NULL or c_name[0] == c'\0':             # <<<<<<<<<<<<<< 
 *         return 0
 *     while c_name[0] != c'\0':
 */
__pyx_1 = (__pyx_v_c_name == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1052
 * 
 * cdef int _htmlNameIsValid(char* c_name):
 *     if c_name is NULL or c_name[0] == c'\0':             # <<<<<<<<<<<<<< 
 *         return 0
 *     while c_name[0] != c'\0':
 */
  __pyx_1 = ((__pyx_v_c_name[0]) == '\0');
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1053
 * cdef int _htmlNameIsValid(char* c_name):
 *     if c_name is NULL or c_name[0] == c'\0':
 *         return 0             # <<<<<<<<<<<<<< 
 *     while c_name[0] != c'\0':
 *         if c_name[0] == c'&' or \
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1054
 *     if c_name is NULL or c_name[0] == c'\0':
 *         return 0
 *     while c_name[0] != c'\0':             # <<<<<<<<<<<<<< 
 *         if c_name[0] == c'&' or \
 *                 c_name[0] == c'<' or \
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1054
 *     if c_name is NULL or c_name[0] == c'\0':
 *         return 0
 *     while c_name[0] != c'\0':             # <<<<<<<<<<<<<< 
 *         if c_name[0] == c'&' or \
 *                 c_name[0] == c'<' or \
 */
  __pyx_1 = ((__pyx_v_c_name[0]) != '\0');
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1055
 *         return 0
 *     while c_name[0] != c'\0':
 *         if c_name[0] == c'&' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'<' or \
 *                 c_name[0] == c'>' or \
 */
  __pyx_1 = ((__pyx_v_c_name[0]) == '&');
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1056
 *     while c_name[0] != c'\0':
 *         if c_name[0] == c'&' or \
 *                 c_name[0] == c'<' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'>' or \
 *                 c_name[0] == c'/' or \
 */
    __pyx_1 = ((__pyx_v_c_name[0]) == '<');
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1057
 *         if c_name[0] == c'&' or \
 *                 c_name[0] == c'<' or \
 *                 c_name[0] == c'>' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'/' or \
 *                 c_name[0] == c'"' or \
 */
      __pyx_1 = ((__pyx_v_c_name[0]) == '>');
      if (!__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1058
 *                 c_name[0] == c'<' or \
 *                 c_name[0] == c'>' or \
 *                 c_name[0] == c'/' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'"' or \
 *                 c_name[0] == c"'" or \
 */
        __pyx_1 = ((__pyx_v_c_name[0]) == '/');
        if (!__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1059
 *                 c_name[0] == c'>' or \
 *                 c_name[0] == c'/' or \
 *                 c_name[0] == c'"' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c"'" or \
 *                 c_name[0] == c'\x09' or \
 */
          __pyx_1 = ((__pyx_v_c_name[0]) == '\"');
          if (!__pyx_1) {

            /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1060
 *                 c_name[0] == c'/' or \
 *                 c_name[0] == c'"' or \
 *                 c_name[0] == c"'" or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'\x09' or \
 *                 c_name[0] == c'\x0A' or \
 */
            __pyx_1 = ((__pyx_v_c_name[0]) == '\'');
            if (!__pyx_1) {

              /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1061
 *                 c_name[0] == c'"' or \
 *                 c_name[0] == c"'" or \
 *                 c_name[0] == c'\x09' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'\x0A' or \
 *                 c_name[0] == c'\x0B' or \
 */
              __pyx_1 = ((__pyx_v_c_name[0]) == '\x009');
              if (!__pyx_1) {

                /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1062
 *                 c_name[0] == c"'" or \
 *                 c_name[0] == c'\x09' or \
 *                 c_name[0] == c'\x0A' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'\x0B' or \
 *                 c_name[0] == c'\x0C' or \
 */
                __pyx_1 = ((__pyx_v_c_name[0]) == '\x00A');
                if (!__pyx_1) {

                  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1063
 *                 c_name[0] == c'\x09' or \
 *                 c_name[0] == c'\x0A' or \
 *                 c_name[0] == c'\x0B' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'\x0C' or \
 *                 c_name[0] == c'\x20':
 */
                  __pyx_1 = ((__pyx_v_c_name[0]) == '\x00B');
                  if (!__pyx_1) {

                    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1064
 *                 c_name[0] == c'\x0A' or \
 *                 c_name[0] == c'\x0B' or \
 *                 c_name[0] == c'\x0C' or \             # <<<<<<<<<<<<<< 
 *                 c_name[0] == c'\x20':
 *             return 0
 */
                    __pyx_1 = ((__pyx_v_c_name[0]) == '\x00C');
                    if (!__pyx_1) {

                      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1065
 *                 c_name[0] == c'\x0B' or \
 *                 c_name[0] == c'\x0C' or \
 *                 c_name[0] == c'\x20':             # <<<<<<<<<<<<<< 
 *             return 0
 *         c_name = c_name + 1
 */
                      __pyx_1 = ((__pyx_v_c_name[0]) == '\x020');
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1066
 *                 c_name[0] == c'\x0C' or \
 *                 c_name[0] == c'\x20':
 *             return 0             # <<<<<<<<<<<<<< 
 *         c_name = c_name + 1
 *     return 1
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1067
 *                 c_name[0] == c'\x20':
 *             return 0
 *         c_name = c_name + 1             # <<<<<<<<<<<<<< 
 *     return 1
 * 
 */
  __pyx_v_c_name = (__pyx_v_c_name + 1);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1068
 *             return 0
 *         c_name = c_name + 1
 *     return 1             # <<<<<<<<<<<<<< 
 * 
 * cdef int _tagValidOrRaise(tag_utf) except -1:
 */
__pyx_r = 1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1070
 *     return 1
 * 
 * cdef int _tagValidOrRaise(tag_utf) except -1:             # <<<<<<<<<<<<<< 
 *     if not _pyXmlNameIsValid(tag_utf):
 *         raise ValueError, "Invalid tag name %r" % \
 */

static PyObject *__pyx_k439p;

static char __pyx_k439[] = "Invalid tag name %r";
static char __pyx_k440[] = "UTF-8";
static char __pyx_k441[] = "strict";

static  int __pyx_f_4lxml_5etree__tagValidOrRaise(PyObject *__pyx_v_tag_utf) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_tag_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1071
 * 
 * cdef int _tagValidOrRaise(tag_utf) except -1:
 *     if not _pyXmlNameIsValid(tag_utf):             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Invalid tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')
 */
__pyx_1 = (!__pyx_f_4lxml_5etree__pyXmlNameIsValid(__pyx_v_tag_utf));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1073
 *     if not _pyXmlNameIsValid(tag_utf):
 *         raise ValueError, "Invalid tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf,__pyx_k440,__pyx_k441); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1073; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k439p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1072; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1072; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1074
 *         raise ValueError, "Invalid tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _htmlTagValidOrRaise(tag_utf) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._tagValidOrRaise");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_tag_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1076
 *     return 0
 * 
 * cdef int _htmlTagValidOrRaise(tag_utf) except -1:             # <<<<<<<<<<<<<< 
 *     if not _pyHtmlNameIsValid(tag_utf):
 *         raise ValueError, "Invalid HTML tag name %r" % \
 */

static PyObject *__pyx_k442p;

static char __pyx_k442[] = "Invalid HTML tag name %r";
static char __pyx_k443[] = "UTF-8";
static char __pyx_k444[] = "strict";

static  int __pyx_f_4lxml_5etree__htmlTagValidOrRaise(PyObject *__pyx_v_tag_utf) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_tag_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1077
 * 
 * cdef int _htmlTagValidOrRaise(tag_utf) except -1:
 *     if not _pyHtmlNameIsValid(tag_utf):             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Invalid HTML tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')
 */
__pyx_1 = (!__pyx_f_4lxml_5etree__pyHtmlNameIsValid(__pyx_v_tag_utf));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1079
 *     if not _pyHtmlNameIsValid(tag_utf):
 *         raise ValueError, "Invalid HTML tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_tag_utf,__pyx_k443,__pyx_k444); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1079; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k442p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1078; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1078; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1080
 *         raise ValueError, "Invalid HTML tag name %r" % \
 *               python.PyUnicode_FromEncodedObject(tag_utf, 'UTF-8', 'strict')
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _attributeValidOrRaise(name_utf) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._htmlTagValidOrRaise");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_tag_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1082
 *     return 0
 * 
 * cdef int _attributeValidOrRaise(name_utf) except -1:             # <<<<<<<<<<<<<< 
 *     if not _pyXmlNameIsValid(name_utf):
 *         raise ValueError, "Invalid attribute name %r" % \
 */

static PyObject *__pyx_k445p;

static char __pyx_k445[] = "Invalid attribute name %r";
static char __pyx_k446[] = "UTF-8";
static char __pyx_k447[] = "strict";

static  int __pyx_f_4lxml_5etree__attributeValidOrRaise(PyObject *__pyx_v_name_utf) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_name_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1083
 * 
 * cdef int _attributeValidOrRaise(name_utf) except -1:
 *     if not _pyXmlNameIsValid(name_utf):             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Invalid attribute name %r" % \
 *               python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', 'strict')
 */
__pyx_1 = (!__pyx_f_4lxml_5etree__pyXmlNameIsValid(__pyx_v_name_utf));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1085
 *     if not _pyXmlNameIsValid(name_utf):
 *         raise ValueError, "Invalid attribute name %r" % \
 *               python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_name_utf,__pyx_k446,__pyx_k447); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1085; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k445p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1084; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1086
 *         raise ValueError, "Invalid attribute name %r" % \
 *               python.PyUnicode_FromEncodedObject(name_utf, 'UTF-8', 'strict')
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef object _namespacedName(xmlNode* c_node):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._attributeValidOrRaise");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1088
 *     return 0
 * 
 * cdef object _namespacedName(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree__namespacedName(xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1089
 * 
 * cdef object _namespacedName(xmlNode* c_node):
 *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _namespacedNameFromNsName(char* href, char* name):
 */
__pyx_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(_getNs(__pyx_v_c_node),__pyx_v_c_node->name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1089; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._namespacedName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1091
 *     return _namespacedNameFromNsName(_getNs(c_node), c_node.name)
 * 
 * cdef object _namespacedNameFromNsName(char* href, char* name):             # <<<<<<<<<<<<<< 
 *     if href is NULL:
 *         return funicode(name)
 */

static char __pyx_k448[] = "{%s}%s";
static char __pyx_k449[] = "UTF-8";

static  PyObject *__pyx_f_4lxml_5etree__namespacedNameFromNsName(char *__pyx_v_href,char *__pyx_v_name) {
PyObject *__pyx_v_s;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
__pyx_v_s = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1092
 * 
 * cdef object _namespacedNameFromNsName(char* href, char* name):
 *     if href is NULL:             # <<<<<<<<<<<<<< 
 *         return funicode(name)
 *     else:
 */
__pyx_1 = (__pyx_v_href == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1093
 * cdef object _namespacedNameFromNsName(char* href, char* name):
 *     if href is NULL:
 *         return funicode(name)             # <<<<<<<<<<<<<< 
 *     else:
 *         s = python.PyString_FromFormat("{%s}%s", href, name)
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1093; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1095
 *         return funicode(name)
 *     else:
 *         s = python.PyString_FromFormat("{%s}%s", href, name)             # <<<<<<<<<<<<<< 
 *         if isutf8(href) or isutf8(name):
 *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
 */
  __pyx_2 = PyString_FromFormat(__pyx_k448,__pyx_v_href,__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1095; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1096
 *     else:
 *         s = python.PyString_FromFormat("{%s}%s", href, name)
 *         if isutf8(href) or isutf8(name):             # <<<<<<<<<<<<<< 
 *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
 *         else:
 */
  __pyx_1 = __pyx_f_4lxml_5etree_isutf8(__pyx_v_href);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1096
 *     else:
 *         s = python.PyString_FromFormat("{%s}%s", href, name)
 *         if isutf8(href) or isutf8(name):             # <<<<<<<<<<<<<< 
 *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
 *         else:
 */
    __pyx_1 = __pyx_f_4lxml_5etree_isutf8(__pyx_v_name);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1097
 *         s = python.PyString_FromFormat("{%s}%s", href, name)
 *         if isutf8(href) or isutf8(name):
 *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)             # <<<<<<<<<<<<<< 
 *         else:
 *             return s
 */
    __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_s,__pyx_k449,NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1097; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1099
 *             return python.PyUnicode_FromEncodedObject(s, 'UTF-8', NULL)
 *         else:
 *             return s             # <<<<<<<<<<<<<< 
 * 
 * cdef _getFilenameForFile(source):
 */
    Py_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;
  }
  __pyx_L3:;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._namespacedNameFromNsName");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1101
 *             return s
 * 
 * cdef _getFilenameForFile(source):             # <<<<<<<<<<<<<< 
 *     """Given a Python File or Gzip object, give filename back.
 * 
 */

static PyObject *__pyx_n_filename;
static PyObject *__pyx_n_geturl;

static  PyObject *__pyx_f_4lxml_5etree__getFilenameForFile(PyObject *__pyx_v_source) {
PyObject *__pyx_v_geturl;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_source);
__pyx_v_geturl = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1107
 *     """
 *     # file instances have a name attribute
 *     try:             # <<<<<<<<<<<<<< 
 *         return source.name
 *     except AttributeError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1108
 *     # file instances have a name attribute
 *     try:
 *         return source.name             # <<<<<<<<<<<<<< 
 *     except AttributeError:
 *         pass
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_source, __pyx_n_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1108; goto __pyx_L2;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1109
 *     try:
 *         return source.name
 *     except AttributeError:             # <<<<<<<<<<<<<< 
 *         pass
 *     # gzip file instances have a filename attribute
 */
__pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree._getFilenameForFile");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1109; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
goto __pyx_L1;
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1112
 *         pass
 *     # gzip file instances have a filename attribute
 *     try:             # <<<<<<<<<<<<<< 
 *         return source.filename
 *     except AttributeError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1113
 *     # gzip file instances have a filename attribute
 *     try:
 *         return source.filename             # <<<<<<<<<<<<<< 
 *     except AttributeError:
 *         pass
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_source, __pyx_n_filename); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1113; goto __pyx_L4;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1114
 *     try:
 *         return source.filename
 *     except AttributeError:             # <<<<<<<<<<<<<< 
 *         pass
 *     # urllib2 provides a geturl() method
 */
__pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree._getFilenameForFile");
  if (__Pyx_GetException(&__pyx_3, &__pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1114; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L5;
}
goto __pyx_L1;
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1117
 *         pass
 *     # urllib2 provides a geturl() method
 *     try:             # <<<<<<<<<<<<<< 
 *         geturl = source.geturl
 *     except AttributeError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1118
 *     # urllib2 provides a geturl() method
 *     try:
 *         geturl = source.geturl             # <<<<<<<<<<<<<< 
 *     except AttributeError:
 *         # can't determine filename
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_source, __pyx_n_geturl); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1118; goto __pyx_L6;}
  Py_DECREF(__pyx_v_geturl);
  __pyx_v_geturl = __pyx_3;
  __pyx_3 = 0;
}
/*else:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1123
 *         return None
 *     else:
 *         return geturl()             # <<<<<<<<<<<<<< 
 */
  __pyx_4 = PyObject_CallObject(__pyx_v_geturl, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1123; goto __pyx_L1;}
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
}
goto __pyx_L7;
__pyx_L6:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1119
 *     try:
 *         geturl = source.geturl
 *     except AttributeError:             # <<<<<<<<<<<<<< 
 *         # can't determine filename
 *         return None
 */
__pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree._getFilenameForFile");
  if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1119; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":1121
 *     except AttributeError:
 *         # can't determine filename
 *         return None             # <<<<<<<<<<<<<< 
 *     else:
 *         return geturl()
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L7;
}
goto __pyx_L1;
__pyx_L7:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._getFilenameForFile");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_geturl);
Py_DECREF(__pyx_v_source);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":7
 * # module level API functions
 * 
 * def clearErrorLog():             # <<<<<<<<<<<<<< 
 *     """Clear the global error log.  Note that this log is already bound to a
 *     fixed size.
 */

static PyObject *__pyx_pf_4lxml_5etree_clearErrorLog(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_clearErrorLog[] = "Clear the global error log.  Note that this log is already bound to a\n    fixed size.\n    ";
static PyObject *__pyx_pf_4lxml_5etree_clearErrorLog(PyObject *__pyx_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":11
 *     fixed size.
 *     """
 *     __GLOBAL_ERROR_LOG.clear()             # <<<<<<<<<<<<<< 
 * 
 * # dummy function: no debug output at all
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG), __pyx_n_clear); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.clearErrorLog");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":14
 * 
 * # dummy function: no debug output at all
 * cdef void _nullGenericErrorFunc(void* ctxt, char* msg, ...):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */

static  void __pyx_f_4lxml_5etree__nullGenericErrorFunc(void *__pyx_v_ctxt,char *__pyx_v_msg,...) {

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":19
 * # setup for global log:
 * 
 * cdef void _initThreadLogging():             # <<<<<<<<<<<<<< 
 *     # disable generic error lines from libxml2
 *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
 */

static  void __pyx_f_4lxml_5etree__initThreadLogging(void) {

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":21
 * cdef void _initThreadLogging():
 *     # disable generic error lines from libxml2
 *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)             # <<<<<<<<<<<<<< 
 *     xmlerror.xmlSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
 * 
 */
xmlThrDefSetGenericErrorFunc(NULL,__pyx_f_4lxml_5etree__nullGenericErrorFunc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":22
 *     # disable generic error lines from libxml2
 *     xmlerror.xmlThrDefSetGenericErrorFunc(NULL, _nullGenericErrorFunc)
 *     xmlerror.xmlSetGenericErrorFunc(NULL, _nullGenericErrorFunc)             # <<<<<<<<<<<<<< 
 * 
 *     # divert error messages to the global error log
 */
xmlSetGenericErrorFunc(NULL,__pyx_f_4lxml_5etree__nullGenericErrorFunc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":25
 * 
 *     # divert error messages to the global error log
 *     xmlerror.xmlThrDefSetStructuredErrorFunc(NULL, _receiveError)             # <<<<<<<<<<<<<< 
 *     connectErrorLog(NULL)
 * 
 */
xmlThrDefSetStructuredErrorFunc(NULL,__pyx_f_4lxml_5etree__receiveError);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":26
 *     # divert error messages to the global error log
 *     xmlerror.xmlThrDefSetStructuredErrorFunc(NULL, _receiveError)
 *     connectErrorLog(NULL)             # <<<<<<<<<<<<<< 
 * 
 * cdef void connectErrorLog(void* log):
 */
__pyx_f_4lxml_5etree_connectErrorLog(NULL);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":28
 *     connectErrorLog(NULL)
 * 
 * cdef void connectErrorLog(void* log):             # <<<<<<<<<<<<<< 
 *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)
 *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)
 */

static  void __pyx_f_4lxml_5etree_connectErrorLog(void *__pyx_v_log) {

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":29
 * 
 * cdef void connectErrorLog(void* log):
 *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)             # <<<<<<<<<<<<<< 
 *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)
 * 
 */
xmlSetStructuredErrorFunc(__pyx_v_log,__pyx_f_4lxml_5etree__receiveError);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":30
 * cdef void connectErrorLog(void* log):
 *     xmlerror.xmlSetStructuredErrorFunc(log, _receiveError)
 *     xslt.xsltSetGenericErrorFunc(log, _receiveXSLTError)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
xsltSetGenericErrorFunc(__pyx_v_log,__pyx_f_4lxml_5etree__receiveXSLTError);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":44
 *     cdef readonly object filename
 * 
 *     cdef _setError(self, xmlerror.xmlError* error):             # <<<<<<<<<<<<<< 
 *         cdef int size
 *         self.domain   = error.domain
 */

static PyObject *__pyx_k450p;

static char __pyx_k450[] = "<string>";

static  PyObject *__pyx_f_4lxml_5etree_9_LogEntry__setError(struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_self,xmlError *__pyx_v_error) {
int __pyx_v_size;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":46
 *     cdef _setError(self, xmlerror.xmlError* error):
 *         cdef int size
 *         self.domain   = error.domain             # <<<<<<<<<<<<<< 
 *         self.type     = error.code
 *         self.level    = <int>error.level
 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->domain); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":46
 *     cdef _setError(self, xmlerror.xmlError* error):
 *         cdef int size
 *         self.domain   = error.domain             # <<<<<<<<<<<<<< 
 *         self.type     = error.code
 *         self.level    = <int>error.level
 */
Py_DECREF(__pyx_v_self->domain);
__pyx_v_self->domain = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":47
 *         cdef int size
 *         self.domain   = error.domain
 *         self.type     = error.code             # <<<<<<<<<<<<<< 
 *         self.level    = <int>error.level
 *         self.line     = error.line
 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->code); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 47; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":47
 *         cdef int size
 *         self.domain   = error.domain
 *         self.type     = error.code             # <<<<<<<<<<<<<< 
 *         self.level    = <int>error.level
 *         self.line     = error.line
 */
Py_DECREF(__pyx_v_self->type);
__pyx_v_self->type = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":48
 *         self.domain   = error.domain
 *         self.type     = error.code
 *         self.level    = <int>error.level             # <<<<<<<<<<<<<< 
 *         self.line     = error.line
 *         self.column   = error.int2
 */
__pyx_1 = PyInt_FromLong(((int)__pyx_v_error->level)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 48; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":48
 *         self.domain   = error.domain
 *         self.type     = error.code
 *         self.level    = <int>error.level             # <<<<<<<<<<<<<< 
 *         self.line     = error.line
 *         self.column   = error.int2
 */
Py_DECREF(__pyx_v_self->level);
__pyx_v_self->level = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":49
 *         self.type     = error.code
 *         self.level    = <int>error.level
 *         self.line     = error.line             # <<<<<<<<<<<<<< 
 *         self.column   = error.int2
 *         size = cstd.strlen(error.message)
 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->line); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 49; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":49
 *         self.type     = error.code
 *         self.level    = <int>error.level
 *         self.line     = error.line             # <<<<<<<<<<<<<< 
 *         self.column   = error.int2
 *         size = cstd.strlen(error.message)
 */
Py_DECREF(__pyx_v_self->line);
__pyx_v_self->line = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":50
 *         self.level    = <int>error.level
 *         self.line     = error.line
 *         self.column   = error.int2             # <<<<<<<<<<<<<< 
 *         size = cstd.strlen(error.message)
 *         if size > 0 and error.message[size-1] == c'\n':
 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->int2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":50
 *         self.level    = <int>error.level
 *         self.line     = error.line
 *         self.column   = error.int2             # <<<<<<<<<<<<<< 
 *         size = cstd.strlen(error.message)
 *         if size > 0 and error.message[size-1] == c'\n':
 */
Py_DECREF(__pyx_v_self->column);
__pyx_v_self->column = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":51
 *         self.line     = error.line
 *         self.column   = error.int2
 *         size = cstd.strlen(error.message)             # <<<<<<<<<<<<<< 
 *         if size > 0 and error.message[size-1] == c'\n':
 *             size = size - 1 # strip EOL
 */
__pyx_v_size = strlen(__pyx_v_error->message);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":52
 *         self.column   = error.int2
 *         size = cstd.strlen(error.message)
 *         if size > 0 and error.message[size-1] == c'\n':             # <<<<<<<<<<<<<< 
 *             size = size - 1 # strip EOL
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)
 */
__pyx_2 = (__pyx_v_size > 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":52
 *         self.column   = error.int2
 *         size = cstd.strlen(error.message)
 *         if size > 0 and error.message[size-1] == c'\n':             # <<<<<<<<<<<<<< 
 *             size = size - 1 # strip EOL
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)
 */
  __pyx_2 = ((__pyx_v_error->message[(__pyx_v_size - 1)]) == '\n');
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":53
 *         size = cstd.strlen(error.message)
 *         if size > 0 and error.message[size-1] == c'\n':
 *             size = size - 1 # strip EOL             # <<<<<<<<<<<<<< 
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)
 *         if error.file is NULL:
 */
  __pyx_v_size = (__pyx_v_size - 1);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":54
 *         if size > 0 and error.message[size-1] == c'\n':
 *             size = size - 1 # strip EOL
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)             # <<<<<<<<<<<<<< 
 *         if error.file is NULL:
 *             self.filename = '<string>'
 */
__pyx_1 = PyString_FromStringAndSize(__pyx_v_error->message,__pyx_v_size); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":54
 *         if size > 0 and error.message[size-1] == c'\n':
 *             size = size - 1 # strip EOL
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)             # <<<<<<<<<<<<<< 
 *         if error.file is NULL:
 *             self.filename = '<string>'
 */
Py_DECREF(__pyx_v_self->message);
__pyx_v_self->message = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":55
 *             size = size - 1 # strip EOL
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)
 *         if error.file is NULL:             # <<<<<<<<<<<<<< 
 *             self.filename = '<string>'
 *         else:
 */
__pyx_2 = (__pyx_v_error->file == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":56
 *         self.message  = python.PyString_FromStringAndSize(error.message, size)
 *         if error.file is NULL:
 *             self.filename = '<string>'             # <<<<<<<<<<<<<< 
 *         else:
 *             self.filename = python.PyString_FromString(error.file)
 */
  Py_INCREF(__pyx_k450p);
  Py_DECREF(__pyx_v_self->filename);
  __pyx_v_self->filename = __pyx_k450p;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":58
 *             self.filename = '<string>'
 *         else:
 *             self.filename = python.PyString_FromString(error.file)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _setGeneric(self, int domain, int type, int level, int line,
 */
  __pyx_1 = PyString_FromString(__pyx_v_error->file); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":58
 *             self.filename = '<string>'
 *         else:
 *             self.filename = python.PyString_FromString(error.file)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _setGeneric(self, int domain, int type, int level, int line,
 */
  Py_DECREF(__pyx_v_self->filename);
  __pyx_v_self->filename = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._LogEntry._setError");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":60
 *             self.filename = python.PyString_FromString(error.file)
 * 
 *     cdef _setGeneric(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<< 
 *                      message, filename):
 *         self.domain  = domain
 */

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) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_message);
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":62
 *     cdef _setGeneric(self, int domain, int type, int level, int line,
 *                      message, filename):
 *         self.domain  = domain             # <<<<<<<<<<<<<< 
 *         self.type    = type
 *         self.level   = level
 */
__pyx_1 = PyInt_FromLong(__pyx_v_domain); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 62; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":62
 *     cdef _setGeneric(self, int domain, int type, int level, int line,
 *                      message, filename):
 *         self.domain  = domain             # <<<<<<<<<<<<<< 
 *         self.type    = type
 *         self.level   = level
 */
Py_DECREF(__pyx_v_self->domain);
__pyx_v_self->domain = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":63
 *                      message, filename):
 *         self.domain  = domain
 *         self.type    = type             # <<<<<<<<<<<<<< 
 *         self.level   = level
 *         self.line    = line
 */
__pyx_1 = PyInt_FromLong(__pyx_v_type); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 63; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":63
 *                      message, filename):
 *         self.domain  = domain
 *         self.type    = type             # <<<<<<<<<<<<<< 
 *         self.level   = level
 *         self.line    = line
 */
Py_DECREF(__pyx_v_self->type);
__pyx_v_self->type = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":64
 *         self.domain  = domain
 *         self.type    = type
 *         self.level   = level             # <<<<<<<<<<<<<< 
 *         self.line    = line
 *         self.column  = 0
 */
__pyx_1 = PyInt_FromLong(__pyx_v_level); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 64; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":64
 *         self.domain  = domain
 *         self.type    = type
 *         self.level   = level             # <<<<<<<<<<<<<< 
 *         self.line    = line
 *         self.column  = 0
 */
Py_DECREF(__pyx_v_self->level);
__pyx_v_self->level = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":65
 *         self.type    = type
 *         self.level   = level
 *         self.line    = line             # <<<<<<<<<<<<<< 
 *         self.column  = 0
 *         self.message = message
 */
__pyx_1 = PyInt_FromLong(__pyx_v_line); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 65; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":65
 *         self.type    = type
 *         self.level   = level
 *         self.line    = line             # <<<<<<<<<<<<<< 
 *         self.column  = 0
 *         self.message = message
 */
Py_DECREF(__pyx_v_self->line);
__pyx_v_self->line = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":66
 *         self.level   = level
 *         self.line    = line
 *         self.column  = 0             # <<<<<<<<<<<<<< 
 *         self.message = message
 *         self.filename = filename
 */
Py_INCREF(__pyx_num_0);
Py_DECREF(__pyx_v_self->column);
__pyx_v_self->column = __pyx_num_0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":67
 *         self.line    = line
 *         self.column  = 0
 *         self.message = message             # <<<<<<<<<<<<<< 
 *         self.filename = filename
 * 
 */
Py_INCREF(__pyx_v_message);
Py_DECREF(__pyx_v_self->message);
__pyx_v_self->message = __pyx_v_message;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":68
 *         self.column  = 0
 *         self.message = message
 *         self.filename = filename             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
Py_INCREF(__pyx_v_filename);
Py_DECREF(__pyx_v_self->filename);
__pyx_v_self->filename = __pyx_v_filename;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._LogEntry._setGeneric");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":70
 *         self.filename = filename
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "%s:%d:%d:%s:%s:%s: %s" % (
 *             self.filename, self.line, self.column, self.level_name,
 */

static PyObject *__pyx_n_level_name;
static PyObject *__pyx_n_domain_name;
static PyObject *__pyx_n_type_name;

static PyObject *__pyx_k451p;

static char __pyx_k451[] = "%s:%d:%d:%s:%s:%s: %s";

static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":72
 *     def __repr__(self):
 *         return "%s:%d:%d:%s:%s:%s: %s" % (
 *             self.filename, self.line, self.column, self.level_name,             # <<<<<<<<<<<<<< 
 *             self.domain_name, self.type_name, self.message)
 * 
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_level_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":73
 *         return "%s:%d:%d:%s:%s:%s: %s" % (
 *             self.filename, self.line, self.column, self.level_name,
 *             self.domain_name, self.type_name, self.message)             # <<<<<<<<<<<<<< 
 * 
 *     property domain_name:
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_domain_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":73
 *         return "%s:%d:%d:%s:%s:%s: %s" % (
 *             self.filename, self.line, self.column, self.level_name,
 *             self.domain_name, self.type_name, self.message)             # <<<<<<<<<<<<<< 
 * 
 *     property domain_name:
 */
__pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_type_name); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 73; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":73
 *         return "%s:%d:%d:%s:%s:%s: %s" % (
 *             self.filename, self.line, self.column, self.level_name,
 *             self.domain_name, self.type_name, self.message)             # <<<<<<<<<<<<<< 
 * 
 *     property domain_name:
 */
__pyx_4 = PyTuple_New(7); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->filename);
PyTuple_SET_ITEM(__pyx_4, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->filename);
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->line);
PyTuple_SET_ITEM(__pyx_4, 1, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->line);
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->column);
PyTuple_SET_ITEM(__pyx_4, 2, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->column);
PyTuple_SET_ITEM(__pyx_4, 3, __pyx_1);
PyTuple_SET_ITEM(__pyx_4, 4, __pyx_2);
PyTuple_SET_ITEM(__pyx_4, 5, __pyx_3);
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->message);
PyTuple_SET_ITEM(__pyx_4, 6, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->message);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_3 = 0;
__pyx_1 = PyNumber_Remainder(__pyx_k451p, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 71; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._LogEntry.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":76
 * 
 *     property domain_name:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return ErrorDomains._getName(self.domain, "unknown")
 * 
 */

static PyObject *__pyx_n__getName;
static PyObject *__pyx_n_unknown;


static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":77
 *     property domain_name:
 *         def __get__(self):
 *             return ErrorDomains._getName(self.domain, "unknown")             # <<<<<<<<<<<<<< 
 * 
 *     property type_name:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorDomains); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":77
 *     property domain_name:
 *         def __get__(self):
 *             return ErrorDomains._getName(self.domain, "unknown")             # <<<<<<<<<<<<<< 
 * 
 *     property type_name:
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->domain);
Py_INCREF(__pyx_n_unknown);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_unknown);
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 77; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._LogEntry.domain_name.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":80
 * 
 *     property type_name:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return ErrorTypes._getName(self.type, "unknown")
 * 
 */


static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":81
 *     property type_name:
 *         def __get__(self):
 *             return ErrorTypes._getName(self.type, "unknown")             # <<<<<<<<<<<<<< 
 * 
 *     property level_name:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":81
 *     property type_name:
 *         def __get__(self):
 *             return ErrorTypes._getName(self.type, "unknown")             # <<<<<<<<<<<<<< 
 * 
 *     property level_name:
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->type);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->type);
Py_INCREF(__pyx_n_unknown);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_unknown);
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._LogEntry.type_name.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":84
 * 
 *     property level_name:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return ErrorLevels._getName(self.level, "unknown")
 * 
 */


static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":85
 *     property level_name:
 *         def __get__(self):
 *             return ErrorLevels._getName(self.level, "unknown")             # <<<<<<<<<<<<<< 
 * 
 * cdef class _BaseErrorLog:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":85
 *     property level_name:
 *         def __get__(self):
 *             return ErrorLevels._getName(self.level, "unknown")             # <<<<<<<<<<<<<< 
 * 
 * cdef class _BaseErrorLog:
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->level);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_self)->level);
Py_INCREF(__pyx_n_unknown);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_n_unknown);
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 85; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._LogEntry.level_name.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":90
 *     cdef _LogEntry _first_error
 *     cdef readonly object last_error
 *     def __init__(self, first_error, last_error):             # <<<<<<<<<<<<<< 
 *         self._first_error = first_error
 *         self.last_error = last_error
 */

static int __pyx_pf_4lxml_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_first_error = 0;
PyObject *__pyx_v_last_error = 0;
int __pyx_r;
static char *__pyx_argnames[] = {"first_error","last_error",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_first_error, &__pyx_v_last_error))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_first_error);
Py_INCREF(__pyx_v_last_error);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":91
 *     cdef readonly object last_error
 *     def __init__(self, first_error, last_error):
 *         self._first_error = first_error             # <<<<<<<<<<<<<< 
 *         self.last_error = last_error
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_first_error, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 91; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":91
 *     cdef readonly object last_error
 *     def __init__(self, first_error, last_error):
 *         self._first_error = first_error             # <<<<<<<<<<<<<< 
 *         self.last_error = last_error
 * 
 */
Py_INCREF(__pyx_v_first_error);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_first_error);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":92
 *     def __init__(self, first_error, last_error):
 *         self._first_error = first_error
 *         self.last_error = last_error             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_INCREF(__pyx_v_last_error);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error = __pyx_v_last_error;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._BaseErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_first_error);
Py_DECREF(__pyx_v_last_error);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":94
 *         self.last_error = last_error
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         return _BaseErrorLog(self._first_error, self.last_error)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":95
 * 
 *     def copy(self):
 *         return _BaseErrorLog(self._first_error, self.last_error)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->_first_error));
Py_INCREF(((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
PyTuple_SET_ITEM(__pyx_1, 1, ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 95; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseErrorLog.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":97
 *         return _BaseErrorLog(self._first_error, self.last_error)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return ''
 * 
 */

static PyObject *__pyx_k455p;

static char __pyx_k455[] = "";

static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":98
 * 
 *     def __repr__(self):
 *         return ''             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _receive(self, xmlerror.xmlError* error):
 */
Py_INCREF(__pyx_k455p);
__pyx_r = __pyx_k455p;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":100
 *         return ''
 * 
 *     cdef void _receive(self, xmlerror.xmlError* error):             # <<<<<<<<<<<<<< 
 *         cdef bint is_error
 *         cdef _LogEntry entry
 */

static  void __pyx_f_4lxml_5etree_13_BaseErrorLog__receive(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self,xmlError *__pyx_v_error) {
int __pyx_v_is_error;
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":103
 *         cdef bint is_error
 *         cdef _LogEntry entry
 *         entry = _LogEntry()             # <<<<<<<<<<<<<< 
 *         entry._setError(error)
 *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__LogEntry), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 103; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entry));
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":104
 *         cdef _LogEntry entry
 *         entry = _LogEntry()
 *         entry._setError(error)             # <<<<<<<<<<<<<< 
 *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
 *                    error.level == xmlerror.XML_ERR_FATAL
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__LogEntry *)__pyx_v_entry->__pyx_vtab)->_setError(__pyx_v_entry,__pyx_v_error); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":105
 *         entry = _LogEntry()
 *         entry._setError(error)
 *         is_error = error.level == xmlerror.XML_ERR_ERROR or \             # <<<<<<<<<<<<<< 
 *                    error.level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 */
__pyx_2 = (__pyx_v_error->level == XML_ERR_ERROR);
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":106
 *         entry._setError(error)
 *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
 *                    error.level == xmlerror.XML_ERR_FATAL             # <<<<<<<<<<<<<< 
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)
 */
  __pyx_2 = (__pyx_v_error->level == XML_ERR_FATAL);
}
__pyx_v_is_error = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":107
 *         is_error = error.level == xmlerror.XML_ERR_ERROR or \
 *                    error.level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:             # <<<<<<<<<<<<<< 
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:
 */
__pyx_2 = (__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG != __pyx_v_self);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":108
 *                    error.level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)             # <<<<<<<<<<<<<< 
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG), __pyx_n_receive); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":108
 *                    error.level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)             # <<<<<<<<<<<<<< 
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_entry));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_entry));
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":109
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:             # <<<<<<<<<<<<<< 
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)
 */
  __pyx_2 = __pyx_v_is_error;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":110
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry             # <<<<<<<<<<<<<< 
 *         self.receive(entry)
 *         if is_error:
 */
    Py_INCREF(((PyObject *)__pyx_v_entry));
    Py_DECREF(__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG->last_error);
    __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG->last_error = ((PyObject *)__pyx_v_entry);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":111
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)             # <<<<<<<<<<<<<< 
 *         if is_error:
 *             self.last_error = entry
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_receive); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":111
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)             # <<<<<<<<<<<<<< 
 *         if is_error:
 *             self.last_error = entry
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_entry));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_entry));
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":112
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)
 *         if is_error:             # <<<<<<<<<<<<<< 
 *             self.last_error = entry
 * 
 */
__pyx_2 = __pyx_v_is_error;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":113
 *         self.receive(entry)
 *         if is_error:
 *             self.last_error = entry             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _receiveGeneric(self, int domain, int type, int level, int line,
 */
  Py_INCREF(((PyObject *)__pyx_v_entry));
  Py_DECREF(__pyx_v_self->last_error);
  __pyx_v_self->last_error = ((PyObject *)__pyx_v_entry);
  goto __pyx_L4;
}
__pyx_L4:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._BaseErrorLog._receive");
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":115
 *             self.last_error = entry
 * 
 *     cdef void _receiveGeneric(self, int domain, int type, int level, int line,             # <<<<<<<<<<<<<< 
 *                               message, filename):
 *         cdef bint is_error
 */

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) {
int __pyx_v_is_error;
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_message);
Py_INCREF(__pyx_v_filename);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":119
 *         cdef bint is_error
 *         cdef _LogEntry entry
 *         entry = _LogEntry()             # <<<<<<<<<<<<<< 
 *         entry._setGeneric(domain, type, level, line, message, filename)
 *         is_error = level == xmlerror.XML_ERR_ERROR or \
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__LogEntry), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entry));
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":120
 *         cdef _LogEntry entry
 *         entry = _LogEntry()
 *         entry._setGeneric(domain, type, level, line, message, filename)             # <<<<<<<<<<<<<< 
 *         is_error = level == xmlerror.XML_ERR_ERROR or \
 *                    level == xmlerror.XML_ERR_FATAL
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":121
 *         entry = _LogEntry()
 *         entry._setGeneric(domain, type, level, line, message, filename)
 *         is_error = level == xmlerror.XML_ERR_ERROR or \             # <<<<<<<<<<<<<< 
 *                    level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 */
__pyx_2 = (__pyx_v_level == XML_ERR_ERROR);
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":122
 *         entry._setGeneric(domain, type, level, line, message, filename)
 *         is_error = level == xmlerror.XML_ERR_ERROR or \
 *                    level == xmlerror.XML_ERR_FATAL             # <<<<<<<<<<<<<< 
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)
 */
  __pyx_2 = (__pyx_v_level == XML_ERR_FATAL);
}
__pyx_v_is_error = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":123
 *         is_error = level == xmlerror.XML_ERR_ERROR or \
 *                    level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:             # <<<<<<<<<<<<<< 
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:
 */
__pyx_2 = (__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG != __pyx_v_self);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":124
 *                    level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)             # <<<<<<<<<<<<<< 
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG), __pyx_n_receive); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":124
 *                    level == xmlerror.XML_ERR_FATAL
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)             # <<<<<<<<<<<<<< 
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_entry));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_entry));
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":125
 *         if __GLOBAL_ERROR_LOG is not self:
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:             # <<<<<<<<<<<<<< 
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)
 */
  __pyx_2 = __pyx_v_is_error;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":126
 *             __GLOBAL_ERROR_LOG.receive(entry)
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry             # <<<<<<<<<<<<<< 
 *         self.receive(entry)
 *         if is_error:
 */
    Py_INCREF(((PyObject *)__pyx_v_entry));
    Py_DECREF(__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG->last_error);
    __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG->last_error = ((PyObject *)__pyx_v_entry);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":127
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)             # <<<<<<<<<<<<<< 
 *         if is_error:
 *             self.last_error = entry
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_receive); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":127
 *             if is_error:
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)             # <<<<<<<<<<<<<< 
 *         if is_error:
 *             self.last_error = entry
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_entry));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_entry));
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":128
 *                 __GLOBAL_ERROR_LOG.last_error = entry
 *         self.receive(entry)
 *         if is_error:             # <<<<<<<<<<<<<< 
 *             self.last_error = entry
 * 
 */
__pyx_2 = __pyx_v_is_error;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":129
 *         self.receive(entry)
 *         if is_error:
 *             self.last_error = entry             # <<<<<<<<<<<<<< 
 * 
 *     cdef _buildParseException(self, exctype, default_message):
 */
  Py_INCREF(((PyObject *)__pyx_v_entry));
  Py_DECREF(__pyx_v_self->last_error);
  __pyx_v_self->last_error = ((PyObject *)__pyx_v_entry);
  goto __pyx_L4;
}
__pyx_L4:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._BaseErrorLog._receiveGeneric");
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_filename);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":131
 *             self.last_error = entry
 * 
 *     cdef _buildParseException(self, exctype, default_message):             # <<<<<<<<<<<<<< 
 *         code = xmlerror.XML_ERR_INTERNAL_ERROR
 *         if self._first_error is None:
 */

static PyObject *__pyx_k456p;
static PyObject *__pyx_k457p;

static char __pyx_k456[] = "%s, line %d, column %d";
static char __pyx_k457[] = "%s, line %d";

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) {
PyObject *__pyx_v_code;
PyObject *__pyx_v_message;
PyObject *__pyx_v_line;
PyObject *__pyx_v_column;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_exctype);
Py_INCREF(__pyx_v_default_message);
__pyx_v_code = Py_None; Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_line = Py_None; Py_INCREF(Py_None);
__pyx_v_column = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":132
 * 
 *     cdef _buildParseException(self, exctype, default_message):
 *         code = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<< 
 *         if self._first_error is None:
 *             return exctype(default_message, code, 0, 0)
 */
__pyx_1 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 132; goto __pyx_L1;}
Py_DECREF(__pyx_v_code);
__pyx_v_code = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":133
 *     cdef _buildParseException(self, exctype, default_message):
 *         code = xmlerror.XML_ERR_INTERNAL_ERROR
 *         if self._first_error is None:             # <<<<<<<<<<<<<< 
 *             return exctype(default_message, code, 0, 0)
 *         if self._first_error is None or \
 */
__pyx_2 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":134
 *         code = xmlerror.XML_ERR_INTERNAL_ERROR
 *         if self._first_error is None:
 *             return exctype(default_message, code, 0, 0)             # <<<<<<<<<<<<<< 
 *         if self._first_error is None or \
 *                 self._first_error.message is None or \
 */
  __pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_INCREF(__pyx_v_default_message);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_default_message);
  Py_INCREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_code);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_num_0);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_1, 3, __pyx_num_0);
  __pyx_3 = PyObject_CallObject(__pyx_v_exctype, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":135
 *         if self._first_error is None:
 *             return exctype(default_message, code, 0, 0)
 *         if self._first_error is None or \             # <<<<<<<<<<<<<< 
 *                 self._first_error.message is None or \
 *                 not self._first_error.message:
 */
__pyx_2 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":136
 *             return exctype(default_message, code, 0, 0)
 *         if self._first_error is None or \
 *                 self._first_error.message is None or \             # <<<<<<<<<<<<<< 
 *                 not self._first_error.message:
 *             message = default_message
 */
  __pyx_2 = (__pyx_v_self->_first_error->message == Py_None);
  if (!__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":137
 *         if self._first_error is None or \
 *                 self._first_error.message is None or \
 *                 not self._first_error.message:             # <<<<<<<<<<<<<< 
 *             message = default_message
 *             line = 0
 */
    __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_self->_first_error->message); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; goto __pyx_L1;}
    __pyx_2 = (!__pyx_4);
  }
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":138
 *                 self._first_error.message is None or \
 *                 not self._first_error.message:
 *             message = default_message             # <<<<<<<<<<<<<< 
 *             line = 0
 *             column = 0
 */
  Py_INCREF(__pyx_v_default_message);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_v_default_message;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":139
 *                 not self._first_error.message:
 *             message = default_message
 *             line = 0             # <<<<<<<<<<<<<< 
 *             column = 0
 *         else:
 */
  Py_INCREF(__pyx_num_0);
  Py_DECREF(__pyx_v_line);
  __pyx_v_line = __pyx_num_0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":140
 *             message = default_message
 *             line = 0
 *             column = 0             # <<<<<<<<<<<<<< 
 *         else:
 *             message = self._first_error.message
 */
  Py_INCREF(__pyx_num_0);
  Py_DECREF(__pyx_v_column);
  __pyx_v_column = __pyx_num_0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":142
 *             column = 0
 *         else:
 *             message = self._first_error.message             # <<<<<<<<<<<<<< 
 *             code = self._first_error.type
 *             line = self._first_error.line
 */
  Py_INCREF(__pyx_v_self->_first_error->message);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_v_self->_first_error->message;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":143
 *         else:
 *             message = self._first_error.message
 *             code = self._first_error.type             # <<<<<<<<<<<<<< 
 *             line = self._first_error.line
 *             column = self._first_error.column
 */
  Py_INCREF(__pyx_v_self->_first_error->type);
  Py_DECREF(__pyx_v_code);
  __pyx_v_code = __pyx_v_self->_first_error->type;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":144
 *             message = self._first_error.message
 *             code = self._first_error.type
 *             line = self._first_error.line             # <<<<<<<<<<<<<< 
 *             column = self._first_error.column
 *             if line > 0:
 */
  Py_INCREF(__pyx_v_self->_first_error->line);
  Py_DECREF(__pyx_v_line);
  __pyx_v_line = __pyx_v_self->_first_error->line;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":145
 *             code = self._first_error.type
 *             line = self._first_error.line
 *             column = self._first_error.column             # <<<<<<<<<<<<<< 
 *             if line > 0:
 *                 if column > 0:
 */
  Py_INCREF(__pyx_v_self->_first_error->column);
  Py_DECREF(__pyx_v_column);
  __pyx_v_column = __pyx_v_self->_first_error->column;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":146
 *             line = self._first_error.line
 *             column = self._first_error.column
 *             if line > 0:             # <<<<<<<<<<<<<< 
 *                 if column > 0:
 *                     message = "%s, line %d, column %d" % (message, line, column)
 */
  __pyx_1 = PyObject_RichCompare(__pyx_v_line, __pyx_num_0, Py_GT); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":147
 *             column = self._first_error.column
 *             if line > 0:
 *                 if column > 0:             # <<<<<<<<<<<<<< 
 *                     message = "%s, line %d, column %d" % (message, line, column)
 *                 else:
 */
    __pyx_3 = PyObject_RichCompare(__pyx_v_column, __pyx_num_0, Py_GT); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; goto __pyx_L1;}
    __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 147; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":148
 *             if line > 0:
 *                 if column > 0:
 *                     message = "%s, line %d, column %d" % (message, line, column)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     message = "%s, line %d" % (message, line)
 */
      __pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; goto __pyx_L1;}
      Py_INCREF(__pyx_v_message);
      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_message);
      Py_INCREF(__pyx_v_line);
      PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_line);
      Py_INCREF(__pyx_v_column);
      PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_column);
      __pyx_3 = PyNumber_Remainder(__pyx_k456p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 148; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_3;
      __pyx_3 = 0;
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":150
 *                     message = "%s, line %d, column %d" % (message, line, column)
 *                 else:
 *                     message = "%s, line %d" % (message, line)             # <<<<<<<<<<<<<< 
 *         return exctype(message, code, line, column)
 * 
 */
      __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; goto __pyx_L1;}
      Py_INCREF(__pyx_v_message);
      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_message);
      Py_INCREF(__pyx_v_line);
      PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_line);
      __pyx_3 = PyNumber_Remainder(__pyx_k457p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_3;
      __pyx_3 = 0;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":151
 *                 else:
 *                     message = "%s, line %d" % (message, line)
 *         return exctype(message, code, line, column)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _buildExceptionMessage(self, default_message):
 */
__pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; goto __pyx_L1;}
Py_INCREF(__pyx_v_message);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_message);
Py_INCREF(__pyx_v_code);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_code);
Py_INCREF(__pyx_v_line);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_line);
Py_INCREF(__pyx_v_column);
PyTuple_SET_ITEM(__pyx_1, 3, __pyx_v_column);
__pyx_3 = PyObject_CallObject(__pyx_v_exctype, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._BaseErrorLog._buildParseException");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_code);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_line);
Py_DECREF(__pyx_v_column);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_exctype);
Py_DECREF(__pyx_v_default_message);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":153
 *         return exctype(message, code, line, column)
 * 
 *     cdef _buildExceptionMessage(self, default_message):             # <<<<<<<<<<<<<< 
 *         if self._first_error is None:
 *             return default_message
 */

static PyObject *__pyx_k458p;
static PyObject *__pyx_k459p;

static char __pyx_k458[] = "%s, line %d, column %d";
static char __pyx_k459[] = "%s, line %d";

static  PyObject *__pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage(struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_self,PyObject *__pyx_v_default_message) {
PyObject *__pyx_v_message;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_default_message);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":154
 * 
 *     cdef _buildExceptionMessage(self, default_message):
 *         if self._first_error is None:             # <<<<<<<<<<<<<< 
 *             return default_message
 *         if self._first_error.message is not None and self._first_error.message:
 */
__pyx_1 = (((PyObject *)__pyx_v_self->_first_error) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":155
 *     cdef _buildExceptionMessage(self, default_message):
 *         if self._first_error is None:
 *             return default_message             # <<<<<<<<<<<<<< 
 *         if self._first_error.message is not None and self._first_error.message:
 *             message = self._first_error.message
 */
  Py_INCREF(__pyx_v_default_message);
  __pyx_r = __pyx_v_default_message;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":156
 *         if self._first_error is None:
 *             return default_message
 *         if self._first_error.message is not None and self._first_error.message:             # <<<<<<<<<<<<<< 
 *             message = self._first_error.message
 *         elif default_message is None:
 */
__pyx_1 = (__pyx_v_self->_first_error->message != Py_None);
__pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; goto __pyx_L1;}
if (__pyx_1) {
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":156
 *         if self._first_error is None:
 *             return default_message
 *         if self._first_error.message is not None and self._first_error.message:             # <<<<<<<<<<<<<< 
 *             message = self._first_error.message
 *         elif default_message is None:
 */
  __pyx_2 = __pyx_v_self->_first_error->message;
  Py_INCREF(__pyx_2);
}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":157
 *             return default_message
 *         if self._first_error.message is not None and self._first_error.message:
 *             message = self._first_error.message             # <<<<<<<<<<<<<< 
 *         elif default_message is None:
 *             return None
 */
  Py_INCREF(__pyx_v_self->_first_error->message);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_v_self->_first_error->message;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":158
 *         if self._first_error.message is not None and self._first_error.message:
 *             message = self._first_error.message
 *         elif default_message is None:             # <<<<<<<<<<<<<< 
 *             return None
 *         else:
 */
__pyx_1 = (__pyx_v_default_message == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":159
 *             message = self._first_error.message
 *         elif default_message is None:
 *             return None             # <<<<<<<<<<<<<< 
 *         else:
 *             message = default_message
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":161
 *             return None
 *         else:
 *             message = default_message             # <<<<<<<<<<<<<< 
 *         if self._first_error.line > 0:
 *             if self._first_error.column > 0:
 */
  Py_INCREF(__pyx_v_default_message);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_v_default_message;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":162
 *         else:
 *             message = default_message
 *         if self._first_error.line > 0:             # <<<<<<<<<<<<<< 
 *             if self._first_error.column > 0:
 *                 message = "%s, line %d, column %d" % (
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_self->_first_error->line, __pyx_num_0, Py_GT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":163
 *             message = default_message
 *         if self._first_error.line > 0:
 *             if self._first_error.column > 0:             # <<<<<<<<<<<<<< 
 *                 message = "%s, line %d, column %d" % (
 *                     message, self._first_error.line, self._first_error.column)
 */
  __pyx_2 = PyObject_RichCompare(__pyx_v_self->_first_error->column, __pyx_num_0, Py_GT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; goto __pyx_L1;}
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":165
 *             if self._first_error.column > 0:
 *                 message = "%s, line %d, column %d" % (
 *                     message, self._first_error.line, self._first_error.column)             # <<<<<<<<<<<<<< 
 *             else:
 *                 message = "%s, line %d" % (message, self._first_error.line)
 */
    __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; goto __pyx_L1;}
    Py_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_message);
    Py_INCREF(__pyx_v_self->_first_error->line);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_self->_first_error->line);
    Py_INCREF(__pyx_v_self->_first_error->column);
    PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_self->_first_error->column);
    __pyx_3 = PyNumber_Remainder(__pyx_k458p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":167
 *                     message, self._first_error.line, self._first_error.column)
 *             else:
 *                 message = "%s, line %d" % (message, self._first_error.line)             # <<<<<<<<<<<<<< 
 *         return message
 * 
 */
    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; goto __pyx_L1;}
    Py_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_message);
    Py_INCREF(__pyx_v_self->_first_error->line);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_self->_first_error->line);
    __pyx_3 = PyNumber_Remainder(__pyx_k459p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 167; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":168
 *             else:
 *                 message = "%s, line %d" % (message, self._first_error.line)
 *         return message             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ListErrorLog(_BaseErrorLog):
 */
Py_INCREF(__pyx_v_message);
__pyx_r = __pyx_v_message;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._BaseErrorLog._buildExceptionMessage");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_default_message);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":173
 *     "Immutable base version of a list based error log."
 *     cdef object _entries
 *     def __init__(self, entries, first_error, last_error):             # <<<<<<<<<<<<<< 
 *         if entries:
 *             if first_error is None:
 */

static int __pyx_pf_4lxml_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entries = 0;
PyObject *__pyx_v_first_error = 0;
PyObject *__pyx_v_last_error = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"entries","first_error","last_error",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_entries, &__pyx_v_first_error, &__pyx_v_last_error))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entries);
Py_INCREF(__pyx_v_first_error);
Py_INCREF(__pyx_v_last_error);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":174
 *     cdef object _entries
 *     def __init__(self, entries, first_error, last_error):
 *         if entries:             # <<<<<<<<<<<<<< 
 *             if first_error is None:
 *                 first_error = entries[0]
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_entries); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":175
 *     def __init__(self, entries, first_error, last_error):
 *         if entries:
 *             if first_error is None:             # <<<<<<<<<<<<<< 
 *                 first_error = entries[0]
 *             if last_error is None:
 */
  __pyx_1 = (__pyx_v_first_error == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":176
 *         if entries:
 *             if first_error is None:
 *                 first_error = entries[0]             # <<<<<<<<<<<<<< 
 *             if last_error is None:
 *                 last_error = entries[-1]
 */
    if (PyList_CheckExact(__pyx_v_entries) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_entries)) {
      __pyx_3 = PyList_GET_ITEM(__pyx_v_entries, 0); Py_INCREF(__pyx_3);
      } else if (PyTuple_CheckExact(__pyx_v_entries) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_entries)) {
      __pyx_3 = PyTuple_GET_ITEM(__pyx_v_entries, 0); Py_INCREF(__pyx_3);
      } else {
      __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; goto __pyx_L1;}
      __pyx_3 = PyObject_GetItem(__pyx_v_entries, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    }
    Py_DECREF(__pyx_v_first_error);
    __pyx_v_first_error = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":177
 *             if first_error is None:
 *                 first_error = entries[0]
 *             if last_error is None:             # <<<<<<<<<<<<<< 
 *                 last_error = entries[-1]
 *         _BaseErrorLog.__init__(self, first_error, last_error)
 */
  __pyx_1 = (__pyx_v_last_error == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":178
 *                 first_error = entries[0]
 *             if last_error is None:
 *                 last_error = entries[-1]             # <<<<<<<<<<<<<< 
 *         _BaseErrorLog.__init__(self, first_error, last_error)
 *         self._entries = entries
 */
    if (PyList_CheckExact(__pyx_v_entries) && 0 <= -1 && -1 < PyList_GET_SIZE(__pyx_v_entries)) {
      __pyx_3 = PyList_GET_ITEM(__pyx_v_entries, -1); Py_INCREF(__pyx_3);
      } else if (PyTuple_CheckExact(__pyx_v_entries) && 0 <= -1 && -1 < PyTuple_GET_SIZE(__pyx_v_entries)) {
      __pyx_3 = PyTuple_GET_ITEM(__pyx_v_entries, -1); Py_INCREF(__pyx_3);
      } else {
      __pyx_2 = PyInt_FromLong(-1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; goto __pyx_L1;}
      __pyx_3 = PyObject_GetItem(__pyx_v_entries, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    }
    Py_DECREF(__pyx_v_last_error);
    __pyx_v_last_error = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":179
 *             if last_error is None:
 *                 last_error = entries[-1]
 *         _BaseErrorLog.__init__(self, first_error, last_error)             # <<<<<<<<<<<<<< 
 *         self._entries = entries
 * 
 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog), __pyx_n___init__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":179
 *             if last_error is None:
 *                 last_error = entries[-1]
 *         _BaseErrorLog.__init__(self, first_error, last_error)             # <<<<<<<<<<<<<< 
 *         self._entries = entries
 * 
 */
__pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_first_error);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_first_error);
Py_INCREF(__pyx_v_last_error);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_last_error);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 179; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":180
 *                 last_error = entries[-1]
 *         _BaseErrorLog.__init__(self, first_error, last_error)
 *         self._entries = entries             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_INCREF(__pyx_v_entries);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries);
((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries = __pyx_v_entries;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entries);
Py_DECREF(__pyx_v_first_error);
Py_DECREF(__pyx_v_last_error);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":182
 *         self._entries = entries
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         """Creates a shallow copy of this error log.  Reuses the list of
 *         entries.
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_copy[] = "Creates a shallow copy of this error log.  Reuses the list of\n        entries.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":186
 *         entries.
 *         """
 *         return _ListErrorLog(self._entries, self._first_error, self.last_error)             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries);
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base._first_error));
PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base._first_error));
Py_INCREF(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
PyTuple_SET_ITEM(__pyx_1, 2, ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":188
 *         return _ListErrorLog(self._entries, self._first_error, self.last_error)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return iter(self._entries)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":189
 * 
 *     def __iter__(self):
 *         return iter(self._entries)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 189; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":191
 *         return iter(self._entries)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         l = []
 *         for entry in self._entries:
 */

static PyObject *__pyx_k460p;

static char __pyx_k460[] = "\n";

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_l;
PyObject *__pyx_v_entry;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_l = Py_None; Py_INCREF(Py_None);
__pyx_v_entry = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":192
 * 
 *     def __repr__(self):
 *         l = []             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             python.PyList_Append(l, repr(entry))
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 192; goto __pyx_L1;}
Py_DECREF(__pyx_v_l);
__pyx_v_l = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":193
 *     def __repr__(self):
 *         l = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(l, repr(entry))
 *         return '\n'.join(l)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_2 = 0; __pyx_1 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 193; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":193
 *     def __repr__(self):
 *         l = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(l, repr(entry))
 *         return '\n'.join(l)
 */
  if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      break;
    }
  }
  Py_DECREF(__pyx_v_entry);
  __pyx_v_entry = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":194
 *         l = []
 *         for entry in self._entries:
 *             python.PyList_Append(l, repr(entry))             # <<<<<<<<<<<<<< 
 *         return '\n'.join(l)
 * 
 */
  __pyx_3 = PyObject_Repr(__pyx_v_entry); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; goto __pyx_L1;}
  __pyx_4 = PyList_Append(__pyx_v_l,__pyx_3); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 194; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":195
 *         for entry in self._entries:
 *             python.PyList_Append(l, repr(entry))
 *         return '\n'.join(l)             # <<<<<<<<<<<<<< 
 * 
 *     def __getitem__(self, index):
 */
__pyx_3 = PyObject_GetAttr(__pyx_k460p, __pyx_n_join); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":195
 *         for entry in self._entries:
 *             python.PyList_Append(l, repr(entry))
 *         return '\n'.join(l)             # <<<<<<<<<<<<<< 
 * 
 *     def __getitem__(self, index):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
Py_INCREF(__pyx_v_l);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_l);
__pyx_5 = PyObject_CallObject(__pyx_3, __pyx_1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_5;
__pyx_5 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_l);
Py_DECREF(__pyx_v_entry);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":197
 *         return '\n'.join(l)
 * 
 *     def __getitem__(self, index):             # <<<<<<<<<<<<<< 
 *         return self._entries[index]
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_index);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":198
 * 
 *     def __getitem__(self, index):
 *         return self._entries[index]             # <<<<<<<<<<<<<< 
 * 
 *     def __len__(self):
 */
__pyx_1 = PyObject_GetItem(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries, __pyx_v_index); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 198; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_index);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":200
 *         return self._entries[index]
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<< 
 *         return len(self._entries)
 * 
 */

static Py_ssize_t __pyx_pf_4lxml_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_4lxml_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
Py_ssize_t __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":201
 * 
 *     def __len__(self):
 *         return len(self._entries)             # <<<<<<<<<<<<<< 
 * 
 *     def __contains__(self, error_type):
 */
__pyx_1 = PyObject_Length(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__len__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":203
 *         return len(self._entries)
 * 
 *     def __contains__(self, error_type):             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             if entry.type == error_type:
 */

static PyObject *__pyx_n_type;

static int __pyx_pf_4lxml_5etree_13_ListErrorLog___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_error_type); /*proto*/
static int __pyx_pf_4lxml_5etree_13_ListErrorLog___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_error_type) {
PyObject *__pyx_v_entry;
int __pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
int __pyx_6;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_error_type);
__pyx_v_entry = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":204
 * 
 *     def __contains__(self, error_type):
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.type == error_type:
 *                 return True
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_1 = 0; __pyx_2 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 204; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":204
 * 
 *     def __contains__(self, error_type):
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.type == error_type:
 *                 return True
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  Py_DECREF(__pyx_v_entry);
  __pyx_v_entry = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":205
 *     def __contains__(self, error_type):
 *         for entry in self._entries:
 *             if entry.type == error_type:             # <<<<<<<<<<<<<< 
 *                 return True
 *         return False
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_entry, __pyx_n_type); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":205
 *     def __contains__(self, error_type):
 *         for entry in self._entries:
 *             if entry.type == error_type:             # <<<<<<<<<<<<<< 
 *                 return True
 *         return False
 */
  __pyx_4 = PyObject_RichCompare(__pyx_3, __pyx_v_error_type, Py_EQ); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_5 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 205; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":206
 *         for entry in self._entries:
 *             if entry.type == error_type:
 *                 return True             # <<<<<<<<<<<<<< 
 *         return False
 * 
 */
    __pyx_6 = PyInt_AsLong(Py_True); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; goto __pyx_L1;}
    __pyx_r = __pyx_6;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":207
 *             if entry.type == error_type:
 *                 return True
 *         return False             # <<<<<<<<<<<<<< 
 * 
 *     def __nonzero__(self):
 */
__pyx_6 = PyInt_AsLong(Py_False); if (unlikely((__pyx_6 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 207; goto __pyx_L1;}
__pyx_r = __pyx_6;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__contains__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_error_type);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":209
 *         return False
 * 
 *     def __nonzero__(self):             # <<<<<<<<<<<<<< 
 *         cdef bint result
 *         result = self._entries
 */

static int __pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__(PyObject *__pyx_v_self) {
int __pyx_v_result;
int __pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":211
 *     def __nonzero__(self):
 *         cdef bint result
 *         result = self._entries             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 211; goto __pyx_L1;}
__pyx_v_result = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":212
 *         cdef bint result
 *         result = self._entries
 *         return result             # <<<<<<<<<<<<<< 
 * 
 *     def filter_domains(self, domains):
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ListErrorLog.__nonzero__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":214
 *         return result
 * 
 *     def filter_domains(self, domains):             # <<<<<<<<<<<<<< 
 *         """Filter the errors by the given domains and return a new error log
 *         containing the matches.
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domains); /*proto*/
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        ";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_v_domains) {
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_domains);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":219
 *         """
 *         cdef _LogEntry entry
 *         filtered = []             # <<<<<<<<<<<<<< 
 *         if not python.PySequence_Check(domains):
 *             domains = (domains,)
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":220
 *         cdef _LogEntry entry
 *         filtered = []
 *         if not python.PySequence_Check(domains):             # <<<<<<<<<<<<<< 
 *             domains = (domains,)
 *         for entry in self._entries:
 */
__pyx_2 = (!PySequence_Check(__pyx_v_domains));
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":221
 *         filtered = []
 *         if not python.PySequence_Check(domains):
 *             domains = (domains,)             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             if entry.domain in domains:
 */
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 221; goto __pyx_L1;}
  Py_INCREF(__pyx_v_domains);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_domains);
  Py_DECREF(__pyx_v_domains);
  __pyx_v_domains = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":222
 *         if not python.PySequence_Check(domains):
 *             domains = (domains,)
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.domain in domains:
 *                 python.PyList_Append(filtered, entry)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_3 = 0; __pyx_1 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":222
 *         if not python.PySequence_Check(domains):
 *             domains = (domains,)
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.domain in domains:
 *                 python.PyList_Append(filtered, entry)
 */
  if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_4 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_1);
    if (!__pyx_4) {
      break;
    }
  }
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":223
 *             domains = (domains,)
 *         for entry in self._entries:
 *             if entry.domain in domains:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)
 */
  __pyx_2 = (PySequence_Contains(__pyx_v_domains, __pyx_v_entry->domain)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 223; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":224
 *         for entry in self._entries:
 *             if entry.domain in domains:
 *                 python.PyList_Append(filtered, entry)             # <<<<<<<<<<<<<< 
 *         return _ListErrorLog(filtered, None, None)
 * 
 */
    __pyx_5 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":225
 *             if entry.domain in domains:
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def filter_types(self, types):
 */
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 225; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_filtered);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 2, Py_None);
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_domains");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_filtered);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_domains);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":227
 *         return _ListErrorLog(filtered, None, None)
 * 
 *     def filter_types(self, types):             # <<<<<<<<<<<<<< 
 *         """Filter the errors by the given types and return a new error log
 *         containing the matches.
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_types[] = "Filter the errors by the given types and return a new error log\n        containing the matches.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_v_types) {
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_types);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":232
 *         """
 *         cdef _LogEntry entry
 *         if not python.PySequence_Check(types):             # <<<<<<<<<<<<<< 
 *             types = (types,)
 *         filtered = []
 */
__pyx_1 = (!PySequence_Check(__pyx_v_types));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":233
 *         cdef _LogEntry entry
 *         if not python.PySequence_Check(types):
 *             types = (types,)             # <<<<<<<<<<<<<< 
 *         filtered = []
 *         for entry in self._entries:
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; goto __pyx_L1;}
  Py_INCREF(__pyx_v_types);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_types);
  Py_DECREF(__pyx_v_types);
  __pyx_v_types = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":234
 *         if not python.PySequence_Check(types):
 *             types = (types,)
 *         filtered = []             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             if entry.type in types:
 */
__pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 234; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":235
 *             types = (types,)
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.type in types:
 *                 python.PyList_Append(filtered, entry)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_3 = 0; __pyx_2 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":235
 *             types = (types,)
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.type in types:
 *                 python.PyList_Append(filtered, entry)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_2);
    if (!__pyx_4) {
      break;
    }
  }
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 235; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":236
 *         filtered = []
 *         for entry in self._entries:
 *             if entry.type in types:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)
 */
  __pyx_1 = (PySequence_Contains(__pyx_v_types, __pyx_v_entry->type)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 236; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":237
 *         for entry in self._entries:
 *             if entry.type in types:
 *                 python.PyList_Append(filtered, entry)             # <<<<<<<<<<<<<< 
 *         return _ListErrorLog(filtered, None, None)
 * 
 */
    __pyx_5 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":238
 *             if entry.type in types:
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def filter_levels(self, levels):
 */
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_filtered);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 2, Py_None);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 238; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_types");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_filtered);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_types);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":240
 *         return _ListErrorLog(filtered, None, None)
 * 
 *     def filter_levels(self, levels):             # <<<<<<<<<<<<<< 
 *         """Filter the errors by the given error levels and return a new error
 *         log containing the matches.
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_v_levels); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_levels[] = "Filter the errors by the given error levels and return a new error\n        log containing the matches.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_v_levels) {
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_levels);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":245
 *         """
 *         cdef _LogEntry entry
 *         if not python.PySequence_Check(levels):             # <<<<<<<<<<<<<< 
 *             levels = (levels,)
 *         filtered = []
 */
__pyx_1 = (!PySequence_Check(__pyx_v_levels));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":246
 *         cdef _LogEntry entry
 *         if not python.PySequence_Check(levels):
 *             levels = (levels,)             # <<<<<<<<<<<<<< 
 *         filtered = []
 *         for entry in self._entries:
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_INCREF(__pyx_v_levels);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_levels);
  Py_DECREF(__pyx_v_levels);
  __pyx_v_levels = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":247
 *         if not python.PySequence_Check(levels):
 *             levels = (levels,)
 *         filtered = []             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             if entry.level in levels:
 */
__pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 247; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":248
 *             levels = (levels,)
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.level in levels:
 *                 python.PyList_Append(filtered, entry)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_3 = 0; __pyx_2 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":248
 *             levels = (levels,)
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.level in levels:
 *                 python.PyList_Append(filtered, entry)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_2);
    if (!__pyx_4) {
      break;
    }
  }
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 248; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":249
 *         filtered = []
 *         for entry in self._entries:
 *             if entry.level in levels:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)
 */
  __pyx_1 = (PySequence_Contains(__pyx_v_levels, __pyx_v_entry->level)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 249; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":250
 *         for entry in self._entries:
 *             if entry.level in levels:
 *                 python.PyList_Append(filtered, entry)             # <<<<<<<<<<<<<< 
 *         return _ListErrorLog(filtered, None, None)
 * 
 */
    __pyx_5 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 250; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":251
 *             if entry.level in levels:
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def filter_from_level(self, level):
 */
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 251; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_filtered);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 2, Py_None);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 251; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_levels");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_filtered);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_levels);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":253
 *         return _ListErrorLog(filtered, None, None)
 * 
 *     def filter_from_level(self, level):             # <<<<<<<<<<<<<< 
 *         "Return a log with all messages of the requested level of worse."
 *         cdef _LogEntry entry
 */

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_level[] = "Return a log with all messages of the requested level of worse.";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_v_level) {
struct __pyx_obj_4lxml_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_level);
__pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":256
 *         "Return a log with all messages of the requested level of worse."
 *         cdef _LogEntry entry
 *         filtered = []             # <<<<<<<<<<<<<< 
 *         for entry in self._entries:
 *             if entry.level >= level:
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 256; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":257
 *         cdef _LogEntry entry
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.level >= level:
 *                 python.PyList_Append(filtered, entry)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries)) { __pyx_2 = 0; __pyx_1 = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":257
 *         cdef _LogEntry entry
 *         filtered = []
 *         for entry in self._entries:             # <<<<<<<<<<<<<< 
 *             if entry.level >= level:
 *                 python.PyList_Append(filtered, entry)
 */
  if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      break;
    }
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":258
 *         filtered = []
 *         for entry in self._entries:
 *             if entry.level >= level:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)
 */
  __pyx_3 = PyObject_RichCompare(__pyx_v_entry->level, __pyx_v_level, Py_GE); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_4 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 258; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":259
 *         for entry in self._entries:
 *             if entry.level >= level:
 *                 python.PyList_Append(filtered, entry)             # <<<<<<<<<<<<<< 
 *         return _ListErrorLog(filtered, None, None)
 * 
 */
    __pyx_5 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 259; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":260
 *             if entry.level >= level:
 *                 python.PyList_Append(filtered, entry)
 *         return _ListErrorLog(filtered, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def filter_from_fatals(self):
 */
__pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filtered);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_3, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_3, 2, Py_None);
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 260; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_level");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_filtered);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_level);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":262
 *         return _ListErrorLog(filtered, None, None)
 * 
 *     def filter_from_fatals(self):             # <<<<<<<<<<<<<< 
 *         "Convenience method to get all fatal error messages."
 *         return self.filter_from_level(ErrorLevels.FATAL)
 */

static PyObject *__pyx_n_FATAL;

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_fatals[] = "Convenience method to get all fatal error messages.";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":264
 *     def filter_from_fatals(self):
 *         "Convenience method to get all fatal error messages."
 *         return self.filter_from_level(ErrorLevels.FATAL)             # <<<<<<<<<<<<<< 
 *     
 *     def filter_from_errors(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":264
 *     def filter_from_fatals(self):
 *         "Convenience method to get all fatal error messages."
 *         return self.filter_from_level(ErrorLevels.FATAL)             # <<<<<<<<<<<<<< 
 *     
 *     def filter_from_errors(self):
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_FATAL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 264; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_fatals");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":266
 *         return self.filter_from_level(ErrorLevels.FATAL)
 *     
 *     def filter_from_errors(self):             # <<<<<<<<<<<<<< 
 *         "Convenience method to get all error messages or worse."
 *         return self.filter_from_level(ErrorLevels.ERROR)
 */

static PyObject *__pyx_n_ERROR;

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_errors[] = "Convenience method to get all error messages or worse.";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":268
 *     def filter_from_errors(self):
 *         "Convenience method to get all error messages or worse."
 *         return self.filter_from_level(ErrorLevels.ERROR)             # <<<<<<<<<<<<<< 
 *     
 *     def filter_from_warnings(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":268
 *     def filter_from_errors(self):
 *         "Convenience method to get all error messages or worse."
 *         return self.filter_from_level(ErrorLevels.ERROR)             # <<<<<<<<<<<<<< 
 *     
 *     def filter_from_warnings(self):
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_ERROR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_errors");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":270
 *         return self.filter_from_level(ErrorLevels.ERROR)
 *     
 *     def filter_from_warnings(self):             # <<<<<<<<<<<<<< 
 *         "Convenience method to get all warnings or worse."
 *         return self.filter_from_level(ErrorLevels.WARNING)
 */

static PyObject *__pyx_n_WARNING;

static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_warnings[] = "Convenience method to get all warnings or worse.";
static PyObject *__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":272
 *     def filter_from_warnings(self):
 *         "Convenience method to get all warnings or worse."
 *         return self.filter_from_level(ErrorLevels.WARNING)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ErrorLog(_ListErrorLog):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 272; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":272
 *     def filter_from_warnings(self):
 *         "Convenience method to get all warnings or worse."
 *         return self.filter_from_level(ErrorLevels.WARNING)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ErrorLog(_ListErrorLog):
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 272; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_WARNING); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 272; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 272; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 272; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ListErrorLog.filter_from_warnings");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":275
 * 
 * cdef class _ErrorLog(_ListErrorLog):
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         _ListErrorLog.__init__(self, [], None, None)
 * 
 */

static int __pyx_pf_4lxml_5etree_9_ErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_9_ErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":276
 * cdef class _ErrorLog(_ListErrorLog):
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void connect(self):
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":276
 * cdef class _ErrorLog(_ListErrorLog):
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void connect(self):
 */
__pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":276
 * cdef class _ErrorLog(_ListErrorLog):
 *     def __init__(self):
 *         _ListErrorLog.__init__(self, [], None, None)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void connect(self):
 */
__pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_3, 2, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_3, 3, Py_None);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":278
 *         _ListErrorLog.__init__(self, [], None, None)
 * 
 *     cdef void connect(self):             # <<<<<<<<<<<<<< 
 *         self._first_error = None
 *         del self._entries[:]
 */

static  void __pyx_f_4lxml_5etree_9_ErrorLog_connect(struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":279
 * 
 *     cdef void connect(self):
 *         self._first_error = None             # <<<<<<<<<<<<<< 
 *         del self._entries[:]
 *         connectErrorLog(<void*>self)
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)__pyx_v_self->__pyx_base.__pyx_base._first_error));
__pyx_v_self->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":280
 *     cdef void connect(self):
 *         self._first_error = None
 *         del self._entries[:]             # <<<<<<<<<<<<<< 
 *         connectErrorLog(<void*>self)
 * 
 */
if (PySequence_DelSlice(__pyx_v_self->__pyx_base._entries, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":281
 *         self._first_error = None
 *         del self._entries[:]
 *         connectErrorLog(<void*>self)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void disconnect(self):
 */
__pyx_f_4lxml_5etree_connectErrorLog(((void *)__pyx_v_self));

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree._ErrorLog.connect");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":283
 *         connectErrorLog(<void*>self)
 * 
 *     cdef void disconnect(self):             # <<<<<<<<<<<<<< 
 *         connectErrorLog(NULL)
 * 
 */

static  void __pyx_f_4lxml_5etree_9_ErrorLog_disconnect(struct __pyx_obj_4lxml_5etree__ErrorLog *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":284
 * 
 *     cdef void disconnect(self):
 *         connectErrorLog(NULL)             # <<<<<<<<<<<<<< 
 * 
 *     def clear(self):
 */
__pyx_f_4lxml_5etree_connectErrorLog(NULL);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":286
 *         connectErrorLog(NULL)
 * 
 *     def clear(self):             # <<<<<<<<<<<<<< 
 *         self._first_error = None
 *         del self._entries[:]
 */

static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":287
 * 
 *     def clear(self):
 *         self._first_error = None             # <<<<<<<<<<<<<< 
 *         del self._entries[:]
 * 
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":288
 *     def clear(self):
 *         self._first_error = None
 *         del self._entries[:]             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
if (PySequence_DelSlice(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 288; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ErrorLog.clear");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":290
 *         del self._entries[:]
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         """Creates a shallow copy of this error log and the list of entries.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_9_ErrorLog_copy[] = "Creates a shallow copy of this error log and the list of entries.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":293
 *         """Creates a shallow copy of this error log and the list of entries.
 *         """
 *         return _ListErrorLog(self._entries[:], self._first_error,             # <<<<<<<<<<<<<< 
 *                              self.last_error)
 * 
 */
__pyx_1 = PySequence_GetSlice(((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[3]; __pyx_lineno = 293; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":294
 *         """
 *         return _ListErrorLog(self._entries[:], self._first_error,
 *                              self.last_error)             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
Py_INCREF(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
PyTuple_SET_ITEM(__pyx_2, 2, ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ErrorLog.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":296
 *                              self.last_error)
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return iter(self._entries[:])
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":297
 * 
 *     def __iter__(self):
 *         return iter(self._entries[:])             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
__pyx_1 = PySequence_GetSlice(((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[3]; __pyx_lineno = 297; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 297; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ErrorLog.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":299
 *         return iter(self._entries[:])
 * 
 *     def receive(self, entry):             # <<<<<<<<<<<<<< 
 *         if self._first_error is None:
 *             self._first_error = entry
 */

static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":300
 * 
 *     def receive(self, entry):
 *         if self._first_error is None:             # <<<<<<<<<<<<<< 
 *             self._first_error = entry
 *         python.PyList_Append(self._entries, entry)
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":301
 *     def receive(self, entry):
 *         if self._first_error is None:
 *             self._first_error = entry             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._entries, entry)
 * 
 */
  if (!__Pyx_TypeTest(__pyx_v_entry, __pyx_ptype_4lxml_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 301; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":301
 *     def receive(self, entry):
 *         if self._first_error is None:
 *             self._first_error = entry             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._entries, entry)
 * 
 */
  Py_INCREF(__pyx_v_entry);
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error));
  ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)__pyx_v_entry);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":302
 *         if self._first_error is None:
 *             self._first_error = entry
 *         python.PyList_Append(self._entries, entry)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _DomainErrorLog(_ErrorLog):
 */
__pyx_2 = PyList_Append(((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries,__pyx_v_entry); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 302; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ErrorLog.receive");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":305
 * 
 * cdef class _DomainErrorLog(_ErrorLog):
 *     def __init__(self, domains):             # <<<<<<<<<<<<<< 
 *         _ErrorLog.__init__(self)
 *         self._accepted_domains = tuple(domains)
 */

static PyObject *__pyx_n__accepted_domains;

static int __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_15_DomainErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_domains = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"domains",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_domains))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_domains);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":306
 * cdef class _DomainErrorLog(_ErrorLog):
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._accepted_domains = tuple(domains)
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":306
 * cdef class _DomainErrorLog(_ErrorLog):
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._accepted_domains = tuple(domains)
 * 
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 306; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":307
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)
 *         self._accepted_domains = tuple(domains)             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 307; goto __pyx_L1;}
Py_INCREF(__pyx_v_domains);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_domains);
__pyx_2 = PyObject_CallObject(((PyObject*)&PyTuple_Type), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 307; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":307
 *     def __init__(self, domains):
 *         _ErrorLog.__init__(self)
 *         self._accepted_domains = tuple(domains)             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n__accepted_domains, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 307; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._DomainErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_domains);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":309
 *         self._accepted_domains = tuple(domains)
 * 
 *     def receive(self, entry):             # <<<<<<<<<<<<<< 
 *         if entry.domain in self._accepted_domains:
 *             _ErrorLog.receive(self, entry)
 */

static PyObject *__pyx_n_domain;

static PyObject *__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":310
 * 
 *     def receive(self, entry):
 *         if entry.domain in self._accepted_domains:             # <<<<<<<<<<<<<< 
 *             _ErrorLog.receive(self, entry)
 * 
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_entry, __pyx_n_domain); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":310
 * 
 *     def receive(self, entry):
 *         if entry.domain in self._accepted_domains:             # <<<<<<<<<<<<<< 
 *             _ErrorLog.receive(self, entry)
 * 
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n__accepted_domains); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; goto __pyx_L1;}
__pyx_3 = (PySequence_Contains(__pyx_2, __pyx_1)); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 310; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":311
 *     def receive(self, entry):
 *         if entry.domain in self._accepted_domains:
 *             _ErrorLog.receive(self, entry)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _RotatingErrorLog(_ErrorLog):
 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), __pyx_n_receive); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":311
 *     def receive(self, entry):
 *         if entry.domain in self._accepted_domains:
 *             _ErrorLog.receive(self, entry)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _RotatingErrorLog(_ErrorLog):
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  Py_INCREF(__pyx_v_entry);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_entry);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 311; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._DomainErrorLog.receive");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":315
 * cdef class _RotatingErrorLog(_ErrorLog):
 *     cdef int _max_len
 *     def __init__(self, max_len):             # <<<<<<<<<<<<<< 
 *         _ErrorLog.__init__(self)
 *         self._max_len = max_len
 */

static int __pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_max_len = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"max_len",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_max_len))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_max_len);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":316
 *     cdef int _max_len
 *     def __init__(self, max_len):
 *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._max_len = max_len
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":316
 *     cdef int _max_len
 *     def __init__(self, max_len):
 *         _ErrorLog.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._max_len = max_len
 * 
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 316; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":317
 *     def __init__(self, max_len):
 *         _ErrorLog.__init__(self)
 *         self._max_len = max_len             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
__pyx_4 = PyInt_AsLong(__pyx_v_max_len); if (unlikely((__pyx_4 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 317; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":317
 *     def __init__(self, max_len):
 *         _ErrorLog.__init__(self)
 *         self._max_len = max_len             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->_max_len = __pyx_4;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._RotatingErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_max_len);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":319
 *         self._max_len = max_len
 * 
 *     def receive(self, entry):             # <<<<<<<<<<<<<< 
 *         entries = self._entries
 *         if python.PyList_GET_SIZE(entries) > self._max_len:
 */

static PyObject *__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
PyObject *__pyx_v_entries;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);
__pyx_v_entries = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":320
 * 
 *     def receive(self, entry):
 *         entries = self._entries             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(entries) > self._max_len:
 *             del entries[0]
 */
Py_INCREF(((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries);
Py_DECREF(__pyx_v_entries);
__pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":321
 *     def receive(self, entry):
 *         entries = self._entries
 *         if python.PyList_GET_SIZE(entries) > self._max_len:             # <<<<<<<<<<<<<< 
 *             del entries[0]
 *         python.PyList_Append(entries, entry)
 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_entries) > ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)__pyx_v_self)->_max_len);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":322
 *         entries = self._entries
 *         if python.PyList_GET_SIZE(entries) > self._max_len:
 *             del entries[0]             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(entries, entry)
 * 
 */
  __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 322; goto __pyx_L1;}
  if (PyObject_DelItem(__pyx_v_entries, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 322; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":323
 *         if python.PyList_GET_SIZE(entries) > self._max_len:
 *             del entries[0]
 *         python.PyList_Append(entries, entry)             # <<<<<<<<<<<<<< 
 * 
 * cdef class PyErrorLog(_BaseErrorLog):
 */
__pyx_3 = PyList_Append(__pyx_v_entries,__pyx_v_entry); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 323; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._RotatingErrorLog.receive");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_entries);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":346
 *     cdef object _map_level
 *     cdef object _log
 *     def __init__(self, logger_name=None):             # <<<<<<<<<<<<<< 
 *         _BaseErrorLog.__init__(self, None, None)
 *         import logging
 */

static PyObject *__pyx_n_logging;
static PyObject *__pyx_n_CRITICAL;
static PyObject *__pyx_n_getLogger;


static int __pyx_pf_4lxml_5etree_10PyErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_10PyErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_logger_name = 0;
PyObject *__pyx_v_logging;
PyObject *__pyx_v_logger;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"logger_name",0};
__pyx_v_logger_name = __pyx_k127;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_logger_name))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_logger_name);
__pyx_v_logging = Py_None; Py_INCREF(Py_None);
__pyx_v_logger = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":347
 *     cdef object _log
 *     def __init__(self, logger_name=None):
 *         _BaseErrorLog.__init__(self, None, None)             # <<<<<<<<<<<<<< 
 *         import logging
 *         self.level_map = {
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseErrorLog), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":347
 *     cdef object _log
 *     def __init__(self, logger_name=None):
 *         _BaseErrorLog.__init__(self, None, None)             # <<<<<<<<<<<<<< 
 *         import logging
 *         self.level_map = {
 */
__pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_2, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_2, 2, Py_None);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 347; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":348
 *     def __init__(self, logger_name=None):
 *         _BaseErrorLog.__init__(self, None, None)
 *         import logging             # <<<<<<<<<<<<<< 
 *         self.level_map = {
 *             ErrorLevels.WARNING : logging.WARNING,
 */
__pyx_1 = __Pyx_Import(__pyx_n_logging, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 348; goto __pyx_L1;}
Py_DECREF(__pyx_v_logging);
__pyx_v_logging = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":349
 *         _BaseErrorLog.__init__(self, None, None)
 *         import logging
 *         self.level_map = {             # <<<<<<<<<<<<<< 
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":350
 *         import logging
 *         self.level_map = {
 *             ErrorLevels.WARNING : logging.WARNING,             # <<<<<<<<<<<<<< 
 *             ErrorLevels.ERROR   : logging.ERROR,
 *             ErrorLevels.FATAL   : logging.CRITICAL
 */
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 350; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_WARNING); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 350; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":350
 *         import logging
 *         self.level_map = {
 *             ErrorLevels.WARNING : logging.WARNING,             # <<<<<<<<<<<<<< 
 *             ErrorLevels.ERROR   : logging.ERROR,
 *             ErrorLevels.FATAL   : logging.CRITICAL
 */
__pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_WARNING); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 350; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":351
 *         self.level_map = {
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,             # <<<<<<<<<<<<<< 
 *             ErrorLevels.FATAL   : logging.CRITICAL
 *             }
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 351; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_ERROR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 351; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":351
 *         self.level_map = {
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,             # <<<<<<<<<<<<<< 
 *             ErrorLevels.FATAL   : logging.CRITICAL
 *             }
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_ERROR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 351; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_3, __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":352
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,
 *             ErrorLevels.FATAL   : logging.CRITICAL             # <<<<<<<<<<<<<< 
 *             }
 *         self._map_level = self.level_map.get
 */
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 352; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_FATAL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 352; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":352
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,
 *             ErrorLevels.FATAL   : logging.CRITICAL             # <<<<<<<<<<<<<< 
 *             }
 *         self._map_level = self.level_map.get
 */
__pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_CRITICAL); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 352; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 349; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":349
 *         _BaseErrorLog.__init__(self, None, None)
 *         import logging
 *         self.level_map = {             # <<<<<<<<<<<<<< 
 *             ErrorLevels.WARNING : logging.WARNING,
 *             ErrorLevels.ERROR   : logging.ERROR,
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map);
((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":354
 *             ErrorLevels.FATAL   : logging.CRITICAL
 *             }
 *         self._map_level = self.level_map.get             # <<<<<<<<<<<<<< 
 *         if logger_name:
 *             logger = logging.getLogger(logger_name)
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->level_map, __pyx_n_get); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 354; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":354
 *             ErrorLevels.FATAL   : logging.CRITICAL
 *             }
 *         self._map_level = self.level_map.get             # <<<<<<<<<<<<<< 
 *         if logger_name:
 *             logger = logging.getLogger(logger_name)
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level);
((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":355
 *             }
 *         self._map_level = self.level_map.get
 *         if logger_name:             # <<<<<<<<<<<<<< 
 *             logger = logging.getLogger(logger_name)
 *         else:
 */
__pyx_4 = __Pyx_PyObject_IsTrue(__pyx_v_logger_name); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 355; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":356
 *         self._map_level = self.level_map.get
 *         if logger_name:
 *             logger = logging.getLogger(logger_name)             # <<<<<<<<<<<<<< 
 *         else:
 *             logger = logging.getLogger()
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_getLogger); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":356
 *         self._map_level = self.level_map.get
 *         if logger_name:
 *             logger = logging.getLogger(logger_name)             # <<<<<<<<<<<<<< 
 *         else:
 *             logger = logging.getLogger()
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_INCREF(__pyx_v_logger_name);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_logger_name);
  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_logger);
  __pyx_v_logger = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":358
 *             logger = logging.getLogger(logger_name)
 *         else:
 *             logger = logging.getLogger()             # <<<<<<<<<<<<<< 
 *         self._log = logger.log
 * 
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_getLogger); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 358; goto __pyx_L1;}
  __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 358; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_logger);
  __pyx_v_logger = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":359
 *         else:
 *             logger = logging.getLogger()
 *         self._log = logger.log             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_logger, __pyx_n_log); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 359; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":359
 *         else:
 *             logger = logging.getLogger()
 *         self._log = logger.log             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log);
((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log = __pyx_1;
__pyx_1 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.PyErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_logging);
Py_DECREF(__pyx_v_logger);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_logger_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":361
 *         self._log = logger.log
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         """Dummy method that returns an empty error log.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_10PyErrorLog_copy[] = "Dummy method that returns an empty error log.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":364
 *         """Dummy method that returns an empty error log.
 *         """
 *         return _ListErrorLog([], None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def log(self, entry, message_format_string, *args):
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 364; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":364
 *         """Dummy method that returns an empty error log.
 *         """
 *         return _ListErrorLog([], None, None)             # <<<<<<<<<<<<<< 
 * 
 *     def log(self, entry, message_format_string, *args):
 */
__pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 364; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_2, 1, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_2, 2, Py_None);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ListErrorLog), __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 364; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.PyErrorLog.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":366
 *         return _ListErrorLog([], None, None)
 * 
 *     def log(self, entry, message_format_string, *args):             # <<<<<<<<<<<<<< 
 *         self._log(
 *             self._map_level(entry.level, 0),
 */

static PyObject *__pyx_n_level;

static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_v_message_format_string = 0;
PyObject *__pyx_v_args = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"entry","message_format_string",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, &__pyx_v_args, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_entry, &__pyx_v_message_format_string))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_args);
  return NULL;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);
Py_INCREF(__pyx_v_message_format_string);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":368
 *     def log(self, entry, message_format_string, *args):
 *         self._log(
 *             self._map_level(entry.level, 0),             # <<<<<<<<<<<<<< 
 *             message_format_string, *args
 *             )
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_entry, __pyx_n_level); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 368; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":368
 *     def log(self, entry, message_format_string, *args):
 *         self._log(
 *             self._map_level(entry.level, 0),             # <<<<<<<<<<<<<< 
 *             message_format_string, *args
 *             )
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 368; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(__pyx_num_0);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_num_0);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_map_level, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 368; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":369
 *         self._log(
 *             self._map_level(entry.level, 0),
 *             message_format_string, *args             # <<<<<<<<<<<<<< 
 *             )
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(__pyx_v_message_format_string);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_message_format_string);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":370
 *             self._map_level(entry.level, 0),
 *             message_format_string, *args
 *             )             # <<<<<<<<<<<<<< 
 * 
 *     def receive(self, entry):
 */
__pyx_1 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_2 = PyObject_CallObject(((struct __pyx_obj_4lxml_5etree_PyErrorLog *)__pyx_v_self)->_log, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 367; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.PyErrorLog.log");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_message_format_string);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":372
 *             )
 * 
 *     def receive(self, entry):             # <<<<<<<<<<<<<< 
 *         self.log(entry, entry)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_v_entry) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":373
 * 
 *     def receive(self, entry):
 *         self.log(entry, entry)             # <<<<<<<<<<<<<< 
 * 
 * # global list log to collect error output messages from libxml2/libxslt
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_log); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 373; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":373
 * 
 *     def receive(self, entry):
 *         self.log(entry, entry)             # <<<<<<<<<<<<<< 
 * 
 * # global list log to collect error output messages from libxml2/libxslt
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 373; goto __pyx_L1;}
Py_INCREF(__pyx_v_entry);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_entry);
Py_INCREF(__pyx_v_entry);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_entry);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 373; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.PyErrorLog.receive");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":379
 * __GLOBAL_ERROR_LOG = _RotatingErrorLog(__MAX_LOG_SIZE)
 * 
 * cdef __copyGlobalErrorLog():             # <<<<<<<<<<<<<< 
 *     "Helper function for properties in exceptions."
 *     return __GLOBAL_ERROR_LOG.copy()
 */

static  PyObject *__pyx_f_4lxml_5etree___copyGlobalErrorLog(void) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":381
 * cdef __copyGlobalErrorLog():
 *     "Helper function for properties in exceptions."
 *     return __GLOBAL_ERROR_LOG.copy()             # <<<<<<<<<<<<<< 
 * 
 * def useGlobalPythonLog(PyErrorLog log not None):
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 381; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 381; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.__copyGlobalErrorLog");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":383
 *     return __GLOBAL_ERROR_LOG.copy()
 * 
 * def useGlobalPythonLog(PyErrorLog log not None):             # <<<<<<<<<<<<<< 
 *     """Replace the global error log by an etree.PyErrorLog that uses the
 *     standard Python logging package.
 */

static PyObject *__pyx_pf_4lxml_5etree_useGlobalPythonLog(PyObject *__pyx_self, PyObject *__pyx_v_log); /*proto*/
static char __pyx_doc_4lxml_5etree_useGlobalPythonLog[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_useGlobalPythonLog(PyObject *__pyx_self, PyObject *__pyx_v_log) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_log);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_log), __pyx_ptype_4lxml_5etree_PyErrorLog, 0, "log"))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 383; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":391
 *     """
 *     global __GLOBAL_ERROR_LOG
 *     __GLOBAL_ERROR_LOG = log             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(__pyx_v_log);
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_v_log);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.useGlobalPythonLog");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_log);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":395
 * 
 * # local log functions: forward error to logger object
 * cdef void _forwardError(void* c_log_handler, xmlerror.xmlError* error) with gil:             # <<<<<<<<<<<<<< 
 *     cdef _BaseErrorLog log_handler
 *     if c_log_handler is not NULL:
 */

static  void __pyx_f_4lxml_5etree__forwardError(void *__pyx_v_c_log_handler,xmlError *__pyx_v_error) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_log_handler;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_log_handler = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":397
 * cdef void _forwardError(void* c_log_handler, xmlerror.xmlError* error) with gil:
 *     cdef _BaseErrorLog log_handler
 *     if c_log_handler is not NULL:             # <<<<<<<<<<<<<< 
 *         log_handler = <_BaseErrorLog>c_log_handler
 *     else:
 */
__pyx_1 = (__pyx_v_c_log_handler != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":398
 *     cdef _BaseErrorLog log_handler
 *     if c_log_handler is not NULL:
 *         log_handler = <_BaseErrorLog>c_log_handler             # <<<<<<<<<<<<<< 
 *     else:
 *         log_handler = __GLOBAL_ERROR_LOG
 */
  __pyx_2 = (PyObject *)__pyx_v_c_log_handler;
  Py_INCREF(__pyx_2);
  Py_DECREF(((PyObject *)__pyx_v_log_handler));
  __pyx_v_log_handler = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":400
 *         log_handler = <_BaseErrorLog>c_log_handler
 *     else:
 *         log_handler = __GLOBAL_ERROR_LOG             # <<<<<<<<<<<<<< 
 *     log_handler._receive(error)
 * 
 */
  Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
  Py_DECREF(((PyObject *)__pyx_v_log_handler));
  __pyx_v_log_handler = __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":401
 *     else:
 *         log_handler = __GLOBAL_ERROR_LOG
 *     log_handler._receive(error)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _receiveError(void* c_log_handler, xmlerror.xmlError* error) nogil:
 */
((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_log_handler->__pyx_vtab)->_receive(__pyx_v_log_handler,__pyx_v_error);

Py_DECREF(__pyx_v_log_handler);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":403
 *     log_handler._receive(error)
 * 
 * cdef void _receiveError(void* c_log_handler, xmlerror.xmlError* error) nogil:             # <<<<<<<<<<<<<< 
 *     # no Python objects here, may be called without thread context !
 *     # when we declare a Python object, Pyrex will INCREF(None) !
 */

static  void __pyx_f_4lxml_5etree__receiveError(void *__pyx_v_c_log_handler,xmlError *__pyx_v_error) {
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":406
 *     # no Python objects here, may be called without thread context !
 *     # when we declare a Python object, Pyrex will INCREF(None) !
 *     if __DEBUG != 0:             # <<<<<<<<<<<<<< 
 *         _forwardError(c_log_handler, error)
 * 
 */
__pyx_1 = (__pyx_v_4lxml_5etree___DEBUG != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":407
 *     # when we declare a Python object, Pyrex will INCREF(None) !
 *     if __DEBUG != 0:
 *         _forwardError(c_log_handler, error)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _receiveXSLTError(void* c_log_handler, char* msg, ...) nogil:
 */
  __pyx_f_4lxml_5etree__forwardError(__pyx_v_c_log_handler,__pyx_v_error);
  goto __pyx_L2;
}
__pyx_L2:;

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":409
 *         _forwardError(c_log_handler, error)
 * 
 * cdef void _receiveXSLTError(void* c_log_handler, char* msg, ...) nogil:             # <<<<<<<<<<<<<< 
 *     # no Python objects here, may be called without thread context !
 *     # when we declare a Python object, Pyrex will INCREF(None) !
 */

static char __pyx_k462[] = "file %s";
static char __pyx_k463[] = "string://__STRING__XSLT";
static char __pyx_k464[] = "<xslt>";
static char __pyx_k465[] = "line %d";
static char __pyx_k466[] = "element %s";
static char __pyx_k467[] = "";
static char __pyx_k468[] = "%s, element '%s'";

static  void __pyx_f_4lxml_5etree__receiveXSLTError(void *__pyx_v_c_log_handler,char *__pyx_v_msg,...) {
xmlError __pyx_v_c_error;
va_list __pyx_v_args;
char *__pyx_v_c_text;
char *__pyx_v_c_message;
char *__pyx_v_c_element;
int __pyx_v_text_size;
int __pyx_v_element_size;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":418
 *     cdef char* c_element
 *     cdef int i, text_size, element_size
 *     if __DEBUG == 0 or msg is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if msg[0] == c'\n' or msg[0] == c'\0':
 */
__pyx_1 = (__pyx_v_4lxml_5etree___DEBUG == 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":418
 *     cdef char* c_element
 *     cdef int i, text_size, element_size
 *     if __DEBUG == 0 or msg is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if msg[0] == c'\n' or msg[0] == c'\0':
 */
  __pyx_1 = (__pyx_v_msg == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":419
 *     cdef int i, text_size, element_size
 *     if __DEBUG == 0 or msg is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     if msg[0] == c'\n' or msg[0] == c'\0':
 *         return
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":420
 *     if __DEBUG == 0 or msg is NULL:
 *         return
 *     if msg[0] == c'\n' or msg[0] == c'\0':             # <<<<<<<<<<<<<< 
 *         return
 * 
 */
__pyx_1 = ((__pyx_v_msg[0]) == '\n');
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":420
 *     if __DEBUG == 0 or msg is NULL:
 *         return
 *     if msg[0] == c'\n' or msg[0] == c'\0':             # <<<<<<<<<<<<<< 
 *         return
 * 
 */
  __pyx_1 = ((__pyx_v_msg[0]) == '\0');
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":421
 *         return
 *     if msg[0] == c'\n' or msg[0] == c'\0':
 *         return             # <<<<<<<<<<<<<< 
 * 
 *     cstd.va_start(args, msg)
 */
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":423
 *         return
 * 
 *     cstd.va_start(args, msg)             # <<<<<<<<<<<<<< 
 *     if msg[0] == c'%' and msg[1] == c's':
 *         c_text = cstd.va_charptr(args)
 */
va_start(__pyx_v_args,__pyx_v_msg);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":424
 * 
 *     cstd.va_start(args, msg)
 *     if msg[0] == c'%' and msg[1] == c's':             # <<<<<<<<<<<<<< 
 *         c_text = cstd.va_charptr(args)
 *     else:
 */
__pyx_1 = ((__pyx_v_msg[0]) == '%');
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":424
 * 
 *     cstd.va_start(args, msg)
 *     if msg[0] == c'%' and msg[1] == c's':             # <<<<<<<<<<<<<< 
 *         c_text = cstd.va_charptr(args)
 *     else:
 */
  __pyx_1 = ((__pyx_v_msg[1]) == 's');
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":425
 *     cstd.va_start(args, msg)
 *     if msg[0] == c'%' and msg[1] == c's':
 *         c_text = cstd.va_charptr(args)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_text = NULL
 */
  __pyx_v_c_text = va_charptr(__pyx_v_args);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":427
 *         c_text = cstd.va_charptr(args)
 *     else:
 *         c_text = NULL             # <<<<<<<<<<<<<< 
 *     if cstd.strstr(msg, 'file %s'):
 *         c_error.file = cstd.va_charptr(args)
 */
  __pyx_v_c_text = NULL;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":428
 *     else:
 *         c_text = NULL
 *     if cstd.strstr(msg, 'file %s'):             # <<<<<<<<<<<<<< 
 *         c_error.file = cstd.va_charptr(args)
 *         if c_error.file and \
 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k462) != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":429
 *         c_text = NULL
 *     if cstd.strstr(msg, 'file %s'):
 *         c_error.file = cstd.va_charptr(args)             # <<<<<<<<<<<<<< 
 *         if c_error.file and \
 *                 cstd.strncmp(c_error.file,
 */
  __pyx_v_c_error.file = va_charptr(__pyx_v_args);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":430
 *     if cstd.strstr(msg, 'file %s'):
 *         c_error.file = cstd.va_charptr(args)
 *         if c_error.file and \             # <<<<<<<<<<<<<< 
 *                 cstd.strncmp(c_error.file,
 *                             'string://__STRING__XSLT', 23) == 0:
 */
  __pyx_1 = (__pyx_v_c_error.file != 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":432
 *         if c_error.file and \
 *                 cstd.strncmp(c_error.file,
 *                             'string://__STRING__XSLT', 23) == 0:             # <<<<<<<<<<<<<< 
 *             c_error.file = '<xslt>'
 *     else:
 */
    __pyx_1 = (strncmp(__pyx_v_c_error.file,__pyx_k463,23) == 0);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":433
 *                 cstd.strncmp(c_error.file,
 *                             'string://__STRING__XSLT', 23) == 0:
 *             c_error.file = '<xslt>'             # <<<<<<<<<<<<<< 
 *     else:
 *         c_error.file = NULL
 */
    __pyx_v_c_error.file = __pyx_k464;
    goto __pyx_L6;
  }
  __pyx_L6:;
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":435
 *             c_error.file = '<xslt>'
 *     else:
 *         c_error.file = NULL             # <<<<<<<<<<<<<< 
 *     if cstd.strstr(msg, 'line %d'):
 *         c_error.line = cstd.va_int(args)
 */
  __pyx_v_c_error.file = NULL;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":436
 *     else:
 *         c_error.file = NULL
 *     if cstd.strstr(msg, 'line %d'):             # <<<<<<<<<<<<<< 
 *         c_error.line = cstd.va_int(args)
 *     else:
 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k465) != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":437
 *         c_error.file = NULL
 *     if cstd.strstr(msg, 'line %d'):
 *         c_error.line = cstd.va_int(args)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_error.line = -1
 */
  __pyx_v_c_error.line = va_int(__pyx_v_args);
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":439
 *         c_error.line = cstd.va_int(args)
 *     else:
 *         c_error.line = -1             # <<<<<<<<<<<<<< 
 *     if cstd.strstr(msg, 'element %s'):
 *         c_element = cstd.va_charptr(args)
 */
  __pyx_v_c_error.line = -1;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":440
 *     else:
 *         c_error.line = -1
 *     if cstd.strstr(msg, 'element %s'):             # <<<<<<<<<<<<<< 
 *         c_element = cstd.va_charptr(args)
 *     else:
 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k466) != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":441
 *         c_error.line = -1
 *     if cstd.strstr(msg, 'element %s'):
 *         c_element = cstd.va_charptr(args)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_element = NULL
 */
  __pyx_v_c_element = va_charptr(__pyx_v_args);
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":443
 *         c_element = cstd.va_charptr(args)
 *     else:
 *         c_element = NULL             # <<<<<<<<<<<<<< 
 *     cstd.va_end(args)
 * 
 */
  __pyx_v_c_element = NULL;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":444
 *     else:
 *         c_element = NULL
 *     cstd.va_end(args)             # <<<<<<<<<<<<<< 
 * 
 *     c_message = NULL
 */
va_end(__pyx_v_args);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":446
 *     cstd.va_end(args)
 * 
 *     c_message = NULL             # <<<<<<<<<<<<<< 
 *     if c_text is NULL:
 *         if c_element is not NULL and \
 */
__pyx_v_c_message = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":447
 * 
 *     c_message = NULL
 *     if c_text is NULL:             # <<<<<<<<<<<<<< 
 *         if c_element is not NULL and \
 *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
 */
__pyx_1 = (__pyx_v_c_text == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":448
 *     c_message = NULL
 *     if c_text is NULL:
 *         if c_element is not NULL and \             # <<<<<<<<<<<<<< 
 *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
 *             # special case: a single occurrence of 'element %s'
 */
  __pyx_1 = (__pyx_v_c_element != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":449
 *     if c_text is NULL:
 *         if c_element is not NULL and \
 *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):             # <<<<<<<<<<<<<< 
 *             # special case: a single occurrence of 'element %s'
 *             text_size    = cstd.strlen(msg)
 */
    __pyx_1 = (strchr(__pyx_v_msg,'%') == strrchr(__pyx_v_msg,'%'));
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":451
 *                 cstd.strchr(msg, c'%') == cstd.strrchr(msg, c'%'):
 *             # special case: a single occurrence of 'element %s'
 *             text_size    = cstd.strlen(msg)             # <<<<<<<<<<<<<< 
 *             element_size = cstd.strlen(c_element)
 *             c_message = <char*>cstd.malloc(
 */
    __pyx_v_text_size = strlen(__pyx_v_msg);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":452
 *             # special case: a single occurrence of 'element %s'
 *             text_size    = cstd.strlen(msg)
 *             element_size = cstd.strlen(c_element)             # <<<<<<<<<<<<<< 
 *             c_message = <char*>cstd.malloc(
 *                 (text_size + element_size + 1) * sizeof(char))
 */
    __pyx_v_element_size = strlen(__pyx_v_c_element);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":454
 *             element_size = cstd.strlen(c_element)
 *             c_message = <char*>cstd.malloc(
 *                 (text_size + element_size + 1) * sizeof(char))             # <<<<<<<<<<<<<< 
 *             cstd.sprintf(c_message, msg, c_element)
 *             c_error.message = c_message
 */
    __pyx_v_c_message = ((char *)malloc((((__pyx_v_text_size + __pyx_v_element_size) + 1) * (sizeof(char)))));

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":455
 *             c_message = <char*>cstd.malloc(
 *                 (text_size + element_size + 1) * sizeof(char))
 *             cstd.sprintf(c_message, msg, c_element)             # <<<<<<<<<<<<<< 
 *             c_error.message = c_message
 *         else:
 */
    sprintf(__pyx_v_c_message,__pyx_v_msg,__pyx_v_c_element);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":456
 *                 (text_size + element_size + 1) * sizeof(char))
 *             cstd.sprintf(c_message, msg, c_element)
 *             c_error.message = c_message             # <<<<<<<<<<<<<< 
 *         else:
 *             c_error.message = ''
 */
    __pyx_v_c_error.message = __pyx_v_c_message;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":458
 *             c_error.message = c_message
 *         else:
 *             c_error.message = ''             # <<<<<<<<<<<<<< 
 *     elif c_element is NULL:
 *         c_error.message = c_text
 */
    __pyx_v_c_error.message = __pyx_k467;
  }
  __pyx_L10:;
  goto __pyx_L9;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":459
 *         else:
 *             c_error.message = ''
 *     elif c_element is NULL:             # <<<<<<<<<<<<<< 
 *         c_error.message = c_text
 *     else:
 */
__pyx_1 = (__pyx_v_c_element == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":460
 *             c_error.message = ''
 *     elif c_element is NULL:
 *         c_error.message = c_text             # <<<<<<<<<<<<<< 
 *     else:
 *         text_size    = cstd.strlen(c_text)
 */
  __pyx_v_c_error.message = __pyx_v_c_text;
  goto __pyx_L9;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":462
 *         c_error.message = c_text
 *     else:
 *         text_size    = cstd.strlen(c_text)             # <<<<<<<<<<<<<< 
 *         element_size = cstd.strlen(c_element)
 *         c_message = <char*>cstd.malloc(
 */
  __pyx_v_text_size = strlen(__pyx_v_c_text);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":463
 *     else:
 *         text_size    = cstd.strlen(c_text)
 *         element_size = cstd.strlen(c_element)             # <<<<<<<<<<<<<< 
 *         c_message = <char*>cstd.malloc(
 *             (text_size + 12 + element_size + 1) * sizeof(char))
 */
  __pyx_v_element_size = strlen(__pyx_v_c_element);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":465
 *         element_size = cstd.strlen(c_element)
 *         c_message = <char*>cstd.malloc(
 *             (text_size + 12 + element_size + 1) * sizeof(char))             # <<<<<<<<<<<<<< 
 *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)
 *         c_error.message = c_message
 */
  __pyx_v_c_message = ((char *)malloc(((((__pyx_v_text_size + 12) + __pyx_v_element_size) + 1) * (sizeof(char)))));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":466
 *         c_message = <char*>cstd.malloc(
 *             (text_size + 12 + element_size + 1) * sizeof(char))
 *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)             # <<<<<<<<<<<<<< 
 *         c_error.message = c_message
 * 
 */
  sprintf(__pyx_v_c_message,__pyx_k468,__pyx_v_c_text,__pyx_v_c_element);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":467
 *             (text_size + 12 + element_size + 1) * sizeof(char))
 *         cstd.sprintf(c_message, "%s, element '%s'", c_text, c_element)
 *         c_error.message = c_message             # <<<<<<<<<<<<<< 
 * 
 *     c_error.domain = xmlerror.XML_FROM_XSLT
 */
  __pyx_v_c_error.message = __pyx_v_c_message;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":469
 *         c_error.message = c_message
 * 
 *     c_error.domain = xmlerror.XML_FROM_XSLT             # <<<<<<<<<<<<<< 
 *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
 *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
 */
__pyx_v_c_error.domain = XML_FROM_XSLT;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":470
 * 
 *     c_error.domain = xmlerror.XML_FROM_XSLT
 *     c_error.code   = xmlerror.XML_ERR_OK    # what else?             # <<<<<<<<<<<<<< 
 *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
 *     c_error.int2   = 0
 */
__pyx_v_c_error.code = XML_ERR_OK;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":471
 *     c_error.domain = xmlerror.XML_FROM_XSLT
 *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
 *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?             # <<<<<<<<<<<<<< 
 *     c_error.int2   = 0
 * 
 */
__pyx_v_c_error.level = XML_ERR_ERROR;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":472
 *     c_error.code   = xmlerror.XML_ERR_OK    # what else?
 *     c_error.level  = xmlerror.XML_ERR_ERROR # what else?
 *     c_error.int2   = 0             # <<<<<<<<<<<<<< 
 * 
 *     _forwardError(c_log_handler, &c_error)
 */
__pyx_v_c_error.int2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":474
 *     c_error.int2   = 0
 * 
 *     _forwardError(c_log_handler, &c_error)             # <<<<<<<<<<<<<< 
 * 
 *     if c_message is not NULL:
 */
__pyx_f_4lxml_5etree__forwardError(__pyx_v_c_log_handler,(&__pyx_v_c_error));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":476
 *     _forwardError(c_log_handler, &c_error)
 * 
 *     if c_message is not NULL:             # <<<<<<<<<<<<<< 
 *         cstd.free(c_message)
 * 
 */
__pyx_1 = (__pyx_v_c_message != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":477
 * 
 *     if c_message is not NULL:
 *         cstd.free(c_message)             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
  free(__pyx_v_c_message);
  goto __pyx_L11;
}
__pyx_L11:;

__pyx_L0:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":483
 * ################################################################################
 * 
 * cdef void __initErrorConstants():             # <<<<<<<<<<<<<< 
 *     "Called at setup time to parse the constants and build the classes below."
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
 */

static PyObject *__pyx_n__names;

static PyObject *__pyx_k469p;

static char __pyx_k469[] = "\\s*([a-zA-Z0-9_]+)\\s*=\\s*([0-9]+)";

static  void __pyx_f_4lxml_5etree___initErrorConstants(void) {
PyObject *__pyx_v_find_constants;
PyObject *__pyx_v_const_defs;
PyObject *__pyx_v_cls;
PyObject *__pyx_v_constant_tuple;
PyObject *__pyx_v_reverse_dict;
PyObject *__pyx_v_constants;
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_ssize_t __pyx_5;
Py_ssize_t __pyx_6;
Py_ssize_t __pyx_7;
PyObject *__pyx_8 = 0;
PyObject *__pyx_9 = 0;
int __pyx_10;
__pyx_v_find_constants = Py_None; Py_INCREF(Py_None);
__pyx_v_const_defs = Py_None; Py_INCREF(Py_None);
__pyx_v_cls = Py_None; Py_INCREF(Py_None);
__pyx_v_constant_tuple = Py_None; Py_INCREF(Py_None);
__pyx_v_reverse_dict = Py_None; Py_INCREF(Py_None);
__pyx_v_constants = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":485
 * cdef void __initErrorConstants():
 *     "Called at setup time to parse the constants and build the classes below."
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall             # <<<<<<<<<<<<<< 
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 485; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":485
 * cdef void __initErrorConstants():
 *     "Called at setup time to parse the constants and build the classes below."
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall             # <<<<<<<<<<<<<< 
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 485; goto __pyx_L1;}
Py_INCREF(__pyx_k469p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k469p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 485; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_findall); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 485; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_find_constants);
__pyx_v_find_constants = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":486
 *     "Called at setup time to parse the constants and build the classes below."
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),             # <<<<<<<<<<<<<< 
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 486; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":486
 *     "Called at setup time to parse the constants and build the classes below."
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),             # <<<<<<<<<<<<<< 
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 486; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
Py_INCREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_4lxml_5etree___ERROR_LEVELS);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":487
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),             # <<<<<<<<<<<<<< 
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorDomains); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":487
 *     find_constants = re.compile(r"\s*([a-zA-Z0-9_]+)\s*=\s*([0-9]+)").findall
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),             # <<<<<<<<<<<<<< 
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 487; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_4lxml_5etree___ERROR_DOMAINS);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":488
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))             # <<<<<<<<<<<<<< 
 *     for cls, constant_tuple in const_defs:
 *         reverse_dict = {}
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":488
 *     const_defs = ((ErrorLevels,  __ERROR_LEVELS),
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))             # <<<<<<<<<<<<<< 
 *     for cls, constant_tuple in const_defs:
 *         reverse_dict = {}
 */
__pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 488; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
Py_INCREF(__pyx_v_4lxml_5etree___ERROR_TYPES);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_4lxml_5etree___ERROR_TYPES);
__pyx_1 = 0;
__pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 486; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_3);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_4);
__pyx_3 = 0;
__pyx_2 = 0;
__pyx_4 = 0;
Py_DECREF(__pyx_v_const_defs);
__pyx_v_const_defs = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
if (PyList_CheckExact(__pyx_v_const_defs)) { __pyx_5 = 0; __pyx_3 = __pyx_v_const_defs; Py_INCREF(__pyx_3); }
else { __pyx_3 = PyObject_GetIter(__pyx_v_const_defs); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
  if (PyList_CheckExact(__pyx_3)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_2 = PyList_GET_ITEM(__pyx_3, __pyx_5++); Py_INCREF(__pyx_2); }
  else {
    __pyx_2 = PyIter_Next(__pyx_3);
    if (!__pyx_2) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
    __pyx_1 = PyTuple_GET_ITEM(__pyx_2, 0);
    Py_INCREF(__pyx_1);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = __pyx_1;
    __pyx_1 = 0;
    __pyx_1 = PyTuple_GET_ITEM(__pyx_2, 1);
    Py_INCREF(__pyx_1);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
    Py_DECREF(__pyx_v_constant_tuple);
    __pyx_v_constant_tuple = __pyx_1;
    __pyx_1 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_1 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = __pyx_1;
    __pyx_1 = 0;
    __pyx_1 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":489
 *                   (ErrorDomains, __ERROR_DOMAINS),
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:             # <<<<<<<<<<<<<< 
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 */
    Py_DECREF(__pyx_v_constant_tuple);
    __pyx_v_constant_tuple = __pyx_1;
    __pyx_1 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 489; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":490
 *                   (ErrorTypes,   __ERROR_TYPES))
 *     for cls, constant_tuple in const_defs:
 *         reverse_dict = {}             # <<<<<<<<<<<<<< 
 *         cls._names   = reverse_dict
 *         cls._getName = reverse_dict.get
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 490; goto __pyx_L1;}
  Py_DECREF(__pyx_v_reverse_dict);
  __pyx_v_reverse_dict = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":491
 *     for cls, constant_tuple in const_defs:
 *         reverse_dict = {}
 *         cls._names   = reverse_dict             # <<<<<<<<<<<<<< 
 *         cls._getName = reverse_dict.get
 *         for constants in constant_tuple:
 */
  if (PyObject_SetAttr(__pyx_v_cls, __pyx_n__names, __pyx_v_reverse_dict) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 491; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":492
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 *         cls._getName = reverse_dict.get             # <<<<<<<<<<<<<< 
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_reverse_dict, __pyx_n_get); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":492
 *         reverse_dict = {}
 *         cls._names   = reverse_dict
 *         cls._getName = reverse_dict.get             # <<<<<<<<<<<<<< 
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 */
  if (PyObject_SetAttr(__pyx_v_cls, __pyx_n__getName, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 492; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":493
 *         cls._names   = reverse_dict
 *         cls._getName = reverse_dict.get
 *         for constants in constant_tuple:             # <<<<<<<<<<<<<< 
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):
 */
  if (PyList_CheckExact(__pyx_v_constant_tuple)) { __pyx_6 = 0; __pyx_4 = __pyx_v_constant_tuple; Py_INCREF(__pyx_4); }
  else { __pyx_4 = PyObject_GetIter(__pyx_v_constant_tuple); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 493; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":493
 *         cls._names   = reverse_dict
 *         cls._getName = reverse_dict.get
 *         for constants in constant_tuple:             # <<<<<<<<<<<<<< 
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):
 */
    if (PyList_CheckExact(__pyx_4)) { if (__pyx_6 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_1 = PyList_GET_ITEM(__pyx_4, __pyx_6++); Py_INCREF(__pyx_1); }
    else {
      __pyx_1 = PyIter_Next(__pyx_4);
      if (!__pyx_1) {
        break;
      }
    }
    Py_DECREF(__pyx_v_constants);
    __pyx_v_constants = __pyx_1;
    __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
    __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}
    Py_INCREF(__pyx_v_constants);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_constants);
    __pyx_1 = PyObject_CallObject(__pyx_v_find_constants, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (PyList_CheckExact(__pyx_1)) { __pyx_7 = 0; __pyx_2 = __pyx_1; Py_INCREF(__pyx_2); }
    else { __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;} }
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
      if (PyList_CheckExact(__pyx_2)) { if (__pyx_7 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_1 = PyList_GET_ITEM(__pyx_2, __pyx_7++); Py_INCREF(__pyx_1); }
      else {
        __pyx_1 = PyIter_Next(__pyx_2);
        if (!__pyx_1) {
          break;
        }
      }
      if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
        __pyx_9 = PyTuple_GET_ITEM(__pyx_1, 0);
        Py_INCREF(__pyx_9);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
        Py_DECREF(__pyx_v_name);
        __pyx_v_name = __pyx_9;
        __pyx_9 = 0;
        __pyx_9 = PyTuple_GET_ITEM(__pyx_1, 1);
        Py_INCREF(__pyx_9);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_9;
        __pyx_9 = 0;
        Py_DECREF(__pyx_1); __pyx_1 = 0;
      }
      else {
        __pyx_8 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}
        Py_DECREF(__pyx_1); __pyx_1 = 0;
        __pyx_9 = __Pyx_UnpackItem(__pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
        Py_DECREF(__pyx_v_name);
        __pyx_v_name = __pyx_9;
        __pyx_9 = 0;
        __pyx_9 = __Pyx_UnpackItem(__pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":495
 *         for constants in constant_tuple:
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):             # <<<<<<<<<<<<<< 
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 */
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_9;
        __pyx_9 = 0;
        if (__Pyx_EndUnpack(__pyx_8) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 495; goto __pyx_L1;}
        Py_DECREF(__pyx_8); __pyx_8 = 0;
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":496
 *             #print len(constants) + 1
 *             for name, value in find_constants(constants):
 *                 value = python.PyNumber_Int(value)             # <<<<<<<<<<<<<< 
 *                 python.PyObject_SetAttr(cls, name, value)
 *                 python.PyDict_SetItem(reverse_dict, value, name)
 */
      __pyx_9 = PyNumber_Int(__pyx_v_value); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 496; goto __pyx_L1;}
      Py_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_9;
      __pyx_9 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":497
 *             for name, value in find_constants(constants):
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(reverse_dict, value, name)
 * 
 */
      PyObject_SetAttr(__pyx_v_cls,__pyx_v_name,__pyx_v_value);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":498
 *                 value = python.PyNumber_Int(value)
 *                 python.PyObject_SetAttr(cls, name, value)
 *                 python.PyDict_SetItem(reverse_dict, value, name)             # <<<<<<<<<<<<<< 
 * 
 * class ErrorLevels:
 */
      __pyx_10 = PyDict_SetItem(__pyx_v_reverse_dict,__pyx_v_value,__pyx_v_name); if (unlikely(__pyx_10 == -1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 498; goto __pyx_L1;}
    }
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  Py_DECREF(__pyx_4); __pyx_4 = 0;
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_8);
Py_XDECREF(__pyx_9);
__Pyx_WriteUnraisable("lxml.etree.__initErrorConstants");
__pyx_L0:;
Py_DECREF(__pyx_v_find_constants);
Py_DECREF(__pyx_v_const_defs);
Py_DECREF(__pyx_v_cls);
Py_DECREF(__pyx_v_constant_tuple);
Py_DECREF(__pyx_v_reverse_dict);
Py_DECREF(__pyx_v_constants);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":59
 *     """
 *     cdef _element_class_lookup_function _lookup_function
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = NULL # use default lookup
 * 
 */

static int __pyx_pf_4lxml_5etree_18ElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_18ElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":60
 *     cdef _element_class_lookup_function _lookup_function
 *     def __init__(self):
 *         self._lookup_function = NULL # use default lookup             # <<<<<<<<<<<<<< 
 * 
 * cdef public class FallbackElementClassLookup(ElementClassLookup) \
 */
((struct LxmlElementClassLookup *)__pyx_v_self)->_lookup_function = NULL;

__pyx_r = 0;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":69
 *     cdef readonly ElementClassLookup fallback
 *     cdef _element_class_lookup_function _fallback_function
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = NULL # use default lookup
 *         if fallback is not None:
 */

static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_fallback = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"fallback",0};
__pyx_v_fallback = __pyx_k146;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_fallback))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_fallback);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 69; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":70
 *     cdef _element_class_lookup_function _fallback_function
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._lookup_function = NULL # use default lookup             # <<<<<<<<<<<<<< 
 *         if fallback is not None:
 *             self.setFallback(fallback)
 */
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->__pyx_base._lookup_function = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":71
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._lookup_function = NULL # use default lookup
 *         if fallback is not None:             # <<<<<<<<<<<<<< 
 *             self.setFallback(fallback)
 *         else:
 */
__pyx_1 = (((PyObject *)__pyx_v_fallback) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":72
 *         self._lookup_function = NULL # use default lookup
 *         if fallback is not None:
 *             self.setFallback(fallback)             # <<<<<<<<<<<<<< 
 *         else:
 *             self._fallback_function = _lookupDefaultElementClass
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_setFallback); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":72
 *         self._lookup_function = NULL # use default lookup
 *         if fallback is not None:
 *             self.setFallback(fallback)             # <<<<<<<<<<<<<< 
 *         else:
 *             self._fallback_function = _lookupDefaultElementClass
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_fallback));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_fallback));
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 72; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":74
 *             self.setFallback(fallback)
 *         else:
 *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<< 
 * 
 *     def setFallback(self, ElementClassLookup lookup not None):
 */
  ((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":76
 *             self._fallback_function = _lookupDefaultElementClass
 * 
 *     def setFallback(self, ElementClassLookup lookup not None):             # <<<<<<<<<<<<<< 
 *         """Sets the fallback scheme for this lookup method.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_setFallback(PyObject *__pyx_v_self, PyObject *__pyx_v_lookup); /*proto*/
static char __pyx_doc_4lxml_5etree_26FallbackElementClassLookup_setFallback[] = "Sets the fallback scheme for this lookup method.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_setFallback(PyObject *__pyx_v_self, PyObject *__pyx_v_lookup) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_lookup);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 0, "lookup"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":79
 *         """Sets the fallback scheme for this lookup method.
 *         """
 *         self.fallback = lookup             # <<<<<<<<<<<<<< 
 *         self._fallback_function = lookup._lookup_function
 * 
 */
Py_INCREF(__pyx_v_lookup);
Py_DECREF(((PyObject *)((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->fallback));
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->fallback = ((struct LxmlElementClassLookup *)__pyx_v_lookup);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":80
 *         """
 *         self.fallback = lookup
 *         self._fallback_function = lookup._lookup_function             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _callFallback(self, doc, xmlNode* c_node):
 */
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = ((struct LxmlElementClassLookup *)__pyx_v_lookup)->_lookup_function;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup.setFallback");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":82
 *         self._fallback_function = lookup._lookup_function
 * 
 *     cdef object _callFallback(self, doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *         if self._fallback_function is NULL:
 *             self._fallback_function = _lookupDefaultElementClass
 */

static  PyObject *__pyx_f_4lxml_5etree_26FallbackElementClassLookup__callFallback(struct LxmlFallbackElementClassLookup *__pyx_v_self,PyObject *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":83
 * 
 *     cdef object _callFallback(self, doc, xmlNode* c_node):
 *         if self._fallback_function is NULL:             # <<<<<<<<<<<<<< 
 *             self._fallback_function = _lookupDefaultElementClass
 *         return self._fallback_function(self.fallback, doc, c_node)
 */
__pyx_1 = (__pyx_v_self->_fallback_function == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":84
 *     cdef object _callFallback(self, doc, xmlNode* c_node):
 *         if self._fallback_function is NULL:
 *             self._fallback_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<< 
 *         return self._fallback_function(self.fallback, doc, c_node)
 * 
 */
  __pyx_v_self->_fallback_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":85
 *         if self._fallback_function is NULL:
 *             self._fallback_function = _lookupDefaultElementClass
 *         return self._fallback_function(self.fallback, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 85; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":85
 *         if self._fallback_function is NULL:
 *             self._fallback_function = _lookupDefaultElementClass
 *         return self._fallback_function(self.fallback, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = __pyx_v_self->_fallback_function(((PyObject *)__pyx_v_self->fallback),((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 85; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.FallbackElementClassLookup._callFallback");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":102
 *     cdef readonly object pi_class
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 */

static PyObject *__pyx_k470p;
static PyObject *__pyx_k471p;
static PyObject *__pyx_k472p;
static PyObject *__pyx_k473p;

static char __pyx_k470[] = "element class must be subclass of ElementBase";
static char __pyx_k471[] = "comment class must be subclass of CommentBase";
static char __pyx_k472[] = "PI class must be subclass of PIBase";
static char __pyx_k473[] = "Entity class must be subclass of EntityBase";

static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element = 0;
PyObject *__pyx_v_comment = 0;
PyObject *__pyx_v_pi = 0;
PyObject *__pyx_v_entity = 0;
int __pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"element","comment","pi","entity",0};
__pyx_v_element = __pyx_k147;
__pyx_v_comment = __pyx_k148;
__pyx_v_pi = __pyx_k149;
__pyx_v_entity = __pyx_k150;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOO", __pyx_argnames, &__pyx_v_element, &__pyx_v_comment, &__pyx_v_pi, &__pyx_v_entity))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_comment);
Py_INCREF(__pyx_v_pi);
Py_INCREF(__pyx_v_entity);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":103
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):
 *         self._lookup_function = _lookupDefaultElementClass             # <<<<<<<<<<<<<< 
 *         if element is None:
 *             self.element_class = None
 */
((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->__pyx_base._lookup_function = __pyx_f_4lxml_5etree__lookupDefaultElementClass;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":104
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:             # <<<<<<<<<<<<<< 
 *             self.element_class = None
 *         elif issubclass(element, ElementBase):
 */
__pyx_1 = (__pyx_v_element == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":105
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 *             self.element_class = None             # <<<<<<<<<<<<<< 
 *         elif issubclass(element, ElementBase):
 *             self.element_class = element
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = Py_None;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":106
 *         if element is None:
 *             self.element_class = None
 *         elif issubclass(element, ElementBase):             # <<<<<<<<<<<<<< 
 *             self.element_class = element
 *         else:
 */
__pyx_1 = PyObject_IsSubclass(__pyx_v_element,((PyObject*)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 106; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":107
 *             self.element_class = None
 *         elif issubclass(element, ElementBase):
 *             self.element_class = element             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "element class must be subclass of ElementBase"
 */
  Py_INCREF(__pyx_v_element);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = __pyx_v_element;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":109
 *             self.element_class = element
 *         else:
 *             raise TypeError, "element class must be subclass of ElementBase"             # <<<<<<<<<<<<<< 
 * 
 *         if comment is None:
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k470p, 0);
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 109; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":111
 *             raise TypeError, "element class must be subclass of ElementBase"
 * 
 *         if comment is None:             # <<<<<<<<<<<<<< 
 *             self.comment_class = None
 *         elif issubclass(comment, CommentBase):
 */
__pyx_1 = (__pyx_v_comment == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":112
 * 
 *         if comment is None:
 *             self.comment_class = None             # <<<<<<<<<<<<<< 
 *         elif issubclass(comment, CommentBase):
 *             self.comment_class = comment
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = Py_None;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":113
 *         if comment is None:
 *             self.comment_class = None
 *         elif issubclass(comment, CommentBase):             # <<<<<<<<<<<<<< 
 *             self.comment_class = comment
 *         else:
 */
__pyx_1 = PyObject_IsSubclass(__pyx_v_comment,((PyObject*)__pyx_ptype_4lxml_5etree_CommentBase)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":114
 *             self.comment_class = None
 *         elif issubclass(comment, CommentBase):
 *             self.comment_class = comment             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "comment class must be subclass of CommentBase"
 */
  Py_INCREF(__pyx_v_comment);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = __pyx_v_comment;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":116
 *             self.comment_class = comment
 *         else:
 *             raise TypeError, "comment class must be subclass of CommentBase"             # <<<<<<<<<<<<<< 
 * 
 *         if pi is None:
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k471p, 0);
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 116; goto __pyx_L1;}
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":118
 *             raise TypeError, "comment class must be subclass of CommentBase"
 * 
 *         if pi is None:             # <<<<<<<<<<<<<< 
 *             self.pi_class = None
 *         elif issubclass(pi, PIBase):
 */
__pyx_1 = (__pyx_v_pi == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":119
 * 
 *         if pi is None:
 *             self.pi_class = None             # <<<<<<<<<<<<<< 
 *         elif issubclass(pi, PIBase):
 *             self.pi_class = pi
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = Py_None;
  goto __pyx_L4;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":120
 *         if pi is None:
 *             self.pi_class = None
 *         elif issubclass(pi, PIBase):             # <<<<<<<<<<<<<< 
 *             self.pi_class = pi
 *         else:
 */
__pyx_1 = PyObject_IsSubclass(__pyx_v_pi,((PyObject*)__pyx_ptype_4lxml_5etree_PIBase)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":121
 *             self.pi_class = None
 *         elif issubclass(pi, PIBase):
 *             self.pi_class = pi             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "PI class must be subclass of PIBase"
 */
  Py_INCREF(__pyx_v_pi);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = __pyx_v_pi;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":123
 *             self.pi_class = pi
 *         else:
 *             raise TypeError, "PI class must be subclass of PIBase"             # <<<<<<<<<<<<<< 
 * 
 *         if entity is None:
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k472p, 0);
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 123; goto __pyx_L1;}
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":125
 *             raise TypeError, "PI class must be subclass of PIBase"
 * 
 *         if entity is None:             # <<<<<<<<<<<<<< 
 *             self.entity_class = None
 *         elif issubclass(entity, EntityBase):
 */
__pyx_1 = (__pyx_v_entity == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":126
 * 
 *         if entity is None:
 *             self.entity_class = None             # <<<<<<<<<<<<<< 
 *         elif issubclass(entity, EntityBase):
 *             self.entity_class = entity
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class = Py_None;
  goto __pyx_L5;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":127
 *         if entity is None:
 *             self.entity_class = None
 *         elif issubclass(entity, EntityBase):             # <<<<<<<<<<<<<< 
 *             self.entity_class = entity
 *         else:
 */
__pyx_1 = PyObject_IsSubclass(__pyx_v_entity,((PyObject*)__pyx_ptype_4lxml_5etree_EntityBase)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":128
 *             self.entity_class = None
 *         elif issubclass(entity, EntityBase):
 *             self.entity_class = entity             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "Entity class must be subclass of EntityBase"
 */
  Py_INCREF(__pyx_v_entity);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class);
  ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_self)->entity_class = __pyx_v_entity;
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":130
 *             self.entity_class = entity
 *         else:
 *             raise TypeError, "Entity class must be subclass of EntityBase"             # <<<<<<<<<<<<<< 
 * 
 * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k473p, 0);
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; goto __pyx_L1;}
}
__pyx_L5:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.ElementDefaultClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_comment);
Py_DECREF(__pyx_v_pi);
Py_DECREF(__pyx_v_entity);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":132
 *             raise TypeError, "Entity class must be subclass of EntityBase"
 * 
 * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     "Trivial class lookup function that always returns the default class."
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 */

static PyObject *__pyx_k477p;

static char __pyx_k474[] = "xml-stylesheet";
static char __pyx_k475[] = "text/xsl";
static char __pyx_k476[] = "text/xml";
static char __pyx_k477[] = "Unknown node type: %s";

static  PyObject *__pyx_f_4lxml_5etree__lookupDefaultElementClass(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v__doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_v_cls;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v__doc);
__pyx_v_cls = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":134
 * cdef object _lookupDefaultElementClass(state, _Document _doc, xmlNode* c_node):
 *     "Trivial class lookup function that always returns the default class."
 *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *         if state is not None:
 *             cls =  (<ElementDefaultClassLookup>state).element_class
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":135
 *     "Trivial class lookup function that always returns the default class."
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         if state is not None:             # <<<<<<<<<<<<<< 
 *             cls =  (<ElementDefaultClassLookup>state).element_class
 *         if cls is None:
 */
  __pyx_1 = (__pyx_v_state != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":136
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         if state is not None:
 *             cls =  (<ElementDefaultClassLookup>state).element_class             # <<<<<<<<<<<<<< 
 *         if cls is None:
 *             return _Element
 */
    Py_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class);
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":137
 *         if state is not None:
 *             cls =  (<ElementDefaultClassLookup>state).element_class
 *         if cls is None:             # <<<<<<<<<<<<<< 
 *             return _Element
 *         else:
 */
  __pyx_1 = (__pyx_v_cls == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":138
 *             cls =  (<ElementDefaultClassLookup>state).element_class
 *         if cls is None:
 *             return _Element             # <<<<<<<<<<<<<< 
 *         else:
 *             return cls
 */
    Py_INCREF(((PyObject*)__pyx_ptype_4lxml_5etree__Element));
    __pyx_r = ((PyObject*)__pyx_ptype_4lxml_5etree__Element);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":140
 *             return _Element
 *         else:
 *             return cls             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         if state is not None:
 */
    Py_INCREF(__pyx_v_cls);
    __pyx_r = __pyx_v_cls;
    goto __pyx_L0;
  }
  __pyx_L4:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":141
 *         else:
 *             return cls
 *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<< 
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).comment_class
 */
__pyx_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":142
 *             return cls
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         if state is not None:             # <<<<<<<<<<<<<< 
 *             cls = (<ElementDefaultClassLookup>state).comment_class
 *         if cls is None:
 */
  __pyx_1 = (__pyx_v_state != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":143
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).comment_class             # <<<<<<<<<<<<<< 
 *         if cls is None:
 *             return _Comment
 */
    Py_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class);
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":144
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).comment_class
 *         if cls is None:             # <<<<<<<<<<<<<< 
 *             return _Comment
 *         else:
 */
  __pyx_1 = (__pyx_v_cls == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":145
 *             cls = (<ElementDefaultClassLookup>state).comment_class
 *         if cls is None:
 *             return _Comment             # <<<<<<<<<<<<<< 
 *         else:
 *             return cls
 */
    Py_INCREF(((PyObject*)__pyx_ptype_4lxml_5etree__Comment));
    __pyx_r = ((PyObject*)__pyx_ptype_4lxml_5etree__Comment);
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":147
 *             return _Comment
 *         else:
 *             return cls             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_PI_NODE:
 *         if state is not None:
 */
    Py_INCREF(__pyx_v_cls);
    __pyx_r = __pyx_v_cls;
    goto __pyx_L0;
  }
  __pyx_L6:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":148
 *         else:
 *             return cls
 *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<< 
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).pi_class
 */
__pyx_1 = (__pyx_v_c_node->type == XML_PI_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":149
 *             return cls
 *     elif c_node.type == tree.XML_PI_NODE:
 *         if state is not None:             # <<<<<<<<<<<<<< 
 *             cls = (<ElementDefaultClassLookup>state).pi_class
 *         if cls is None:
 */
  __pyx_1 = (__pyx_v_state != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":150
 *     elif c_node.type == tree.XML_PI_NODE:
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).pi_class             # <<<<<<<<<<<<<< 
 *         if cls is None:
 *             # special case XSLT-PI
 */
    Py_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class);
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":151
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).pi_class
 *         if cls is None:             # <<<<<<<<<<<<<< 
 *             # special case XSLT-PI
 *             if c_node.name is not NULL and c_node.content is not NULL:
 */
  __pyx_1 = (__pyx_v_cls == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":153
 *         if cls is None:
 *             # special case XSLT-PI
 *             if c_node.name is not NULL and c_node.content is not NULL:             # <<<<<<<<<<<<<< 
 *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
 */
    __pyx_1 = (__pyx_v_c_node->name != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":153
 *         if cls is None:
 *             # special case XSLT-PI
 *             if c_node.name is not NULL and c_node.content is not NULL:             # <<<<<<<<<<<<<< 
 *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
 */
      __pyx_1 = (__pyx_v_c_node->content != NULL);
    }
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":154
 *             # special case XSLT-PI
 *             if c_node.name is not NULL and c_node.content is not NULL:
 *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:             # <<<<<<<<<<<<<< 
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
 *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
 */
      __pyx_1 = (strcmp(__pyx_v_c_node->name,__pyx_k474) == 0);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":155
 *             if c_node.name is not NULL and c_node.content is not NULL:
 *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \             # <<<<<<<<<<<<<< 
 *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
 *                         return _XSLTProcessingInstruction
 */
        __pyx_1 = (strstr(__pyx_v_c_node->content,__pyx_k475) != NULL);
        if (!__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":156
 *                 if cstd.strcmp(c_node.name, "xml-stylesheet") == 0:
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
 *                            cstd.strstr(c_node.content, "text/xml") is not NULL:             # <<<<<<<<<<<<<< 
 *                         return _XSLTProcessingInstruction
 *             return _ProcessingInstruction
 */
          __pyx_1 = (strstr(__pyx_v_c_node->content,__pyx_k476) != NULL);
        }
        if (__pyx_1) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":157
 *                     if cstd.strstr(c_node.content, "text/xsl") is not NULL or \
 *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
 *                         return _XSLTProcessingInstruction             # <<<<<<<<<<<<<< 
 *             return _ProcessingInstruction
 *         else:
 */
          Py_INCREF(((PyObject*)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction));
          __pyx_r = ((PyObject*)__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction);
          goto __pyx_L0;
          goto __pyx_L11;
        }
        __pyx_L11:;
        goto __pyx_L10;
      }
      __pyx_L10:;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":158
 *                            cstd.strstr(c_node.content, "text/xml") is not NULL:
 *                         return _XSLTProcessingInstruction
 *             return _ProcessingInstruction             # <<<<<<<<<<<<<< 
 *         else:
 *             return cls
 */
    Py_INCREF(((PyObject*)__pyx_ptype_4lxml_5etree__ProcessingInstruction));
    __pyx_r = ((PyObject*)__pyx_ptype_4lxml_5etree__ProcessingInstruction);
    goto __pyx_L0;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":160
 *             return _ProcessingInstruction
 *         else:
 *             return cls             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 *         if state is not None:
 */
    Py_INCREF(__pyx_v_cls);
    __pyx_r = __pyx_v_cls;
    goto __pyx_L0;
  }
  __pyx_L8:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":161
 *         else:
 *             return cls
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<< 
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).entity_class
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ENTITY_REF_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":162
 *             return cls
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 *         if state is not None:             # <<<<<<<<<<<<<< 
 *             cls = (<ElementDefaultClassLookup>state).entity_class
 *         if cls is None:
 */
  __pyx_1 = (__pyx_v_state != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":163
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).entity_class             # <<<<<<<<<<<<<< 
 *         if cls is None:
 *             return _Entity
 */
    Py_INCREF(((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->entity_class);
    Py_DECREF(__pyx_v_cls);
    __pyx_v_cls = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)__pyx_v_state)->entity_class;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":164
 *         if state is not None:
 *             cls = (<ElementDefaultClassLookup>state).entity_class
 *         if cls is None:             # <<<<<<<<<<<<<< 
 *             return _Entity
 *         else:
 */
  __pyx_1 = (__pyx_v_cls == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":165
 *             cls = (<ElementDefaultClassLookup>state).entity_class
 *         if cls is None:
 *             return _Entity             # <<<<<<<<<<<<<< 
 *         else:
 *             return cls
 */
    Py_INCREF(((PyObject*)__pyx_ptype_4lxml_5etree__Entity));
    __pyx_r = ((PyObject*)__pyx_ptype_4lxml_5etree__Entity);
    goto __pyx_L0;
    goto __pyx_L13;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":167
 *             return _Entity
 *         else:
 *             return cls             # <<<<<<<<<<<<<< 
 *     else:
 *         assert 0, "Unknown node type: %s" % c_node.type
 */
    Py_INCREF(__pyx_v_cls);
    __pyx_r = __pyx_v_cls;
    goto __pyx_L0;
  }
  __pyx_L13:;
  goto __pyx_L2;
}
/*else*/ {
  #ifndef PYREX_WITHOUT_ASSERTIONS

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":169
 *             return cls
 *     else:
 *         assert 0, "Unknown node type: %s" % c_node.type             # <<<<<<<<<<<<<< 
 * 
 * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):
 */
  if (unlikely(!0)) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":169
 *             return cls
 *     else:
 *         assert 0, "Unknown node type: %s" % c_node.type             # <<<<<<<<<<<<<< 
 * 
 * cdef class AttributeBasedElementClassLookup(FallbackElementClassLookup):
 */
    __pyx_2 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 169; goto __pyx_L1;}
    __pyx_3 = PyNumber_Remainder(__pyx_k477p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 169; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    PyErr_SetObject(PyExc_AssertionError, __pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 169; goto __pyx_L1;}
  }
  #endif
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._lookupDefaultElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_cls);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v__doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":187
 *     cdef char* _c_ns
 *     cdef char* _c_name
 *     def __init__(self, attribute_name, class_mapping,             # <<<<<<<<<<<<<< 
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 */

static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_attribute_name = 0;
PyObject *__pyx_v_class_mapping = 0;
struct LxmlElementClassLookup *__pyx_v_fallback = 0;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_name;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"attribute_name","class_mapping","fallback",0};
__pyx_v_fallback = __pyx_k151;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_attribute_name, &__pyx_v_class_mapping, &__pyx_v_fallback))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_attribute_name);
Py_INCREF(__pyx_v_class_mapping);
Py_INCREF(__pyx_v_fallback);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 188; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":189
 *     def __init__(self, attribute_name, class_mapping,
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)             # <<<<<<<<<<<<<< 
 *         ns, name = self._pytag
 *         if ns is None:
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_attribute_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 189; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":189
 *     def __init__(self, attribute_name, class_mapping,
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)             # <<<<<<<<<<<<<< 
 *         ns, name = self._pytag
 *         if ns is None:
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag);
((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":190
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             self._c_ns = NULL
 */
if (PyTuple_CheckExact(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag) && PyTuple_GET_SIZE(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag) == 2) {
  __pyx_2 = PyTuple_GET_ITEM(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag, 0);
  Py_INCREF(__pyx_2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":190
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             self._c_ns = NULL
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = PyTuple_GET_ITEM(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag, 1);
  Py_INCREF(__pyx_2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":190
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             self._c_ns = NULL
 */
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
}
else {
  __pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":190
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             self._c_ns = NULL
 */
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":190
 *                  ElementClassLookup fallback=None):
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag             # <<<<<<<<<<<<<< 
 *         if ns is None:
 *             self._c_ns = NULL
 */
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":191
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag
 *         if ns is None:             # <<<<<<<<<<<<<< 
 *             self._c_ns = NULL
 *         else:
 */
__pyx_3 = (__pyx_v_ns == Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":192
 *         ns, name = self._pytag
 *         if ns is None:
 *             self._c_ns = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             self._c_ns = _cstr(ns)
 */
  ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":194
 *             self._c_ns = NULL
 *         else:
 *             self._c_ns = _cstr(ns)             # <<<<<<<<<<<<<< 
 *         self._c_name = _cstr(name)
 *         self._class_mapping = dict(class_mapping)
 */
  ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = _cstr(__pyx_v_ns);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":195
 *         else:
 *             self._c_ns = _cstr(ns)
 *         self._c_name = _cstr(name)             # <<<<<<<<<<<<<< 
 *         self._class_mapping = dict(class_mapping)
 * 
 */
((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_name = _cstr(__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":196
 *             self._c_ns = _cstr(ns)
 *         self._c_name = _cstr(name)
 *         self._class_mapping = dict(class_mapping)             # <<<<<<<<<<<<<< 
 * 
 *         FallbackElementClassLookup.__init__(self, fallback)
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 196; goto __pyx_L1;}
Py_INCREF(__pyx_v_class_mapping);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_class_mapping);
__pyx_1 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 196; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":196
 *             self._c_ns = _cstr(ns)
 *         self._c_name = _cstr(name)
 *         self._class_mapping = dict(class_mapping)             # <<<<<<<<<<<<<< 
 * 
 *         FallbackElementClassLookup.__init__(self, fallback)
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping);
((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":198
 *         self._class_mapping = dict(class_mapping)
 * 
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _attribute_class_lookup
 * 
 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n___init__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":198
 *         self._class_mapping = dict(class_mapping)
 * 
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _attribute_class_lookup
 * 
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_fallback));
PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_fallback));
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 198; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":199
 * 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _attribute_class_lookup             # <<<<<<<<<<<<<< 
 * 
 * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):
 */
((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__attribute_class_lookup;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.AttributeBasedElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_name);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_attribute_name);
Py_DECREF(__pyx_v_class_mapping);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":201
 *         self._lookup_function = _attribute_class_lookup
 * 
 * cdef object _attribute_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef AttributeBasedElementClassLookup lookup
 *     cdef python.PyObject* dict_result
 */

static  PyObject *__pyx_f_4lxml_5etree__attribute_class_lookup(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *__pyx_v_lookup;
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_value;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":205
 *     cdef python.PyObject* dict_result
 * 
 *     lookup = <AttributeBasedElementClassLookup>state             # <<<<<<<<<<<<<< 
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         value = _attributeValueFromNsName(
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":206
 * 
 *     lookup = <AttributeBasedElementClassLookup>state
 *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *         value = _attributeValueFromNsName(
 *             c_node, lookup._c_ns, lookup._c_name)
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":208
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         value = _attributeValueFromNsName(
 *             c_node, lookup._c_ns, lookup._c_name)             # <<<<<<<<<<<<<< 
 *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
 *         if dict_result is not NULL:
 */
  __pyx_2 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_node,__pyx_v_lookup->_c_ns,__pyx_v_lookup->_c_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 207; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":209
 *         value = _attributeValueFromNsName(
 *             c_node, lookup._c_ns, lookup._c_name)
 *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)             # <<<<<<<<<<<<<< 
 *         if dict_result is not NULL:
 *             return <object>dict_result
 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_class_mapping,__pyx_v_value);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":210
 *             c_node, lookup._c_ns, lookup._c_name)
 *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
 *         if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *             return <object>dict_result
 *     return lookup._callFallback(doc, c_node)
 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":211
 *         dict_result = python.PyDict_GetItem(lookup._class_mapping, value)
 *         if dict_result is not NULL:
 *             return <object>dict_result             # <<<<<<<<<<<<<< 
 *     return lookup._callFallback(doc, c_node)
 * 
 */
    __pyx_2 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_2);
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":212
 *         if dict_result is not NULL:
 *             return <object>dict_result
 *     return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup *)__pyx_v_lookup->__pyx_base.__pyx_vtab)->__pyx_base._callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 212; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._attribute_class_lookup");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":218
 *     """Element class lookup based on the XML parser.
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _parser_class_lookup
 */

static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_fallback = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"fallback",0};
__pyx_v_fallback = __pyx_k152;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_fallback))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_fallback);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 218; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":219
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _parser_class_lookup
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 219; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":219
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _parser_class_lookup
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 219; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_fallback));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_fallback));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 219; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":220
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _parser_class_lookup             # <<<<<<<<<<<<<< 
 * 
 * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
 */
((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__parser_class_lookup;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.ParserBasedElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":222
 *         self._lookup_function = _parser_class_lookup
 * 
 * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef FallbackElementClassLookup lookup
 *     lookup = <FallbackElementClassLookup>state
 */

static  PyObject *__pyx_f_4lxml_5etree__parser_class_lookup(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
struct LxmlFallbackElementClassLookup *__pyx_v_lookup;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);
__pyx_v_lookup = ((struct LxmlFallbackElementClassLookup *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":224
 * cdef object _parser_class_lookup(state, _Document doc, xmlNode* c_node):
 *     cdef FallbackElementClassLookup lookup
 *     lookup = <FallbackElementClassLookup>state             # <<<<<<<<<<<<<< 
 *     if doc._parser._class_lookup is not None:
 *         return doc._parser._class_lookup._lookup_function(
 */
Py_INCREF(((PyObject *)((struct LxmlFallbackElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct LxmlFallbackElementClassLookup *)__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":225
 *     cdef FallbackElementClassLookup lookup
 *     lookup = <FallbackElementClassLookup>state
 *     if doc._parser._class_lookup is not None:             # <<<<<<<<<<<<<< 
 *         return doc._parser._class_lookup._lookup_function(
 *             doc._parser._class_lookup, doc, c_node)
 */
__pyx_1 = (((PyObject *)__pyx_v_doc->_parser->_class_lookup) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":227
 *     if doc._parser._class_lookup is not None:
 *         return doc._parser._class_lookup._lookup_function(
 *             doc._parser._class_lookup, doc, c_node)             # <<<<<<<<<<<<<< 
 *     return lookup._callFallback(doc, c_node)
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":228
 *         return doc._parser._class_lookup._lookup_function(
 *             doc._parser._class_lookup, doc, c_node)
 *     return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)__pyx_v_lookup->__pyx_vtab)->_callFallback(__pyx_v_lookup,((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 228; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parser_class_lookup");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":246
 *     If you return None from this method, the fallback will be called.
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _custom_class_lookup
 */

static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_24CustomElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_fallback = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"fallback",0};
__pyx_v_fallback = __pyx_k153;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_fallback))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_fallback);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 246; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":247
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _custom_class_lookup
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":247
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _custom_class_lookup
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_fallback));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_fallback));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":248
 *     def __init__(self, ElementClassLookup fallback=None):
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _custom_class_lookup             # <<<<<<<<<<<<<< 
 * 
 *     def lookup(self, type, doc, namespace, name):
 */
((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__custom_class_lookup;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.CustomElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":250
 *         self._lookup_function = _custom_class_lookup
 * 
 *     def lookup(self, type, doc, namespace, name):             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_type = 0;
PyObject *__pyx_v_doc = 0;
PyObject *__pyx_v_namespace = 0;
PyObject *__pyx_v_name = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"type","doc","namespace","name",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_type, &__pyx_v_doc, &__pyx_v_namespace, &__pyx_v_name))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_type);
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_namespace);
Py_INCREF(__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":251
 * 
 *     def lookup(self, type, doc, namespace, name):
 *         return None             # <<<<<<<<<<<<<< 
 * 
 * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_type);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_namespace);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":253
 *         return None
 * 
 * cdef object _custom_class_lookup(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef CustomElementClassLookup lookup
 *     cdef char* c_str
 */

static PyObject *__pyx_n_element;
static PyObject *__pyx_n_entity;


static  PyObject *__pyx_f_4lxml_5etree__custom_class_lookup(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *__pyx_v_lookup;
char *__pyx_v_c_str;
PyObject *__pyx_v_element_type;
PyObject *__pyx_v_name;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_cls;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_element_type = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_cls = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":257
 *     cdef char* c_str
 * 
 *     lookup = <CustomElementClassLookup>state             # <<<<<<<<<<<<<< 
 * 
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":259
 *     lookup = <CustomElementClassLookup>state
 * 
 *     if c_node.type == tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *         element_type = "element"
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":260
 * 
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         element_type = "element"             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         element_type = "comment"
 */
  Py_INCREF(__pyx_n_element);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_element;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":261
 *     if c_node.type == tree.XML_ELEMENT_NODE:
 *         element_type = "element"
 *     elif c_node.type == tree.XML_COMMENT_NODE:             # <<<<<<<<<<<<<< 
 *         element_type = "comment"
 *     elif c_node.type == tree.XML_PI_NODE:
 */
__pyx_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":262
 *         element_type = "element"
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         element_type = "comment"             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_PI_NODE:
 *         element_type = "PI"
 */
  Py_INCREF(__pyx_n_comment);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_comment;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":263
 *     elif c_node.type == tree.XML_COMMENT_NODE:
 *         element_type = "comment"
 *     elif c_node.type == tree.XML_PI_NODE:             # <<<<<<<<<<<<<< 
 *         element_type = "PI"
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 */
__pyx_1 = (__pyx_v_c_node->type == XML_PI_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":264
 *         element_type = "comment"
 *     elif c_node.type == tree.XML_PI_NODE:
 *         element_type = "PI"             # <<<<<<<<<<<<<< 
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 *         element_type = "entity"
 */
  Py_INCREF(__pyx_n_PI);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_PI;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":265
 *     elif c_node.type == tree.XML_PI_NODE:
 *         element_type = "PI"
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:             # <<<<<<<<<<<<<< 
 *         element_type = "entity"
 *     else:
 */
__pyx_1 = (__pyx_v_c_node->type == XML_ENTITY_REF_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":266
 *         element_type = "PI"
 *     elif c_node.type == tree.XML_ENTITY_REF_NODE:
 *         element_type = "entity"             # <<<<<<<<<<<<<< 
 *     else:
 *         element_type = "element"
 */
  Py_INCREF(__pyx_n_entity);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_entity;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":268
 *         element_type = "entity"
 *     else:
 *         element_type = "element"             # <<<<<<<<<<<<<< 
 *     if c_node.name is NULL:
 *         name = None
 */
  Py_INCREF(__pyx_n_element);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_element;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":269
 *     else:
 *         element_type = "element"
 *     if c_node.name is NULL:             # <<<<<<<<<<<<<< 
 *         name = None
 *     else:
 */
__pyx_1 = (__pyx_v_c_node->name == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":270
 *         element_type = "element"
 *     if c_node.name is NULL:
 *         name = None             # <<<<<<<<<<<<<< 
 *     else:
 *         name = c_node.name
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = Py_None;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":272
 *         name = None
 *     else:
 *         name = c_node.name             # <<<<<<<<<<<<<< 
 *     c_str = tree._getNs(c_node)
 *     if c_str is NULL:
 */
  __pyx_2 = PyString_FromString(__pyx_v_c_node->name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 272; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":273
 *     else:
 *         name = c_node.name
 *     c_str = tree._getNs(c_node)             # <<<<<<<<<<<<<< 
 *     if c_str is NULL:
 *         ns = None
 */
__pyx_v_c_str = _getNs(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":274
 *         name = c_node.name
 *     c_str = tree._getNs(c_node)
 *     if c_str is NULL:             # <<<<<<<<<<<<<< 
 *         ns = None
 *     else:
 */
__pyx_1 = (__pyx_v_c_str == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":275
 *     c_str = tree._getNs(c_node)
 *     if c_str is NULL:
 *         ns = None             # <<<<<<<<<<<<<< 
 *     else:
 *         ns = c_str
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = Py_None;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":277
 *         ns = None
 *     else:
 *         ns = c_str             # <<<<<<<<<<<<<< 
 * 
 *     cls = lookup.lookup(element_type, doc, ns, name)
 */
  __pyx_2 = PyString_FromString(__pyx_v_c_str); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 277; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":279
 *         ns = c_str
 * 
 *     cls = lookup.lookup(element_type, doc, ns, name)             # <<<<<<<<<<<<<< 
 *     if cls is not None:
 *         return cls
 */
__pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_lookup), __pyx_n_lookup); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":279
 *         ns = c_str
 * 
 *     cls = lookup.lookup(element_type, doc, ns, name)             # <<<<<<<<<<<<<< 
 *     if cls is not None:
 *         return cls
 */
__pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}
Py_INCREF(__pyx_v_element_type);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_element_type);
Py_INCREF(((PyObject *)__pyx_v_doc));
PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_doc));
Py_INCREF(__pyx_v_ns);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_ns);
Py_INCREF(__pyx_v_name);
PyTuple_SET_ITEM(__pyx_3, 3, __pyx_v_name);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 279; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_cls);
__pyx_v_cls = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":280
 * 
 *     cls = lookup.lookup(element_type, doc, ns, name)
 *     if cls is not None:             # <<<<<<<<<<<<<< 
 *         return cls
 *     return lookup._callFallback(doc, c_node)
 */
__pyx_1 = (__pyx_v_cls != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":281
 *     cls = lookup.lookup(element_type, doc, ns, name)
 *     if cls is not None:
 *         return cls             # <<<<<<<<<<<<<< 
 *     return lookup._callFallback(doc, c_node)
 * 
 */
  Py_INCREF(__pyx_v_cls);
  __pyx_r = __pyx_v_cls;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":282
 *     if cls is not None:
 *         return cls
 *     return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup *)__pyx_v_lookup->__pyx_base.__pyx_vtab)->__pyx_base._callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._custom_class_lookup");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_element_type);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_cls);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":291
 * cdef object ELEMENT_CLASS_LOOKUP_STATE
 * 
 * cdef void _setElementClassLookupFunction(             # <<<<<<<<<<<<<< 
 *     _element_class_lookup_function function, object state):
 *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
 */

static  void __pyx_f_4lxml_5etree__setElementClassLookupFunction(_element_class_lookup_function __pyx_v_function,PyObject *__pyx_v_state) {
int __pyx_1;
Py_INCREF(__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":294
 *     _element_class_lookup_function function, object state):
 *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
 *     if function is NULL:             # <<<<<<<<<<<<<< 
 *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP
 *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
 */
__pyx_1 = (__pyx_v_function == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":295
 *     global LOOKUP_ELEMENT_CLASS, ELEMENT_CLASS_LOOKUP_STATE
 *     if function is NULL:
 *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP             # <<<<<<<<<<<<<< 
 *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
 * 
 */
  Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
  Py_DECREF(__pyx_v_state);
  __pyx_v_state = ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":296
 *     if function is NULL:
 *         state    = DEFAULT_ELEMENT_CLASS_LOOKUP
 *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function             # <<<<<<<<<<<<<< 
 * 
 *     ELEMENT_CLASS_LOOKUP_STATE = state
 */
  __pyx_v_function = __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP->__pyx_base.__pyx_base._lookup_function;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":298
 *         function = DEFAULT_ELEMENT_CLASS_LOOKUP._lookup_function
 * 
 *     ELEMENT_CLASS_LOOKUP_STATE = state             # <<<<<<<<<<<<<< 
 *     LOOKUP_ELEMENT_CLASS = function
 * 
 */
Py_INCREF(__pyx_v_state);
Py_DECREF(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE);
__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = __pyx_v_state;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":299
 * 
 *     ELEMENT_CLASS_LOOKUP_STATE = state
 *     LOOKUP_ELEMENT_CLASS = function             # <<<<<<<<<<<<<< 
 * 
 * def setElementClassLookup(ElementClassLookup lookup = None):
 */
__pyx_v_4lxml_5etree_LOOKUP_ELEMENT_CLASS = __pyx_v_function;

Py_DECREF(__pyx_v_state);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":301
 *     LOOKUP_ELEMENT_CLASS = function
 * 
 * def setElementClassLookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *     "Deprecated, use ``set_element_class_lookup(lookup)`` instead"
 *     set_element_class_lookup(lookup)
 */

static PyObject *__pyx_pf_4lxml_5etree_setElementClassLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_setElementClassLookup[] = "Deprecated, use ``set_element_class_lookup(lookup)`` instead";
static PyObject *__pyx_pf_4lxml_5etree_setElementClassLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_lookup = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"lookup",0};
__pyx_v_lookup = __pyx_k154;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup))) return NULL;
Py_INCREF(__pyx_v_lookup);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 301; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":303
 * def setElementClassLookup(ElementClassLookup lookup = None):
 *     "Deprecated, use ``set_element_class_lookup(lookup)`` instead"
 *     set_element_class_lookup(lookup)             # <<<<<<<<<<<<<< 
 * 
 * def set_element_class_lookup(ElementClassLookup lookup = None):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_set_element_class_lookup); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 303; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":303
 * def setElementClassLookup(ElementClassLookup lookup = None):
 *     "Deprecated, use ``set_element_class_lookup(lookup)`` instead"
 *     set_element_class_lookup(lookup)             # <<<<<<<<<<<<<< 
 * 
 * def set_element_class_lookup(ElementClassLookup lookup = None):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 303; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_lookup));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_lookup));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 303; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.setElementClassLookup");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":305
 *     set_element_class_lookup(lookup)
 * 
 * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *     "Set the global default element class lookup method."
 *     if lookup is None or lookup._lookup_function is NULL:
 */

static PyObject *__pyx_pf_4lxml_5etree_set_element_class_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_set_element_class_lookup[] = "Set the global default element class lookup method.";
static PyObject *__pyx_pf_4lxml_5etree_set_element_class_lookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_lookup = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"lookup",0};
__pyx_v_lookup = __pyx_k155;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup))) return NULL;
Py_INCREF(__pyx_v_lookup);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup"))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 305; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":307
 * def set_element_class_lookup(ElementClassLookup lookup = None):
 *     "Set the global default element class lookup method."
 *     if lookup is None or lookup._lookup_function is NULL:             # <<<<<<<<<<<<<< 
 *         _setElementClassLookupFunction(NULL, None)
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_lookup) == Py_None);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":307
 * def set_element_class_lookup(ElementClassLookup lookup = None):
 *     "Set the global default element class lookup method."
 *     if lookup is None or lookup._lookup_function is NULL:             # <<<<<<<<<<<<<< 
 *         _setElementClassLookupFunction(NULL, None)
 *     else:
 */
  __pyx_1 = (__pyx_v_lookup->_lookup_function == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":308
 *     "Set the global default element class lookup method."
 *     if lookup is None or lookup._lookup_function is NULL:
 *         _setElementClassLookupFunction(NULL, None)             # <<<<<<<<<<<<<< 
 *     else:
 *         _setElementClassLookupFunction(lookup._lookup_function, lookup)
 */
  __pyx_f_4lxml_5etree__setElementClassLookupFunction(NULL,Py_None);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":310
 *         _setElementClassLookupFunction(NULL, None)
 *     else:
 *         _setElementClassLookupFunction(lookup._lookup_function, lookup)             # <<<<<<<<<<<<<< 
 * 
 * # default setup: parser delegation
 */
  __pyx_f_4lxml_5etree__setElementClassLookupFunction(__pyx_v_lookup->_lookup_function,((PyObject *)__pyx_v_lookup));
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.set_element_class_lookup");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":20
 *     cdef object _entries
 *     cdef char* _c_ns_uri_utf
 *     def __init__(self, ns_uri):             # <<<<<<<<<<<<<< 
 *         self._ns_uri = ns_uri
 *         if ns_uri is None:
 */

static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ns_uri = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"ns_uri",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_ns_uri))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_ns_uri);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":21
 *     cdef char* _c_ns_uri_utf
 *     def __init__(self, ns_uri):
 *         self._ns_uri = ns_uri             # <<<<<<<<<<<<<< 
 *         if ns_uri is None:
 *             self._ns_uri_utf = None
 */
Py_INCREF(__pyx_v_ns_uri);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri);
((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri = __pyx_v_ns_uri;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":22
 *     def __init__(self, ns_uri):
 *         self._ns_uri = ns_uri
 *         if ns_uri is None:             # <<<<<<<<<<<<<< 
 *             self._ns_uri_utf = None
 *             self._c_ns_uri_utf = NULL
 */
__pyx_1 = (__pyx_v_ns_uri == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":23
 *         self._ns_uri = ns_uri
 *         if ns_uri is None:
 *             self._ns_uri_utf = None             # <<<<<<<<<<<<<< 
 *             self._c_ns_uri_utf = NULL
 *         else:
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
  ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = Py_None;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":24
 *         if ns_uri is None:
 *             self._ns_uri_utf = None
 *             self._c_ns_uri_utf = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             self._ns_uri_utf = _utf8(ns_uri)
 */
  ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":26
 *             self._c_ns_uri_utf = NULL
 *         else:
 *             self._ns_uri_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<< 
 *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
 *         self._entries = {}
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":26
 *             self._c_ns_uri_utf = NULL
 *         else:
 *             self._ns_uri_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<< 
 *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
 *         self._entries = {}
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
  ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":27
 *         else:
 *             self._ns_uri_utf = _utf8(ns_uri)
 *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)             # <<<<<<<<<<<<<< 
 *         self._entries = {}
 * 
 */
  ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = _cstr(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":28
 *             self._ns_uri_utf = _utf8(ns_uri)
 *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
 *         self._entries = {}             # <<<<<<<<<<<<<< 
 * 
 *     def update(self, class_dict_iterable):
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 28; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":28
 *             self._ns_uri_utf = _utf8(ns_uri)
 *             self._c_ns_uri_utf = _cstr(self._ns_uri_utf)
 *         self._entries = {}             # <<<<<<<<<<<<<< 
 * 
 *     def update(self, class_dict_iterable):
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries);
((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries = __pyx_2;
__pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":30
 *         self._entries = {}
 * 
 *     def update(self, class_dict_iterable):             # <<<<<<<<<<<<<< 
 *         """Forgivingly update the registry. If registered values do not match
 *         the required type for this registry, or if their name starts with '_',
 */

static PyObject *__pyx_n__;


static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_v_class_dict_iterable); /*proto*/
static char __pyx_doc_4lxml_5etree_18_NamespaceRegistry_update[] = "Forgivingly update the registry. If registered values do not match\n        the required type for this registry, or if their name starts with \'_\',\n        they will be silently discarded. This allows registrations at the\n        module or class level using vars(), globals() etc.";
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_v_class_dict_iterable) {
PyObject *__pyx_v_name;
PyObject *__pyx_v_item;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_class_dict_iterable);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":35
 *         they will be silently discarded. This allows registrations at the
 *         module or class level using vars(), globals() etc."""
 *         if hasattr(class_dict_iterable, 'items'):             # <<<<<<<<<<<<<< 
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:
 */
__pyx_1 = PyObject_HasAttr(__pyx_v_class_dict_iterable,__pyx_n_items); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":36
 *         module or class level using vars(), globals() etc."""
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()             # <<<<<<<<<<<<<< 
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_class_dict_iterable, __pyx_n_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 36; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 36; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_class_dict_iterable);
  __pyx_v_class_dict_iterable = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
if (PyList_CheckExact(__pyx_v_class_dict_iterable)) { __pyx_4 = 0; __pyx_2 = __pyx_v_class_dict_iterable; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_v_class_dict_iterable); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_4 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_4++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_6 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
    Py_DECREF(__pyx_v_item);
    __pyx_v_item = __pyx_6;
    __pyx_6 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_5 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":37
 *         if hasattr(class_dict_iterable, 'items'):
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:             # <<<<<<<<<<<<<< 
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item
 */
    Py_DECREF(__pyx_v_item);
    __pyx_v_item = __pyx_6;
    __pyx_6 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 37; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":38
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):             # <<<<<<<<<<<<<< 
 *                 self[name] = item
 * 
 */
  __pyx_1 = (__pyx_v_name == Py_None);
  __pyx_6 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  if (!__pyx_1) {
    Py_DECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":38
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):             # <<<<<<<<<<<<<< 
 *                 self[name] = item
 * 
 */
    __pyx_3 = PySequence_GetSlice(__pyx_v_name, 0, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":38
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):             # <<<<<<<<<<<<<< 
 *                 self[name] = item
 * 
 */
    __pyx_6 = PyObject_RichCompare(__pyx_3, __pyx_n__, Py_NE); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  if (__pyx_1) {
    Py_DECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":38
 *             class_dict_iterable = class_dict_iterable.items()
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):             # <<<<<<<<<<<<<< 
 *                 self[name] = item
 * 
 */
    __pyx_6 = PyInt_FromLong(callable(__pyx_v_item)); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  }
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":39
 *         for name, item in class_dict_iterable:
 *             if (name is None or name[:1] != '_') and callable(item):
 *                 self[name] = item             # <<<<<<<<<<<<<< 
 * 
 *     def __getitem__(self, name):
 */
    if (PyObject_SetItem(__pyx_v_self, __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.update");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_item);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_class_dict_iterable);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":41
 *                 self[name] = item
 * 
 *     def __getitem__(self, name):             # <<<<<<<<<<<<<< 
 *         if name is not None:
 *             name = _utf8(name)
 */

static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":42
 * 
 *     def __getitem__(self, name):
 *         if name is not None:             # <<<<<<<<<<<<<< 
 *             name = _utf8(name)
 *         return self._get(name)
 */
__pyx_1 = (__pyx_v_name != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":43
 *     def __getitem__(self, name):
 *         if name is not None:
 *             name = _utf8(name)             # <<<<<<<<<<<<<< 
 *         return self._get(name)
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":44
 *         if name is not None:
 *             name = _utf8(name)
 *         return self._get(name)             # <<<<<<<<<<<<<< 
 * 
 *     def __delitem__(self, name):
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 44; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":46
 *         return self._get(name)
 * 
 *     def __delitem__(self, name):             # <<<<<<<<<<<<<< 
 *         if name is not None:
 *             name = _utf8(name)
 */

static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static int __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":47
 * 
 *     def __delitem__(self, name):
 *         if name is not None:             # <<<<<<<<<<<<<< 
 *             name = _utf8(name)
 *         python.PyDict_DelItem(self._entries, name)
 */
__pyx_1 = (__pyx_v_name != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":48
 *     def __delitem__(self, name):
 *         if name is not None:
 *             name = _utf8(name)             # <<<<<<<<<<<<<< 
 *         python.PyDict_DelItem(self._entries, name)
 * 
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 48; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":49
 *         if name is not None:
 *             name = _utf8(name)
 *         python.PyDict_DelItem(self._entries, name)             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _get(self, object name):
 */
__pyx_3 = PyDict_DelItem(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries,__pyx_v_name); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 49; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__delitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":51
 *         python.PyDict_DelItem(self._entries, name)
 * 
 *     cdef object _get(self, object name):             # <<<<<<<<<<<<<< 
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItem(self._entries, name)
 */

static PyObject *__pyx_k485p;

static char __pyx_k485[] = "Name not registered.";

static  PyObject *__pyx_f_4lxml_5etree_18_NamespaceRegistry__get(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self,PyObject *__pyx_v_name) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":53
 *     cdef object _get(self, object name):
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItem(self._entries, name)             # <<<<<<<<<<<<<< 
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."
 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_entries,__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":54
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItem(self._entries, name)
 *         if dict_result is NULL:             # <<<<<<<<<<<<<< 
 *             raise KeyError, "Name not registered."
 *         return <object>dict_result
 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":55
 *         dict_result = python.PyDict_GetItem(self._entries, name)
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."             # <<<<<<<<<<<<<< 
 *         return <object>dict_result
 * 
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k485p, 0);
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 55; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":56
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."
 *         return <object>dict_result             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _getForString(self, char* name):
 */
__pyx_2 = (PyObject *)__pyx_v_dict_result;
Py_INCREF(__pyx_2);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry._get");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":58
 *         return <object>dict_result
 * 
 *     cdef object _getForString(self, char* name):             # <<<<<<<<<<<<<< 
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItemString(self._entries, name)
 */

static PyObject *__pyx_k486p;

static char __pyx_k486[] = "Name not registered.";

static  PyObject *__pyx_f_4lxml_5etree_18_NamespaceRegistry__getForString(struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_self,char *__pyx_v_name) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":60
 *     cdef object _getForString(self, char* name):
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItemString(self._entries, name)             # <<<<<<<<<<<<<< 
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."
 */
__pyx_v_dict_result = PyDict_GetItemString(__pyx_v_self->_entries,__pyx_v_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":61
 *         cdef python.PyObject* dict_result
 *         dict_result = python.PyDict_GetItemString(self._entries, name)
 *         if dict_result is NULL:             # <<<<<<<<<<<<<< 
 *             raise KeyError, "Name not registered."
 *         return <object>dict_result
 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":62
 *         dict_result = python.PyDict_GetItemString(self._entries, name)
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."             # <<<<<<<<<<<<<< 
 *         return <object>dict_result
 * 
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k486p, 0);
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 62; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":63
 *         if dict_result is NULL:
 *             raise KeyError, "Name not registered."
 *         return <object>dict_result             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_2 = (PyObject *)__pyx_v_dict_result;
Py_INCREF(__pyx_2);
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry._getForString");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":65
 *         return <object>dict_result
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return iter(self._entries)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":66
 * 
 *     def __iter__(self):
 *         return iter(self._entries)             # <<<<<<<<<<<<<< 
 * 
 *     def items(self):
 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 66; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":68
 *         return iter(self._entries)
 * 
 *     def items(self):             # <<<<<<<<<<<<<< 
 *         return self._entries.items()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":69
 * 
 *     def items(self):
 *         return self._entries.items()             # <<<<<<<<<<<<<< 
 * 
 *     def iteritems(self):
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries, __pyx_n_items); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.items");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":71
 *         return self._entries.items()
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<< 
 *         return self._entries.iteritems()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":72
 * 
 *     def iteritems(self):
 *         return self._entries.iteritems()             # <<<<<<<<<<<<<< 
 * 
 *     def clear(self):
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._NamespaceRegistry.iteritems");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":74
 *         return self._entries.iteritems()
 * 
 *     def clear(self):             # <<<<<<<<<<<<<< 
 *         python.PyDict_Clear(self._entries)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":75
 * 
 *     def clear(self):
 *         python.PyDict_Clear(self._entries)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
 */
PyDict_Clear(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_v_self)->_entries);

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":79
 * cdef class _ClassNamespaceRegistry(_NamespaceRegistry):
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<< 
 *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
 *             raise NamespaceRegistryError, \
 */

static PyObject *__pyx_k487p;

static char __pyx_k487[] = "Registered element classes must be subtypes of ElementBase";

static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
static int __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item) {
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_item);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":80
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):
 *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<< 
 *             raise NamespaceRegistryError, \
 *                   "Registered element classes must be subtypes of ElementBase"
 */
__pyx_1 = (!PyType_Check(__pyx_v_item));
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":80
 *     "Dictionary-like registry for namespace implementation classes"
 *     def __setitem__(self, name, item):
 *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):             # <<<<<<<<<<<<<< 
 *             raise NamespaceRegistryError, \
 *                   "Registered element classes must be subtypes of ElementBase"
 */
  __pyx_2 = PyObject_IsSubclass(__pyx_v_item,((PyObject*)__pyx_ptype_4lxml_5etree_ElementBase)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 80; goto __pyx_L1;}
  __pyx_1 = (!__pyx_2);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":81
 *     def __setitem__(self, name, item):
 *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
 *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<< 
 *                   "Registered element classes must be subtypes of ElementBase"
 *         if name is not None:
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_NamespaceRegistryError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":82
 *         if not python.PyType_Check(item) or not issubclass(item, ElementBase):
 *             raise NamespaceRegistryError, \
 *                   "Registered element classes must be subtypes of ElementBase"             # <<<<<<<<<<<<<< 
 *         if name is not None:
 *             name = _utf8(name)
 */
  __Pyx_Raise(__pyx_3, __pyx_k487p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 81; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":83
 *             raise NamespaceRegistryError, \
 *                   "Registered element classes must be subtypes of ElementBase"
 *         if name is not None:             # <<<<<<<<<<<<<< 
 *             name = _utf8(name)
 *         self._entries[name] = item
 */
__pyx_2 = (__pyx_v_name != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":84
 *                   "Registered element classes must be subtypes of ElementBase"
 *         if name is not None:
 *             name = _utf8(name)             # <<<<<<<<<<<<<< 
 *         self._entries[name] = item
 * 
 */
  __pyx_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":85
 *         if name is not None:
 *             name = _utf8(name)
 *         self._entries[name] = item             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
if (PyObject_SetItem(((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries, __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 85; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ClassNamespaceRegistry.__setitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_item);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":87
 *         self._entries[name] = item
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "Namespace(%r)" % self._ns_uri
 * 
 */

static PyObject *__pyx_k488p;

static char __pyx_k488[] = "Namespace(%r)";

static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":88
 * 
 *     def __repr__(self):
 *         return "Namespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = PyNumber_Remainder(__pyx_k488p, ((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ClassNamespaceRegistry.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":96
 *     """
 *     cdef object _namespace_registries
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         self._namespace_registries = {}
 *         FallbackElementClassLookup.__init__(self, fallback)
 */

static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_fallback = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"fallback",0};
__pyx_v_fallback = __pyx_k160;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_fallback))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_fallback);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "fallback"))) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 96; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":97
 *     cdef object _namespace_registries
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._namespace_registries = {}             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _find_nselement_class
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 97; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":97
 *     cdef object _namespace_registries
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._namespace_registries = {}             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _find_nselement_class
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries);
((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":98
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._namespace_registries = {}
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _find_nselement_class
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_FallbackElementClassLookup), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":98
 *     def __init__(self, ElementClassLookup fallback=None):
 *         self._namespace_registries = {}
 *         FallbackElementClassLookup.__init__(self, fallback)             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _find_nselement_class
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_fallback));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_fallback));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":99
 *         self._namespace_registries = {}
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _find_nselement_class             # <<<<<<<<<<<<<< 
 * 
 *     def get_namespace(self, ns_uri):
 */
((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_4lxml_5etree__find_nselement_class;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":101
 *         self._lookup_function = _find_nselement_class
 * 
 *     def get_namespace(self, ns_uri):             # <<<<<<<<<<<<<< 
 *         """Retrieve the namespace object associated with the given URI. Creates a
 *         new one if it does not yet exist."""
 */

static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_ns_uri); /*proto*/
static char __pyx_doc_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace[] = "Retrieve the namespace object associated with the given URI. Creates a\n        new one if it does not yet exist.";
static PyObject *__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace(PyObject *__pyx_v_self, PyObject *__pyx_v_ns_uri) {
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_registry;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_ns_uri);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_registry = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":104
 *         """Retrieve the namespace object associated with the given URI. Creates a
 *         new one if it does not yet exist."""
 *         if ns_uri:             # <<<<<<<<<<<<<< 
 *             ns_utf = _utf8(ns_uri)
 *         else:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":105
 *         new one if it does not yet exist."""
 *         if ns_uri:
 *             ns_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<< 
 *         else:
 *             ns_utf = None
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 105; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":107
 *             ns_utf = _utf8(ns_uri)
 *         else:
 *             ns_utf = None             # <<<<<<<<<<<<<< 
 *         try:
 *             return self._namespace_registries[ns_utf]
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = Py_None;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":108
 *         else:
 *             ns_utf = None
 *         try:             # <<<<<<<<<<<<<< 
 *             return self._namespace_registries[ns_utf]
 *         except KeyError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":109
 *             ns_utf = None
 *         try:
 *             return self._namespace_registries[ns_utf]             # <<<<<<<<<<<<<< 
 *         except KeyError:
 *             registry = self._namespace_registries[ns_utf] = \
 */
  __pyx_2 = PyObject_GetItem(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries, __pyx_v_ns_utf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 109; goto __pyx_L3;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":110
 *         try:
 *             return self._namespace_registries[ns_utf]
 *         except KeyError:             # <<<<<<<<<<<<<< 
 *             registry = self._namespace_registries[ns_utf] = \
 *                        _ClassNamespaceRegistry(ns_uri)
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.get_namespace");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 110; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":112
 *         except KeyError:
 *             registry = self._namespace_registries[ns_utf] = \
 *                        _ClassNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<< 
 *             return registry
 * 
 */
  __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_uri);
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_ns_uri);
  __pyx_7 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry), __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_INCREF(__pyx_7);
  Py_DECREF(__pyx_v_registry);
  __pyx_v_registry = __pyx_7;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":111
 *             return self._namespace_registries[ns_utf]
 *         except KeyError:
 *             registry = self._namespace_registries[ns_utf] = \             # <<<<<<<<<<<<<< 
 *                        _ClassNamespaceRegistry(ns_uri)
 *             return registry
 */
  if (PyObject_SetItem(((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->_namespace_registries, __pyx_v_ns_utf, __pyx_7) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_7); __pyx_7 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":113
 *             registry = self._namespace_registries[ns_utf] = \
 *                        _ClassNamespaceRegistry(ns_uri)
 *             return registry             # <<<<<<<<<<<<<< 
 * 
 * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):
 */
  Py_INCREF(__pyx_v_registry);
  __pyx_r = __pyx_v_registry;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L4;
}
goto __pyx_L1;
__pyx_L4:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.ElementNamespaceClassLookup.get_namespace");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_registry);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":115
 *             return registry
 * 
 * cdef object _find_nselement_class(state, _Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef python.PyObject* dict_result
 *     cdef ElementNamespaceClassLookup lookup
 */

static  PyObject *__pyx_f_4lxml_5etree__find_nselement_class(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_v_dict_result;
struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *__pyx_v_lookup;
struct __pyx_obj_4lxml_5etree__NamespaceRegistry *__pyx_v_registry;
char *__pyx_v_c_namespace_utf;
PyObject *__pyx_v_classes;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_classes = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":120
 *     cdef _NamespaceRegistry registry
 *     cdef char* c_namespace_utf
 *     if state is None:             # <<<<<<<<<<<<<< 
 *         return _lookupDefaultElementClass(None, doc, c_node)
 * 
 */
__pyx_1 = (__pyx_v_state == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":121
 *     cdef char* c_namespace_utf
 *     if state is None:
 *         return _lookupDefaultElementClass(None, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     lookup = <ElementNamespaceClassLookup>state
 */
  __pyx_2 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(Py_None,__pyx_v_doc,__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":123
 *         return _lookupDefaultElementClass(None, doc, c_node)
 * 
 *     lookup = <ElementNamespaceClassLookup>state             # <<<<<<<<<<<<<< 
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 *         return lookup._callFallback(doc, c_node)
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":124
 * 
 *     lookup = <ElementNamespaceClassLookup>state
 *     if c_node.type != tree.XML_ELEMENT_NODE:             # <<<<<<<<<<<<<< 
 *         return lookup._callFallback(doc, c_node)
 * 
 */
__pyx_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":125
 *     lookup = <ElementNamespaceClassLookup>state
 *     if c_node.type != tree.XML_ELEMENT_NODE:
 *         return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     c_namespace_utf = _getNs(c_node)
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_lookup->__pyx_base.__pyx_vtab)->__pyx_base._callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 125; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":127
 *         return lookup._callFallback(doc, c_node)
 * 
 *     c_namespace_utf = _getNs(c_node)             # <<<<<<<<<<<<<< 
 *     if c_namespace_utf is not NULL:
 *         dict_result = python.PyDict_GetItemString(
 */
__pyx_v_c_namespace_utf = _getNs(__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":128
 * 
 *     c_namespace_utf = _getNs(c_node)
 *     if c_namespace_utf is not NULL:             # <<<<<<<<<<<<<< 
 *         dict_result = python.PyDict_GetItemString(
 *             lookup._namespace_registries, c_namespace_utf)
 */
__pyx_1 = (__pyx_v_c_namespace_utf != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":130
 *     if c_namespace_utf is not NULL:
 *         dict_result = python.PyDict_GetItemString(
 *             lookup._namespace_registries, c_namespace_utf)             # <<<<<<<<<<<<<< 
 *     else:
 *         dict_result = python.PyDict_GetItem(
 */
  __pyx_v_dict_result = PyDict_GetItemString(__pyx_v_lookup->_namespace_registries,__pyx_v_c_namespace_utf);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":133
 *     else:
 *         dict_result = python.PyDict_GetItem(
 *             lookup._namespace_registries, None)             # <<<<<<<<<<<<<< 
 *     if dict_result is not NULL:
 *         registry = <_NamespaceRegistry>dict_result
 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_namespace_registries,Py_None);
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":134
 *         dict_result = python.PyDict_GetItem(
 *             lookup._namespace_registries, None)
 *     if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *         registry = <_NamespaceRegistry>dict_result
 *         classes = registry._entries
 */
__pyx_1 = (__pyx_v_dict_result != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":135
 *             lookup._namespace_registries, None)
 *     if dict_result is not NULL:
 *         registry = <_NamespaceRegistry>dict_result             # <<<<<<<<<<<<<< 
 *         classes = registry._entries
 * 
 */
  __pyx_2 = (PyObject *)__pyx_v_dict_result;
  Py_INCREF(__pyx_2);
  Py_DECREF(((PyObject *)__pyx_v_registry));
  __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":136
 *     if dict_result is not NULL:
 *         registry = <_NamespaceRegistry>dict_result
 *         classes = registry._entries             # <<<<<<<<<<<<<< 
 * 
 *         if c_node.name is not NULL:
 */
  Py_INCREF(__pyx_v_registry->_entries);
  Py_DECREF(__pyx_v_classes);
  __pyx_v_classes = __pyx_v_registry->_entries;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":138
 *         classes = registry._entries
 * 
 *         if c_node.name is not NULL:             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItemString(
 *                 classes, c_node.name)
 */
  __pyx_1 = (__pyx_v_c_node->name != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":140
 *         if c_node.name is not NULL:
 *             dict_result = python.PyDict_GetItemString(
 *                 classes, c_node.name)             # <<<<<<<<<<<<<< 
 *         else:
 *             dict_result = NULL
 */
    __pyx_v_dict_result = PyDict_GetItemString(__pyx_v_classes,__pyx_v_c_node->name);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":142
 *                 classes, c_node.name)
 *         else:
 *             dict_result = NULL             # <<<<<<<<<<<<<< 
 * 
 *         if dict_result is NULL:
 */
    __pyx_v_dict_result = NULL;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":144
 *             dict_result = NULL
 * 
 *         if dict_result is NULL:             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(classes, None)
 * 
 */
  __pyx_1 = (__pyx_v_dict_result == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":145
 * 
 *         if dict_result is NULL:
 *             dict_result = python.PyDict_GetItem(classes, None)             # <<<<<<<<<<<<<< 
 * 
 *         if dict_result is not NULL:
 */
    __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes,Py_None);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":147
 *             dict_result = python.PyDict_GetItem(classes, None)
 * 
 *         if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *             return <object>dict_result
 *     return lookup._callFallback(doc, c_node)
 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":148
 * 
 *         if dict_result is not NULL:
 *             return <object>dict_result             # <<<<<<<<<<<<<< 
 *     return lookup._callFallback(doc, c_node)
 * 
 */
    __pyx_2 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_2);
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L8;
  }
  __pyx_L8:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":149
 *         if dict_result is not NULL:
 *             return <object>dict_result
 *     return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup *)__pyx_v_lookup->__pyx_base.__pyx_vtab)->__pyx_base._callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_lookup),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._find_nselement_class");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_classes);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":158
 * __FUNCTION_NAMESPACE_REGISTRIES = {}
 * 
 * def FunctionNamespace(ns_uri):             # <<<<<<<<<<<<<< 
 *     """Retrieve the function namespace object associated with the given
 *     URI. Creates a new one if it does not yet exist. A function namespace can
 */

static PyObject *__pyx_pf_4lxml_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri); /*proto*/
static char __pyx_doc_4lxml_5etree_FunctionNamespace[] = "Retrieve the function namespace object associated with the given\n    URI. Creates a new one if it does not yet exist. A function namespace can\n    only be used to register extension functions.";
static PyObject *__pyx_pf_4lxml_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_v_ns_uri) {
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_registry;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
Py_INCREF(__pyx_v_ns_uri);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_registry = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":162
 *     URI. Creates a new one if it does not yet exist. A function namespace can
 *     only be used to register extension functions."""
 *     if ns_uri:             # <<<<<<<<<<<<<< 
 *         ns_utf = _utf8(ns_uri)
 *     else:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 162; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":163
 *     only be used to register extension functions."""
 *     if ns_uri:
 *         ns_utf = _utf8(ns_uri)             # <<<<<<<<<<<<<< 
 *     else:
 *         ns_utf = None
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_ns_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":165
 *         ns_utf = _utf8(ns_uri)
 *     else:
 *         ns_utf = None             # <<<<<<<<<<<<<< 
 *     try:
 *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = Py_None;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":166
 *     else:
 *         ns_utf = None
 *     try:             # <<<<<<<<<<<<<< 
 *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
 *     except KeyError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":167
 *         ns_utf = None
 *     try:
 *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]             # <<<<<<<<<<<<<< 
 *     except KeyError:
 *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
 */
  __pyx_2 = PyObject_GetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 167; goto __pyx_L3;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":168
 *     try:
 *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
 *     except KeyError:             # <<<<<<<<<<<<<< 
 *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
 *                    _XPathFunctionNamespaceRegistry(ns_uri)
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_KeyError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.FunctionNamespace");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 168; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":170
 *     except KeyError:
 *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
 *                    _XPathFunctionNamespaceRegistry(ns_uri)             # <<<<<<<<<<<<<< 
 *         return registry
 * 
 */
  __pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_uri);
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_ns_uri);
  __pyx_7 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry), __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 170; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_INCREF(__pyx_7);
  Py_DECREF(__pyx_v_registry);
  __pyx_v_registry = __pyx_7;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":169
 *         return __FUNCTION_NAMESPACE_REGISTRIES[ns_utf]
 *     except KeyError:
 *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \             # <<<<<<<<<<<<<< 
 *                    _XPathFunctionNamespaceRegistry(ns_uri)
 *         return registry
 */
  if (PyObject_SetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf, __pyx_7) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 169; goto __pyx_L1;}
  Py_DECREF(__pyx_7); __pyx_7 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":171
 *         registry = __FUNCTION_NAMESPACE_REGISTRIES[ns_utf] = \
 *                    _XPathFunctionNamespaceRegistry(ns_uri)
 *         return registry             # <<<<<<<<<<<<<< 
 * 
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
 */
  Py_INCREF(__pyx_v_registry);
  __pyx_r = __pyx_v_registry;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L4;
}
goto __pyx_L1;
__pyx_L4:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.FunctionNamespace");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":174
 * 
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
 *     def __setitem__(self, name, item):             # <<<<<<<<<<<<<< 
 *         if not callable(item):
 *             raise NamespaceRegistryError, \
 */

static PyObject *__pyx_k489p;
static PyObject *__pyx_k490p;

static char __pyx_k489[] = "Registered functions must be callable.";
static char __pyx_k490[] = "extensions must have non empty names";

static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
static int __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_item);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":175
 * cdef class _FunctionNamespaceRegistry(_NamespaceRegistry):
 *     def __setitem__(self, name, item):
 *         if not callable(item):             # <<<<<<<<<<<<<< 
 *             raise NamespaceRegistryError, \
 *                   "Registered functions must be callable."
 */
__pyx_1 = (!callable(__pyx_v_item));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":176
 *     def __setitem__(self, name, item):
 *         if not callable(item):
 *             raise NamespaceRegistryError, \             # <<<<<<<<<<<<<< 
 *                   "Registered functions must be callable."
 *         if not name:
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_NamespaceRegistryError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 176; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":177
 *         if not callable(item):
 *             raise NamespaceRegistryError, \
 *                   "Registered functions must be callable."             # <<<<<<<<<<<<<< 
 *         if not name:
 *             raise ValueError, \
 */
  __Pyx_Raise(__pyx_2, __pyx_k489p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 176; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":178
 *             raise NamespaceRegistryError, \
 *                   "Registered functions must be callable."
 *         if not name:             # <<<<<<<<<<<<<< 
 *             raise ValueError, \
 *                   "extensions must have non empty names"
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_name); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 178; goto __pyx_L1;}
__pyx_3 = (!__pyx_1);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":180
 *         if not name:
 *             raise ValueError, \
 *                   "extensions must have non empty names"             # <<<<<<<<<<<<<< 
 *         self._entries[_utf8(name)] = item
 * 
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k490p, 0);
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":181
 *             raise ValueError, \
 *                   "extensions must have non empty names"
 *         self._entries[_utf8(name)] = item             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; goto __pyx_L1;}
if (PyObject_SetItem(((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries, __pyx_2, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 181; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._FunctionNamespaceRegistry.__setitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_item);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":183
 *         self._entries[_utf8(name)] = item
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return "FunctionNamespace(%r)" % self._ns_uri
 * 
 */

static PyObject *__pyx_k491p;

static char __pyx_k491[] = "FunctionNamespace(%r)";

static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":184
 * 
 *     def __repr__(self):
 *         return "FunctionNamespace(%r)" % self._ns_uri             # <<<<<<<<<<<<<< 
 * 
 * cdef class _XPathFunctionNamespaceRegistry(_FunctionNamespaceRegistry):
 */
__pyx_1 = PyNumber_Remainder(__pyx_k491p, ((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 184; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._FunctionNamespaceRegistry.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":192
 *     property prefix:
 *         "Namespace prefix for extension functions."
 *         def __del__(self):             # <<<<<<<<<<<<<< 
 *             self._prefix = None # no prefix configured
 *             self._prefix_utf = None
 */

static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(PyObject *__pyx_v_self) {
int __pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":193
 *         "Namespace prefix for extension functions."
 *         def __del__(self):
 *             self._prefix = None # no prefix configured             # <<<<<<<<<<<<<< 
 *             self._prefix_utf = None
 *         def __get__(self):
 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":194
 *         def __del__(self):
 *             self._prefix = None # no prefix configured
 *             self._prefix_utf = None             # <<<<<<<<<<<<<< 
 *         def __get__(self):
 *             if self._prefix is None:
 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = Py_None;

__pyx_r = 0;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":195
 *             self._prefix = None # no prefix configured
 *             self._prefix_utf = None
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._prefix is None:
 *                 return ''
 */

static PyObject *__pyx_k492p;

static char __pyx_k492[] = "";

static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":196
 *             self._prefix_utf = None
 *         def __get__(self):
 *             if self._prefix is None:             # <<<<<<<<<<<<<< 
 *                 return ''
 *             else:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":197
 *         def __get__(self):
 *             if self._prefix is None:
 *                 return ''             # <<<<<<<<<<<<<< 
 *             else:
 *                 return self._prefix
 */
  Py_INCREF(__pyx_k492p);
  __pyx_r = __pyx_k492p;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":199
 *                 return ''
 *             else:
 *                 return self._prefix             # <<<<<<<<<<<<<< 
 *         def __set__(self, prefix):
 *             if prefix == '':
 */
  Py_INCREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
  __pyx_r = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":200
 *             else:
 *                 return self._prefix
 *         def __set__(self, prefix):             # <<<<<<<<<<<<<< 
 *             if prefix == '':
 *                 prefix = None # empty prefix
 */

static PyObject *__pyx_k493p;

static char __pyx_k493[] = "";

static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/
static int __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_prefix);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":201
 *                 return self._prefix
 *         def __set__(self, prefix):
 *             if prefix == '':             # <<<<<<<<<<<<<< 
 *                 prefix = None # empty prefix
 *             if prefix is None:
 */
__pyx_1 = PyObject_RichCompare(__pyx_v_prefix, __pyx_k493p, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 201; goto __pyx_L1;}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 201; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":202
 *         def __set__(self, prefix):
 *             if prefix == '':
 *                 prefix = None # empty prefix             # <<<<<<<<<<<<<< 
 *             if prefix is None:
 *                 self._prefix_utf = None
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_prefix);
  __pyx_v_prefix = Py_None;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":203
 *             if prefix == '':
 *                 prefix = None # empty prefix
 *             if prefix is None:             # <<<<<<<<<<<<<< 
 *                 self._prefix_utf = None
 *             else:
 */
__pyx_2 = (__pyx_v_prefix == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":204
 *                 prefix = None # empty prefix
 *             if prefix is None:
 *                 self._prefix_utf = None             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._prefix_utf = _utf8(prefix)
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
  ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = Py_None;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":206
 *                 self._prefix_utf = None
 *             else:
 *                 self._prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<< 
 *             self._prefix = prefix
 * 
 */
  __pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_prefix); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 206; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":206
 *                 self._prefix_utf = None
 *             else:
 *                 self._prefix_utf = _utf8(prefix)             # <<<<<<<<<<<<<< 
 *             self._prefix = prefix
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
  ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":207
 *             else:
 *                 self._prefix_utf = _utf8(prefix)
 *             self._prefix = prefix             # <<<<<<<<<<<<<< 
 * 
 * cdef object _find_all_extension_prefixes():
 */
Py_INCREF(__pyx_v_prefix);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = __pyx_v_prefix;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathFunctionNamespaceRegistry.prefix.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":209
 *             self._prefix = prefix
 * 
 * cdef object _find_all_extension_prefixes():             # <<<<<<<<<<<<<< 
 *     "Internal lookup function to find all function prefixes for XSLT/XPath."
 *     cdef _XPathFunctionNamespaceRegistry registry
 */

static  PyObject *__pyx_f_4lxml_5etree__find_all_extension_prefixes(void) {
struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *__pyx_v_registry;
PyObject *__pyx_v_ns_prefixes;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
__pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_ns_prefixes = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":212
 *     "Internal lookup function to find all function prefixes for XSLT/XPath."
 *     cdef _XPathFunctionNamespaceRegistry registry
 *     ns_prefixes = []             # <<<<<<<<<<<<<< 
 *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
 *         if registry._prefix_utf is not None:
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 212; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_prefixes);
__pyx_v_ns_prefixes = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":213
 *     cdef _XPathFunctionNamespaceRegistry registry
 *     ns_prefixes = []
 *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():             # <<<<<<<<<<<<<< 
 *         if registry._prefix_utf is not None:
 *             if registry._ns_uri_utf is not None:
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_n_itervalues); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_2 = 0; __pyx_1 = __pyx_3; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":213
 *     cdef _XPathFunctionNamespaceRegistry registry
 *     ns_prefixes = []
 *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():             # <<<<<<<<<<<<<< 
 *         if registry._prefix_utf is not None:
 *             if registry._ns_uri_utf is not None:
 */
  if (PyList_CheckExact(__pyx_1)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_3 = PyList_GET_ITEM(__pyx_1, __pyx_2++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      break;
    }
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 213; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_registry));
  __pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":214
 *     ns_prefixes = []
 *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
 *         if registry._prefix_utf is not None:             # <<<<<<<<<<<<<< 
 *             if registry._ns_uri_utf is not None:
 *                 python.PyList_Append(
 */
  __pyx_4 = (__pyx_v_registry->_prefix_utf != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":215
 *     for registry in __FUNCTION_NAMESPACE_REGISTRIES.itervalues():
 *         if registry._prefix_utf is not None:
 *             if registry._ns_uri_utf is not None:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(
 *                     ns_prefixes, (registry._prefix_utf, registry._ns_uri_utf))
 */
    __pyx_4 = (__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf != Py_None);
    if (__pyx_4) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":217
 *             if registry._ns_uri_utf is not None:
 *                 python.PyList_Append(
 *                     ns_prefixes, (registry._prefix_utf, registry._ns_uri_utf))             # <<<<<<<<<<<<<< 
 *     return ns_prefixes
 * 
 */
      __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 217; goto __pyx_L1;}
      Py_INCREF(__pyx_v_registry->_prefix_utf);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_registry->_prefix_utf);
      Py_INCREF(__pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
      PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_registry->__pyx_base.__pyx_base._ns_uri_utf);
      __pyx_5 = PyList_Append(__pyx_v_ns_prefixes,__pyx_3); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 216; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":218
 *                 python.PyList_Append(
 *                     ns_prefixes, (registry._prefix_utf, registry._ns_uri_utf))
 *     return ns_prefixes             # <<<<<<<<<<<<<< 
 * 
 * cdef object _iter_ns_extension_functions():
 */
Py_INCREF(__pyx_v_ns_prefixes);
__pyx_r = __pyx_v_ns_prefixes;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._find_all_extension_prefixes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_registry);
Py_DECREF(__pyx_v_ns_prefixes);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":220
 *     return ns_prefixes
 * 
 * cdef object _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *     return __FUNCTION_NAMESPACE_REGISTRIES.iteritems()
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree__iter_ns_extension_functions(void) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":221
 * 
 * cdef object _iter_ns_extension_functions():
 *     return __FUNCTION_NAMESPACE_REGISTRIES.iteritems()             # <<<<<<<<<<<<<< 
 * 
 * cdef object _find_extension(ns_uri_utf, name_utf):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_n_iteritems); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 221; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._iter_ns_extension_functions");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":223
 *     return __FUNCTION_NAMESPACE_REGISTRIES.iteritems()
 * 
 * cdef object _find_extension(ns_uri_utf, name_utf):             # <<<<<<<<<<<<<< 
 *     cdef python.PyObject* dict_result
 *     dict_result = python.PyDict_GetItem(
 */

static  PyObject *__pyx_f_4lxml_5etree__find_extension(PyObject *__pyx_v_ns_uri_utf,PyObject *__pyx_v_name_utf) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_extensions;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_ns_uri_utf);
Py_INCREF(__pyx_v_name_utf);
__pyx_v_extensions = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":226
 *     cdef python.PyObject* dict_result
 *     dict_result = python.PyDict_GetItem(
 *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)             # <<<<<<<<<<<<<< 
 *     if dict_result is NULL:
 *         return None
 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES,__pyx_v_ns_uri_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":227
 *     dict_result = python.PyDict_GetItem(
 *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)
 *     if dict_result is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     extensions = (<_NamespaceRegistry>dict_result)._entries
 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":228
 *         __FUNCTION_NAMESPACE_REGISTRIES, ns_uri_utf)
 *     if dict_result is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     extensions = (<_NamespaceRegistry>dict_result)._entries
 *     dict_result = python.PyDict_GetItem(extensions, name_utf)
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":229
 *     if dict_result is NULL:
 *         return None
 *     extensions = (<_NamespaceRegistry>dict_result)._entries             # <<<<<<<<<<<<<< 
 *     dict_result = python.PyDict_GetItem(extensions, name_utf)
 *     if dict_result is NULL:
 */
__pyx_2 = (PyObject *)__pyx_v_dict_result;
Py_INCREF(__pyx_2);
Py_INCREF(((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_2)->_entries);
Py_DECREF(__pyx_v_extensions);
__pyx_v_extensions = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)__pyx_2)->_entries;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":230
 *         return None
 *     extensions = (<_NamespaceRegistry>dict_result)._entries
 *     dict_result = python.PyDict_GetItem(extensions, name_utf)             # <<<<<<<<<<<<<< 
 *     if dict_result is NULL:
 *         return None
 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_extensions,__pyx_v_name_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":231
 *     extensions = (<_NamespaceRegistry>dict_result)._entries
 *     dict_result = python.PyDict_GetItem(extensions, name_utf)
 *     if dict_result is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     else:
 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":232
 *     dict_result = python.PyDict_GetItem(extensions, name_utf)
 *     if dict_result is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     else:
 *         return <object>dict_result
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":234
 *         return None
 *     else:
 *         return <object>dict_result             # <<<<<<<<<<<<<< 
 */
  __pyx_2 = (PyObject *)__pyx_v_dict_result;
  Py_INCREF(__pyx_2);
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_name_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":17
 * cdef class Resolver:
 *     "This is the base class of all resolvers."
 *     def resolve(self, system_url, public_id, context):             # <<<<<<<<<<<<<< 
 *         """Override this method to resolve an external source by
 *         ``system_url`` and ``public_id``.  The third argument is an
 */

static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8Resolver_resolve[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_system_url = 0;
PyObject *__pyx_v_public_id = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"system_url","public_id","context",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_system_url, &__pyx_v_public_id, &__pyx_v_context))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_system_url);
Py_INCREF(__pyx_v_public_id);
Py_INCREF(__pyx_v_context);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":24
 *         Return the result of one of the ``resolve_*()`` methods.
 *         """
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     def resolve_empty(self, context):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":26
 *         return None
 * 
 *     def resolve_empty(self, context):             # <<<<<<<<<<<<<< 
 *         """Return an empty input document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_v_context); /*proto*/
static char __pyx_doc_4lxml_5etree_8Resolver_resolve_empty[] = "Return an empty input document.\n\n        Pass context as parameter.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_v_context) {
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":32
 *         """
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<< 
 *         doc_ref._type = PARSER_DATA_EMPTY
 *         return doc_ref
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":33
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_EMPTY             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
__pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":34
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_EMPTY
 *         return doc_ref             # <<<<<<<<<<<<<< 
 * 
 *     def resolve_string(self, string, context, *, base_url=None):
 */
Py_INCREF(((PyObject *)__pyx_v_doc_ref));
__pyx_r = ((PyObject *)__pyx_v_doc_ref);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.Resolver.resolve_empty");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":36
 *         return doc_ref
 * 
 *     def resolve_string(self, string, context, *, base_url=None):             # <<<<<<<<<<<<<< 
 *         """Return a parsable string as input document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8Resolver_resolve_string[] = "Return a parsable string as input document.\n\n        Pass data string and context as parameters.\n\n        You can pass the source URL as \'base_url\' keyword.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_string = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_base_url = 0;
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"string","context","base_url",0};
__pyx_v_base_url = __pyx_k161;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_string, &__pyx_v_context, &__pyx_v_base_url))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_string);
Py_INCREF(__pyx_v_context);
Py_INCREF(__pyx_v_base_url);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":44
 *         """
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<< 
 *         doc_ref._type = PARSER_DATA_STRING
 *         doc_ref._data_bytes = _utf8(string)
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 44; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":45
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_STRING             # <<<<<<<<<<<<<< 
 *         doc_ref._data_bytes = _utf8(string)
 *         if base_url is not None:
 */
__pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_STRING;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":46
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_STRING
 *         doc_ref._data_bytes = _utf8(string)             # <<<<<<<<<<<<<< 
 *         if base_url is not None:
 *             doc_ref._filename = _encodeFilename(base_url)
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_string); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 46; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":46
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_STRING
 *         doc_ref._data_bytes = _utf8(string)             # <<<<<<<<<<<<<< 
 *         if base_url is not None:
 *             doc_ref._filename = _encodeFilename(base_url)
 */
Py_DECREF(__pyx_v_doc_ref->_data_bytes);
__pyx_v_doc_ref->_data_bytes = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":47
 *         doc_ref._type = PARSER_DATA_STRING
 *         doc_ref._data_bytes = _utf8(string)
 *         if base_url is not None:             # <<<<<<<<<<<<<< 
 *             doc_ref._filename = _encodeFilename(base_url)
 *         return doc_ref
 */
__pyx_2 = (__pyx_v_base_url != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":48
 *         doc_ref._data_bytes = _utf8(string)
 *         if base_url is not None:
 *             doc_ref._filename = _encodeFilename(base_url)             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
  __pyx_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_base_url); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 48; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":48
 *         doc_ref._data_bytes = _utf8(string)
 *         if base_url is not None:
 *             doc_ref._filename = _encodeFilename(base_url)             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
  Py_DECREF(__pyx_v_doc_ref->_filename);
  __pyx_v_doc_ref->_filename = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":49
 *         if base_url is not None:
 *             doc_ref._filename = _encodeFilename(base_url)
 *         return doc_ref             # <<<<<<<<<<<<<< 
 * 
 *     def resolve_filename(self, filename, context):
 */
Py_INCREF(((PyObject *)__pyx_v_doc_ref));
__pyx_r = ((PyObject *)__pyx_v_doc_ref);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.Resolver.resolve_string");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_string);
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_base_url);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":51
 *         return doc_ref
 * 
 *     def resolve_filename(self, filename, context):             # <<<<<<<<<<<<<< 
 *         """Return the name of a parsable file as input document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_filename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8Resolver_resolve_filename[] = "Return the name of a parsable file as input document.\n\n        Pass filename and context as parameters.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_filename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filename = 0;
PyObject *__pyx_v_context = 0;
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"filename","context",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_filename, &__pyx_v_context))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filename);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":57
 *         """
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<< 
 *         doc_ref._type = PARSER_DATA_FILENAME
 *         doc_ref._filename = _encodeFilename(filename)
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 57; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":58
 *         cdef _InputDocument doc_ref
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILENAME             # <<<<<<<<<<<<<< 
 *         doc_ref._filename = _encodeFilename(filename)
 *         return doc_ref
 */
__pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":59
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILENAME
 *         doc_ref._filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
__pyx_1 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":59
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILENAME
 *         doc_ref._filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
Py_DECREF(__pyx_v_doc_ref->_filename);
__pyx_v_doc_ref->_filename = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":60
 *         doc_ref._type = PARSER_DATA_FILENAME
 *         doc_ref._filename = _encodeFilename(filename)
 *         return doc_ref             # <<<<<<<<<<<<<< 
 * 
 *     def resolve_file(self, f, context):
 */
Py_INCREF(((PyObject *)__pyx_v_doc_ref));
__pyx_r = ((PyObject *)__pyx_v_doc_ref);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.Resolver.resolve_filename");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_filename);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":62
 *         return doc_ref
 * 
 *     def resolve_file(self, f, context):             # <<<<<<<<<<<<<< 
 *         """Return an open file-like object as input document.
 * 
 */

static PyObject *__pyx_n_read;

static PyObject *__pyx_k494p;

static char __pyx_k494[] = "Argument is not a file-like object";

static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_8Resolver_resolve_file[] = "Return an open file-like object as input document.\n\n        Pass open file and context as parameters.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_8Resolver_resolve_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_f = 0;
PyObject *__pyx_v_context = 0;
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"f","context",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_context))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":68
 *         """
 *         cdef _InputDocument doc_ref
 *         try:             # <<<<<<<<<<<<<< 
 *             f.read
 *         except AttributeError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":69
 *         cdef _InputDocument doc_ref
 *         try:
 *             f.read             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             raise TypeError, "Argument is not a file-like object"
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_f, __pyx_n_read); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 69; goto __pyx_L2;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":70
 *         try:
 *             f.read
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             raise TypeError, "Argument is not a file-like object"
 *         doc_ref = _InputDocument()
 */
__pyx_2 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_2) {
  __Pyx_AddTraceback("lxml.etree.resolve_file");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 70; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":71
 *             f.read
 *         except AttributeError:
 *             raise TypeError, "Argument is not a file-like object"             # <<<<<<<<<<<<<< 
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILE
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k494p, 0);
  {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
goto __pyx_L1;
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":72
 *         except AttributeError:
 *             raise TypeError, "Argument is not a file-like object"
 *         doc_ref = _InputDocument()             # <<<<<<<<<<<<<< 
 *         doc_ref._type = PARSER_DATA_FILE
 *         doc_ref._filename = _getFilenameForFile(f)
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__InputDocument), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 72; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":73
 *             raise TypeError, "Argument is not a file-like object"
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILE             # <<<<<<<<<<<<<< 
 *         doc_ref._filename = _getFilenameForFile(f)
 *         doc_ref._file = f
 */
__pyx_v_doc_ref->_type = __pyx_e_4lxml_5etree_PARSER_DATA_FILE;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":74
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILE
 *         doc_ref._filename = _getFilenameForFile(f)             # <<<<<<<<<<<<<< 
 *         doc_ref._file = f
 *         return doc_ref
 */
__pyx_3 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_f); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 74; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":74
 *         doc_ref = _InputDocument()
 *         doc_ref._type = PARSER_DATA_FILE
 *         doc_ref._filename = _getFilenameForFile(f)             # <<<<<<<<<<<<<< 
 *         doc_ref._file = f
 *         return doc_ref
 */
Py_DECREF(__pyx_v_doc_ref->_filename);
__pyx_v_doc_ref->_filename = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":75
 *         doc_ref._type = PARSER_DATA_FILE
 *         doc_ref._filename = _getFilenameForFile(f)
 *         doc_ref._file = f             # <<<<<<<<<<<<<< 
 *         return doc_ref
 * 
 */
Py_INCREF(__pyx_v_f);
Py_DECREF(__pyx_v_doc_ref->_file);
__pyx_v_doc_ref->_file = __pyx_v_f;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":76
 *         doc_ref._filename = _getFilenameForFile(f)
 *         doc_ref._file = f
 *         return doc_ref             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ResolverRegistry:
 */
Py_INCREF(((PyObject *)__pyx_v_doc_ref));
__pyx_r = ((PyObject *)__pyx_v_doc_ref);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.Resolver.resolve_file");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_f);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":81
 *     cdef object _resolvers
 *     cdef Resolver _default_resolver
 *     def __init__(self, Resolver default_resolver=None):             # <<<<<<<<<<<<<< 
 *         self._resolvers = set()
 *         self._default_resolver = default_resolver
 */

static int __pyx_pf_4lxml_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_4lxml_5etree_Resolver *__pyx_v_default_resolver = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"default_resolver",0};
__pyx_v_default_resolver = __pyx_k162;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_default_resolver))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_default_resolver);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_default_resolver), __pyx_ptype_4lxml_5etree_Resolver, 1, "default_resolver"))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 81; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":82
 *     cdef Resolver _default_resolver
 *     def __init__(self, Resolver default_resolver=None):
 *         self._resolvers = set()             # <<<<<<<<<<<<<< 
 *         self._default_resolver = default_resolver
 * 
 */
__pyx_1 = PyObject_CallObject(__pyx_v_4lxml_5etree_set, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 82; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":82
 *     cdef Resolver _default_resolver
 *     def __init__(self, Resolver default_resolver=None):
 *         self._resolvers = set()             # <<<<<<<<<<<<<< 
 *         self._default_resolver = default_resolver
 * 
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers);
((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":83
 *     def __init__(self, Resolver default_resolver=None):
 *         self._resolvers = set()
 *         self._default_resolver = default_resolver             # <<<<<<<<<<<<<< 
 * 
 *     def add(self, Resolver resolver not None):
 */
Py_INCREF(((PyObject *)__pyx_v_default_resolver));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver));
((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver = __pyx_v_default_resolver;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_default_resolver);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":85
 *         self._default_resolver = default_resolver
 * 
 *     def add(self, Resolver resolver not None):             # <<<<<<<<<<<<<< 
 *         """Register a resolver.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver); /*proto*/
static char __pyx_doc_4lxml_5etree_17_ResolverRegistry_add[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_resolver);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_resolver), __pyx_ptype_4lxml_5etree_Resolver, 0, "resolver"))) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 85; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":94
 *         until the first match is found.
 *         """
 *         self._resolvers.add(resolver)             # <<<<<<<<<<<<<< 
 * 
 *     def remove(self, resolver):
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_n_add); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":94
 *         until the first match is found.
 *         """
 *         self._resolvers.add(resolver)             # <<<<<<<<<<<<<< 
 * 
 *     def remove(self, resolver):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
Py_INCREF(__pyx_v_resolver);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_resolver);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.add");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_resolver);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":96
 *         self._resolvers.add(resolver)
 * 
 *     def remove(self, resolver):             # <<<<<<<<<<<<<< 
 *         self._resolvers.discard(resolver)
 * 
 */

static PyObject *__pyx_n_discard;

static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_v_resolver) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_resolver);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":97
 * 
 *     def remove(self, resolver):
 *         self._resolvers.discard(resolver)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ResolverRegistry _copy(self):
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_n_discard); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 97; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":97
 * 
 *     def remove(self, resolver):
 *         self._resolvers.discard(resolver)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ResolverRegistry _copy(self):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 97; goto __pyx_L1;}
Py_INCREF(__pyx_v_resolver);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_resolver);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.remove");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_resolver);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":99
 *         self._resolvers.discard(resolver)
 * 
 *     cdef _ResolverRegistry _copy(self):             # <<<<<<<<<<<<<< 
 *         cdef _ResolverRegistry registry
 *         registry = _ResolverRegistry(self._default_resolver)
 */

static  struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_f_4lxml_5etree_17_ResolverRegistry__copy(struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_registry;
struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":101
 *     cdef _ResolverRegistry _copy(self):
 *         cdef _ResolverRegistry registry
 *         registry = _ResolverRegistry(self._default_resolver)             # <<<<<<<<<<<<<< 
 *         registry._resolvers = self._resolvers.copy()
 *         return registry
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 101; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_self->_default_resolver));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_self->_default_resolver));
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_registry));
__pyx_v_registry = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":102
 *         cdef _ResolverRegistry registry
 *         registry = _ResolverRegistry(self._default_resolver)
 *         registry._resolvers = self._resolvers.copy()             # <<<<<<<<<<<<<< 
 *         return registry
 * 
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self->_resolvers, __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 102; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 102; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":102
 *         cdef _ResolverRegistry registry
 *         registry = _ResolverRegistry(self._default_resolver)
 *         registry._resolvers = self._resolvers.copy()             # <<<<<<<<<<<<<< 
 *         return registry
 * 
 */
Py_DECREF(__pyx_v_registry->_resolvers);
__pyx_v_registry->_resolvers = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":103
 *         registry = _ResolverRegistry(self._default_resolver)
 *         registry._resolvers = self._resolvers.copy()
 *         return registry             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_INCREF(((PyObject *)__pyx_v_registry));
__pyx_r = __pyx_v_registry;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":105
 *         return registry
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         return self._copy()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":106
 * 
 *     def copy(self):
 *         return self._copy()             # <<<<<<<<<<<<<< 
 * 
 *     def resolve(self, system_url, public_id, context):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 106; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":108
 *         return self._copy()
 * 
 *     def resolve(self, system_url, public_id, context):             # <<<<<<<<<<<<<< 
 *         for resolver in self._resolvers:
 *             result = resolver.resolve(system_url, public_id, context)
 */

static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_system_url = 0;
PyObject *__pyx_v_public_id = 0;
PyObject *__pyx_v_context = 0;
PyObject *__pyx_v_resolver;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
static char *__pyx_argnames[] = {"system_url","public_id","context",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_system_url, &__pyx_v_public_id, &__pyx_v_context))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_system_url);
Py_INCREF(__pyx_v_public_id);
Py_INCREF(__pyx_v_context);
__pyx_v_resolver = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":109
 * 
 *     def resolve(self, system_url, public_id, context):
 *         for resolver in self._resolvers:             # <<<<<<<<<<<<<< 
 *             result = resolver.resolve(system_url, public_id, context)
 *             if result is not None:
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers)) { __pyx_1 = 0; __pyx_2 = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 109; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":109
 * 
 *     def resolve(self, system_url, public_id, context):
 *         for resolver in self._resolvers:             # <<<<<<<<<<<<<< 
 *             result = resolver.resolve(system_url, public_id, context)
 *             if result is not None:
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  Py_DECREF(__pyx_v_resolver);
  __pyx_v_resolver = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":110
 *     def resolve(self, system_url, public_id, context):
 *         for resolver in self._resolvers:
 *             result = resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<< 
 *             if result is not None:
 *                 return result
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_resolver, __pyx_n_resolve); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 110; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":110
 *     def resolve(self, system_url, public_id, context):
 *         for resolver in self._resolvers:
 *             result = resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<< 
 *             if result is not None:
 *                 return result
 */
  __pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_INCREF(__pyx_v_system_url);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_system_url);
  Py_INCREF(__pyx_v_public_id);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_public_id);
  Py_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_context);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":111
 *         for resolver in self._resolvers:
 *             result = resolver.resolve(system_url, public_id, context)
 *             if result is not None:             # <<<<<<<<<<<<<< 
 *                 return result
 *         if self._default_resolver is None:
 */
  __pyx_6 = (__pyx_v_result != Py_None);
  if (__pyx_6) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":112
 *             result = resolver.resolve(system_url, public_id, context)
 *             if result is not None:
 *                 return result             # <<<<<<<<<<<<<< 
 *         if self._default_resolver is None:
 *             return None
 */
    Py_INCREF(__pyx_v_result);
    __pyx_r = __pyx_v_result;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":113
 *             if result is not None:
 *                 return result
 *         if self._default_resolver is None:             # <<<<<<<<<<<<<< 
 *             return None
 *         return self._default_resolver.resolve(system_url, public_id, context)
 */
__pyx_6 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver) == Py_None);
if (__pyx_6) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":114
 *                 return result
 *         if self._default_resolver is None:
 *             return None             # <<<<<<<<<<<<<< 
 *         return self._default_resolver.resolve(system_url, public_id, context)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":115
 *         if self._default_resolver is None:
 *             return None
 *         return self._default_resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_3 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver), __pyx_n_resolve); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 115; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":115
 *         if self._default_resolver is None:
 *             return None
 *         return self._default_resolver.resolve(system_url, public_id, context)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 115; goto __pyx_L1;}
Py_INCREF(__pyx_v_system_url);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_system_url);
Py_INCREF(__pyx_v_public_id);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_public_id);
Py_INCREF(__pyx_v_context);
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_context);
__pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 115; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_5;
__pyx_5 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.resolve");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_resolver);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_system_url);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":117
 *         return self._default_resolver.resolve(system_url, public_id, context)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return repr(self._resolvers)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":118
 * 
 *     def __repr__(self):
 *         return repr(self._resolvers)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _ResolverContext(_ExceptionContext):
 */
__pyx_1 = PyObject_Repr(((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 118; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ResolverRegistry.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":124
 *     cdef _TempStore _storage
 * 
 *     cdef void clear(self):             # <<<<<<<<<<<<<< 
 *         _ExceptionContext.clear(self)
 *         self._storage.clear()
 */

static  void __pyx_f_4lxml_5etree_16_ResolverContext_clear(struct __pyx_obj_4lxml_5etree__ResolverContext *__pyx_v_self) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":125
 * 
 *     cdef void clear(self):
 *         _ExceptionContext.clear(self)             # <<<<<<<<<<<<<< 
 *         self._storage.clear()
 * 
 */
__pyx_vtabptr_4lxml_5etree__ExceptionContext->clear(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":126
 *     cdef void clear(self):
 *         _ExceptionContext.clear(self)
 *         self._storage.clear()             # <<<<<<<<<<<<<< 
 * 
 * cdef _initResolverContext(_ResolverContext context,
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_storage->__pyx_vtab)->clear(__pyx_v_self->_storage); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 126; goto __pyx_L1;}

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree._ResolverContext.clear");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":128
 *         self._storage.clear()
 * 
 * cdef _initResolverContext(_ResolverContext context,             # <<<<<<<<<<<<<< 
 *                           _ResolverRegistry resolvers):
 *     if resolvers is None:
 */

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) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_context);
Py_INCREF(__pyx_v_resolvers);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":130
 * cdef _initResolverContext(_ResolverContext context,
 *                           _ResolverRegistry resolvers):
 *     if resolvers is None:             # <<<<<<<<<<<<<< 
 *         context._resolvers = _ResolverRegistry()
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_resolvers) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":131
 *                           _ResolverRegistry resolvers):
 *     if resolvers is None:
 *         context._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<< 
 *     else:
 *         context._resolvers = resolvers
 */
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 131; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":131
 *                           _ResolverRegistry resolvers):
 *     if resolvers is None:
 *         context._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<< 
 *     else:
 *         context._resolvers = resolvers
 */
  Py_DECREF(((PyObject *)__pyx_v_context->_resolvers));
  __pyx_v_context->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":133
 *         context._resolvers = _ResolverRegistry()
 *     else:
 *         context._resolvers = resolvers             # <<<<<<<<<<<<<< 
 *     context._storage = _TempStore()
 */
  Py_INCREF(((PyObject *)__pyx_v_resolvers));
  Py_DECREF(((PyObject *)__pyx_v_context->_resolvers));
  __pyx_v_context->_resolvers = __pyx_v_resolvers;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":134
 *     else:
 *         context._resolvers = resolvers
 *     context._storage = _TempStore()             # <<<<<<<<<<<<<< 
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__TempStore), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__TempStore)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 134; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":134
 *     else:
 *         context._resolvers = resolvers
 *     context._storage = _TempStore()             # <<<<<<<<<<<<<< 
 */
Py_DECREF(((PyObject *)__pyx_v_context->_storage));
__pyx_v_context->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_2);
__pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._initResolverContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_resolvers);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":16
 *     """Syntax error while parsing an XML document.
 *     """
 *     def __init__(self, message, code, line, column):             # <<<<<<<<<<<<<< 
 *         ParseError.__init__(self, message)        
 *         self.position = (line, column)
 */

static PyObject *__pyx_n_position;
static PyObject *__pyx_n_code;

static PyObject *__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4lxml_5etree_14XMLSyntaxError___init__ = {"__init__", (PyCFunction)__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pf_4lxml_5etree_14XMLSyntaxError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_message = 0;
PyObject *__pyx_v_code = 0;
PyObject *__pyx_v_line = 0;
PyObject *__pyx_v_column = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"self","message","code","line","column",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_self, &__pyx_v_message, &__pyx_v_code, &__pyx_v_line, &__pyx_v_column))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_message);
Py_INCREF(__pyx_v_code);
Py_INCREF(__pyx_v_line);
Py_INCREF(__pyx_v_column);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":17
 *     """
 *     def __init__(self, message, code, line, column):
 *         ParseError.__init__(self, message)             # <<<<<<<<<<<<<< 
 *         self.position = (line, column)
 *         self.code = code
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n___init__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":17
 *     """
 *     def __init__(self, message, code, line, column):
 *         ParseError.__init__(self, message)             # <<<<<<<<<<<<<< 
 *         self.position = (line, column)
 *         self.code = code
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_message);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_message);
__pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":18
 *     def __init__(self, message, code, line, column):
 *         ParseError.__init__(self, message)        
 *         self.position = (line, column)             # <<<<<<<<<<<<<< 
 *         self.code = code
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 18; goto __pyx_L1;}
Py_INCREF(__pyx_v_line);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_line);
Py_INCREF(__pyx_v_column);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_column);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":18
 *     def __init__(self, message, code, line, column):
 *         ParseError.__init__(self, message)        
 *         self.position = (line, column)             # <<<<<<<<<<<<<< 
 *         self.code = code
 * 
 */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_position, __pyx_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 18; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":19
 *         ParseError.__init__(self, message)        
 *         self.position = (line, column)
 *         self.code = code             # <<<<<<<<<<<<<< 
 * 
 * class ParserError(LxmlError):
 */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_code, __pyx_v_code) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 19; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XMLSyntaxError.__init__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_code);
Py_DECREF(__pyx_v_line);
Py_DECREF(__pyx_v_column);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":38
 *     cdef tree.xmlDict* _c_dict
 *     cdef _BaseParser _default_parser
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._c_dict is not NULL:
 *             xmlparser.xmlDictFree(self._c_dict)
 */

static void __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":39
 *     cdef _BaseParser _default_parser
 *     def __dealloc__(self):
 *         if self._c_dict is not NULL:             # <<<<<<<<<<<<<< 
 *             xmlparser.xmlDictFree(self._c_dict)
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_c_dict != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":40
 *     def __dealloc__(self):
 *         if self._c_dict is not NULL:
 *             xmlparser.xmlDictFree(self._c_dict)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void initMainParserContext(self):
 */
  xmlDictFree(((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self)->_c_dict);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":42
 *             xmlparser.xmlDictFree(self._c_dict)
 * 
 *     cdef void initMainParserContext(self):             # <<<<<<<<<<<<<< 
 *         """Put the global context into the thread dictionary of the main
 *         thread.  To be called once and only in the main thread."""
 */

static PyObject *__pyx_n__ParserDictionaryContext;


static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initMainParserContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
PyObject *__pyx_v_thread_dict;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":47
 *         cdef python.PyObject* thread_dict
 *         cdef python.PyObject* result
 *         thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<< 
 *         if thread_dict is not NULL:
 *             python.PyDict_SetItem(<object>thread_dict, "_ParserDictionaryContext", self)
 */
__pyx_v_thread_dict = PyThreadState_GetDict();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":48
 *         cdef python.PyObject* result
 *         thread_dict = python.PyThreadState_GetDict()
 *         if thread_dict is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(<object>thread_dict, "_ParserDictionaryContext", self)
 * 
 */
__pyx_1 = (__pyx_v_thread_dict != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":49
 *         thread_dict = python.PyThreadState_GetDict()
 *         if thread_dict is not NULL:
 *             python.PyDict_SetItem(<object>thread_dict, "_ParserDictionaryContext", self)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserDictionaryContext _findThreadParserContext(self):
 */
  __pyx_2 = (PyObject *)__pyx_v_thread_dict;
  Py_INCREF(__pyx_2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":49
 *         thread_dict = python.PyThreadState_GetDict()
 *         if thread_dict is not NULL:
 *             python.PyDict_SetItem(<object>thread_dict, "_ParserDictionaryContext", self)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserDictionaryContext _findThreadParserContext(self):
 */
  __pyx_3 = PyDict_SetItem(__pyx_2,__pyx_n__ParserDictionaryContext,((PyObject *)__pyx_v_self)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.initMainParserContext");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":51
 *             python.PyDict_SetItem(<object>thread_dict, "_ParserDictionaryContext", self)
 * 
 *     cdef _ParserDictionaryContext _findThreadParserContext(self):             # <<<<<<<<<<<<<< 
 *         "Find (or create) the _ParserDictionaryContext object for the current thread"
 *         cdef python.PyObject* thread_dict
 */


static  struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_f_4lxml_5etree_24_ParserDictionaryContext__findThreadParserContext(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
PyObject *__pyx_v_thread_dict;
PyObject *__pyx_v_result;
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
PyObject *__pyx_v_d;
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_d = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":56
 *         cdef python.PyObject* result
 *         cdef _ParserDictionaryContext context
 *         thread_dict = python.PyThreadState_GetDict()             # <<<<<<<<<<<<<< 
 *         if thread_dict is NULL:
 *             return self
 */
__pyx_v_thread_dict = PyThreadState_GetDict();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":57
 *         cdef _ParserDictionaryContext context
 *         thread_dict = python.PyThreadState_GetDict()
 *         if thread_dict is NULL:             # <<<<<<<<<<<<<< 
 *             return self
 *         d = <object>thread_dict
 */
__pyx_1 = (__pyx_v_thread_dict == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":58
 *         thread_dict = python.PyThreadState_GetDict()
 *         if thread_dict is NULL:
 *             return self             # <<<<<<<<<<<<<< 
 *         d = <object>thread_dict
 *         result = python.PyDict_GetItem(d, "_ParserDictionaryContext")
 */
  Py_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":59
 *         if thread_dict is NULL:
 *             return self
 *         d = <object>thread_dict             # <<<<<<<<<<<<<< 
 *         result = python.PyDict_GetItem(d, "_ParserDictionaryContext")
 *         if result is not NULL:
 */
__pyx_2 = (PyObject *)__pyx_v_thread_dict;
Py_INCREF(__pyx_2);
Py_DECREF(__pyx_v_d);
__pyx_v_d = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":60
 *             return self
 *         d = <object>thread_dict
 *         result = python.PyDict_GetItem(d, "_ParserDictionaryContext")             # <<<<<<<<<<<<<< 
 *         if result is not NULL:
 *             return <object>result
 */
__pyx_v_result = PyDict_GetItem(__pyx_v_d,__pyx_n__ParserDictionaryContext);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":61
 *         d = <object>thread_dict
 *         result = python.PyDict_GetItem(d, "_ParserDictionaryContext")
 *         if result is not NULL:             # <<<<<<<<<<<<<< 
 *             return <object>result
 *         context = _ParserDictionaryContext()
 */
__pyx_1 = (__pyx_v_result != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":62
 *         result = python.PyDict_GetItem(d, "_ParserDictionaryContext")
 *         if result is not NULL:
 *             return <object>result             # <<<<<<<<<<<<<< 
 *         context = _ParserDictionaryContext()
 *         python.PyDict_SetItem(d, "_ParserDictionaryContext", context)
 */
  __pyx_2 = (PyObject *)__pyx_v_result;
  Py_INCREF(__pyx_2);
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ParserDictionaryContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; goto __pyx_L1;}
  __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":63
 *         if result is not NULL:
 *             return <object>result
 *         context = _ParserDictionaryContext()             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(d, "_ParserDictionaryContext", context)
 *         return context
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ParserDictionaryContext), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ParserDictionaryContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":64
 *             return <object>result
 *         context = _ParserDictionaryContext()
 *         python.PyDict_SetItem(d, "_ParserDictionaryContext", context)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_3 = PyDict_SetItem(__pyx_v_d,__pyx_n__ParserDictionaryContext,((PyObject *)__pyx_v_context)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 64; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":65
 *         context = _ParserDictionaryContext()
 *         python.PyDict_SetItem(d, "_ParserDictionaryContext", context)
 *         return context             # <<<<<<<<<<<<<< 
 * 
 *     cdef void setDefaultParser(self, _BaseParser parser):
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = __pyx_v_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ParserDictionaryContext._findThreadParserContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":67
 *         return context
 * 
 *     cdef void setDefaultParser(self, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *         "Set the default parser for the current thread"
 *         cdef _ParserDictionaryContext context
 */

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) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_parser);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":70
 *         "Set the default parser for the current thread"
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<< 
 *         context._default_parser = parser
 * 
 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 70; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":71
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()
 *         context._default_parser = parser             # <<<<<<<<<<<<<< 
 * 
 *     cdef _BaseParser getDefaultParser(self):
 */
Py_INCREF(((PyObject *)__pyx_v_parser));
Py_DECREF(((PyObject *)__pyx_v_context->_default_parser));
__pyx_v_context->_default_parser = __pyx_v_parser;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext.setDefaultParser");
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_parser);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":73
 *         context._default_parser = parser
 * 
 *     cdef _BaseParser getDefaultParser(self):             # <<<<<<<<<<<<<< 
 *         "Return (or create) the default parser of the current thread"
 *         cdef _ParserDictionaryContext context
 */

static  struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":76
 *         "Return (or create) the default parser of the current thread"
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<< 
 *         if context._default_parser is None:
 *             if self._default_parser is None:
 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 76; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":77
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()
 *         if context._default_parser is None:             # <<<<<<<<<<<<<< 
 *             if self._default_parser is None:
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
 */
__pyx_2 = (((PyObject *)__pyx_v_context->_default_parser) == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":78
 *         context = self._findThreadParserContext()
 *         if context._default_parser is None:
 *             if self._default_parser is None:             # <<<<<<<<<<<<<< 
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
 *             if context is not self:
 */
  __pyx_2 = (((PyObject *)__pyx_v_self->_default_parser) == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":79
 *         if context._default_parser is None:
 *             if self._default_parser is None:
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()             # <<<<<<<<<<<<<< 
 *             if context is not self:
 *                 context._default_parser = self._default_parser._copy()
 */
    __pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 79; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":79
 *         if context._default_parser is None:
 *             if self._default_parser is None:
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()             # <<<<<<<<<<<<<< 
 *             if context is not self:
 *                 context._default_parser = self._default_parser._copy()
 */
    Py_DECREF(((PyObject *)__pyx_v_self->_default_parser));
    __pyx_v_self->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":80
 *             if self._default_parser is None:
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
 *             if context is not self:             # <<<<<<<<<<<<<< 
 *                 context._default_parser = self._default_parser._copy()
 *         return context._default_parser
 */
  __pyx_2 = (__pyx_v_context != __pyx_v_self);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":81
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
 *             if context is not self:
 *                 context._default_parser = self._default_parser._copy()             # <<<<<<<<<<<<<< 
 *         return context._default_parser
 * 
 */
    __pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->_default_parser->__pyx_vtab)->_copy(__pyx_v_self->_default_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 81; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":81
 *                 self._default_parser = __DEFAULT_XML_PARSER._copy()
 *             if context is not self:
 *                 context._default_parser = self._default_parser._copy()             # <<<<<<<<<<<<<< 
 *         return context._default_parser
 * 
 */
    Py_DECREF(((PyObject *)__pyx_v_context->_default_parser));
    __pyx_v_context->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":82
 *             if context is not self:
 *                 context._default_parser = self._default_parser._copy()
 *         return context._default_parser             # <<<<<<<<<<<<<< 
 * 
 *     cdef tree.xmlDict* _getThreadDict(self, tree.xmlDict* default):
 */
Py_INCREF(((PyObject *)__pyx_v_context->_default_parser));
__pyx_r = __pyx_v_context->_default_parser;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ParserDictionaryContext.getDefaultParser");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":84
 *         return context._default_parser
 * 
 *     cdef tree.xmlDict* _getThreadDict(self, tree.xmlDict* default):             # <<<<<<<<<<<<<< 
 *         "Return the thread-local dict or create a new one if necessary."
 *         cdef _ParserDictionaryContext context
 */

static  xmlDict *__pyx_f_4lxml_5etree_24_ParserDictionaryContext__getThreadDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self,xmlDict *__pyx_v_default) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_context;
xmlDict *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":87
 *         "Return the thread-local dict or create a new one if necessary."
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()             # <<<<<<<<<<<<<< 
 *         if context._c_dict is NULL:
 *             # thread dict not yet set up => use default or create a new one
 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 87; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":88
 *         cdef _ParserDictionaryContext context
 *         context = self._findThreadParserContext()
 *         if context._c_dict is NULL:             # <<<<<<<<<<<<<< 
 *             # thread dict not yet set up => use default or create a new one
 *             if default is not NULL:
 */
__pyx_2 = (__pyx_v_context->_c_dict == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":90
 *         if context._c_dict is NULL:
 *             # thread dict not yet set up => use default or create a new one
 *             if default is not NULL:             # <<<<<<<<<<<<<< 
 *                 context._c_dict = default
 *                 xmlparser.xmlDictReference(default)
 */
  __pyx_2 = (__pyx_v_default != NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":91
 *             # thread dict not yet set up => use default or create a new one
 *             if default is not NULL:
 *                 context._c_dict = default             # <<<<<<<<<<<<<< 
 *                 xmlparser.xmlDictReference(default)
 *                 return default
 */
    __pyx_v_context->_c_dict = __pyx_v_default;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":92
 *             if default is not NULL:
 *                 context._c_dict = default
 *                 xmlparser.xmlDictReference(default)             # <<<<<<<<<<<<<< 
 *                 return default
 *             if self._c_dict is NULL:
 */
    xmlDictReference(__pyx_v_default);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":93
 *                 context._c_dict = default
 *                 xmlparser.xmlDictReference(default)
 *                 return default             # <<<<<<<<<<<<<< 
 *             if self._c_dict is NULL:
 *                 self._c_dict = xmlparser.xmlDictCreate()
 */
    __pyx_r = __pyx_v_default;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":94
 *                 xmlparser.xmlDictReference(default)
 *                 return default
 *             if self._c_dict is NULL:             # <<<<<<<<<<<<<< 
 *                 self._c_dict = xmlparser.xmlDictCreate()
 *             if context is not self:
 */
  __pyx_2 = (__pyx_v_self->_c_dict == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":95
 *                 return default
 *             if self._c_dict is NULL:
 *                 self._c_dict = xmlparser.xmlDictCreate()             # <<<<<<<<<<<<<< 
 *             if context is not self:
 *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
 */
    __pyx_v_self->_c_dict = xmlDictCreate();
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":96
 *             if self._c_dict is NULL:
 *                 self._c_dict = xmlparser.xmlDictCreate()
 *             if context is not self:             # <<<<<<<<<<<<<< 
 *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
 *         return context._c_dict
 */
  __pyx_2 = (__pyx_v_context != __pyx_v_self);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":97
 *                 self._c_dict = xmlparser.xmlDictCreate()
 *             if context is not self:
 *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)             # <<<<<<<<<<<<<< 
 *         return context._c_dict
 * 
 */
    __pyx_v_context->_c_dict = xmlDictCreateSub(__pyx_v_self->_c_dict);
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":98
 *             if context is not self:
 *                 context._c_dict = xmlparser.xmlDictCreateSub(self._c_dict)
 *         return context._c_dict             # <<<<<<<<<<<<<< 
 * 
 *     cdef void initThreadDictRef(self, tree.xmlDict** c_dict_ref):
 */
__pyx_r = __pyx_v_context->_c_dict;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree._ParserDictionaryContext._getThreadDict");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":100
 *         return context._c_dict
 * 
 *     cdef void initThreadDictRef(self, tree.xmlDict** c_dict_ref):             # <<<<<<<<<<<<<< 
 *         cdef tree.xmlDict* c_dict
 *         cdef tree.xmlDict* c_thread_dict
 */

static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initThreadDictRef(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self,xmlDict **__pyx_v_c_dict_ref) {
xmlDict *__pyx_v_c_dict;
xmlDict *__pyx_v_c_thread_dict;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":103
 *         cdef tree.xmlDict* c_dict
 *         cdef tree.xmlDict* c_thread_dict
 *         c_dict = c_dict_ref[0]             # <<<<<<<<<<<<<< 
 *         c_thread_dict = self._getThreadDict(c_dict)
 *         if c_dict is c_thread_dict:
 */
__pyx_v_c_dict = (__pyx_v_c_dict_ref[0]);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":104
 *         cdef tree.xmlDict* c_thread_dict
 *         c_dict = c_dict_ref[0]
 *         c_thread_dict = self._getThreadDict(c_dict)             # <<<<<<<<<<<<<< 
 *         if c_dict is c_thread_dict:
 *             return
 */
__pyx_v_c_thread_dict = ((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->_getThreadDict(__pyx_v_self,__pyx_v_c_dict);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":105
 *         c_dict = c_dict_ref[0]
 *         c_thread_dict = self._getThreadDict(c_dict)
 *         if c_dict is c_thread_dict:             # <<<<<<<<<<<<<< 
 *             return
 *         if c_dict is not NULL:
 */
__pyx_1 = (__pyx_v_c_dict == __pyx_v_c_thread_dict);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":106
 *         c_thread_dict = self._getThreadDict(c_dict)
 *         if c_dict is c_thread_dict:
 *             return             # <<<<<<<<<<<<<< 
 *         if c_dict is not NULL:
 *             xmlparser.xmlDictFree(c_dict)
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":107
 *         if c_dict is c_thread_dict:
 *             return
 *         if c_dict is not NULL:             # <<<<<<<<<<<<<< 
 *             xmlparser.xmlDictFree(c_dict)
 *         c_dict_ref[0] = c_thread_dict
 */
__pyx_1 = (__pyx_v_c_dict != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":108
 *             return
 *         if c_dict is not NULL:
 *             xmlparser.xmlDictFree(c_dict)             # <<<<<<<<<<<<<< 
 *         c_dict_ref[0] = c_thread_dict
 *         xmlparser.xmlDictReference(c_thread_dict)
 */
  xmlDictFree(__pyx_v_c_dict);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":109
 *         if c_dict is not NULL:
 *             xmlparser.xmlDictFree(c_dict)
 *         c_dict_ref[0] = c_thread_dict             # <<<<<<<<<<<<<< 
 *         xmlparser.xmlDictReference(c_thread_dict)
 * 
 */
(__pyx_v_c_dict_ref[0]) = __pyx_v_c_thread_dict;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":110
 *             xmlparser.xmlDictFree(c_dict)
 *         c_dict_ref[0] = c_thread_dict
 *         xmlparser.xmlDictReference(c_thread_dict)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):
 */
xmlDictReference(__pyx_v_c_thread_dict);

__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":112
 *         xmlparser.xmlDictReference(c_thread_dict)
 * 
 *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):             # <<<<<<<<<<<<<< 
 *         "Assure we always use the same string dictionary."
 *         self.initThreadDictRef(&pctxt.dict)
 */

static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initParserDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self,xmlParserCtxt *__pyx_v_pctxt) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":114
 *     cdef void initParserDict(self, xmlparser.xmlParserCtxt* pctxt):
 *         "Assure we always use the same string dictionary."
 *         self.initThreadDictRef(&pctxt.dict)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):
 */
((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_pctxt->dict));

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":116
 *         self.initThreadDictRef(&pctxt.dict)
 * 
 *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):             # <<<<<<<<<<<<<< 
 *         "Assure we always use the same string dictionary."
 *         self.initThreadDictRef(&pctxt.dict)
 */

static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initXPathParserDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self,xmlXPathContext *__pyx_v_pctxt) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":118
 *     cdef void initXPathParserDict(self, xpath.xmlXPathContext* pctxt):
 *         "Assure we always use the same string dictionary."
 *         self.initThreadDictRef(&pctxt.dict)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void initDocDict(self, xmlDoc* result):
 */
((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_pctxt->dict));

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":120
 *         self.initThreadDictRef(&pctxt.dict)
 * 
 *     cdef void initDocDict(self, xmlDoc* result):             # <<<<<<<<<<<<<< 
 *         "Store dict of last object parsed if no shared dict yet"
 *         # XXX We also free the result dict here if there already was one.
 */

static  void __pyx_f_4lxml_5etree_24_ParserDictionaryContext_initDocDict(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *__pyx_v_self,xmlDoc *__pyx_v_result) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":125
 *         # This case should only occur for new documents with empty dicts,
 *         # otherwise we'd free data that's in use => segfault
 *         self.initThreadDictRef(&result.dict)             # <<<<<<<<<<<<<< 
 * 
 * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
 */
((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_result->dict));

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":131
 * __GLOBAL_PARSER_CONTEXT.initMainParserContext()
 * 
 * cdef int _checkThreadDict(tree.xmlDict* c_dict):             # <<<<<<<<<<<<<< 
 *     """Check that c_dict is either the local thread dictionary or the global
 *     parent dictionary.
 */

static  int __pyx_f_4lxml_5etree__checkThreadDict(xmlDict *__pyx_v_c_dict) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":135
 *     parent dictionary.
 *     """
 *     if __GLOBAL_PARSER_CONTEXT._c_dict is c_dict:             # <<<<<<<<<<<<<< 
 *         return 1 # main thread
 *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
 */
__pyx_1 = (__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->_c_dict == __pyx_v_c_dict);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":136
 *     """
 *     if __GLOBAL_PARSER_CONTEXT._c_dict is c_dict:
 *         return 1 # main thread             # <<<<<<<<<<<<<< 
 *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
 *         return 1 # local thread dict
 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":137
 *     if __GLOBAL_PARSER_CONTEXT._c_dict is c_dict:
 *         return 1 # main thread
 *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:             # <<<<<<<<<<<<<< 
 *         return 1 # local thread dict
 *     return 0
 */
__pyx_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);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":138
 *         return 1 # main thread
 *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
 *         return 1 # local thread dict             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":139
 *     if __GLOBAL_PARSER_CONTEXT._getThreadDict(NULL) is c_dict:
 *         return 1 # local thread dict
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":149
 * _UNICODE_ENCODING = NULL
 * 
 * cdef void _setupPythonUnicode():             # <<<<<<<<<<<<<< 
 *     """Sets _UNICODE_ENCODING to the internal encoding name of Python unicode
 *     strings if libxml2 supports reading native Python unicode.  This depends
 */

static char __pyx_k498[] = "<test/>";
static char __pyx_k499[] = "strict";
static char __pyx_k500[] = "UTF-16LE";
static char __pyx_k501[] = "UTF-16BE";

static  void __pyx_f_4lxml_5etree__setupPythonUnicode(void) {
xmlCharEncodingHandler *__pyx_v_enchandler;
Py_ssize_t __pyx_v_l;
char *__pyx_v_buffer;
char *__pyx_v_enc;
PyObject *__pyx_v_utext;
PyObject *__pyx_1 = 0;
int __pyx_2;
__pyx_v_utext = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":159
 *     cdef char* buffer
 *     cdef char* enc
 *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, 'strict')             # <<<<<<<<<<<<<< 
 *     l = python.PyUnicode_GET_DATA_SIZE(utext)
 *     buffer = python.PyUnicode_AS_DATA(utext)
 */
__pyx_1 = PyUnicode_DecodeUTF8(__pyx_k498,7,__pyx_k499); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 159; goto __pyx_L1;}
Py_DECREF(__pyx_v_utext);
__pyx_v_utext = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":160
 *     cdef char* enc
 *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, 'strict')
 *     l = python.PyUnicode_GET_DATA_SIZE(utext)             # <<<<<<<<<<<<<< 
 *     buffer = python.PyUnicode_AS_DATA(utext)
 *     enc = _findEncodingName(buffer, l)
 */
__pyx_v_l = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":161
 *     utext = python.PyUnicode_DecodeUTF8("<test/>", 7, 'strict')
 *     l = python.PyUnicode_GET_DATA_SIZE(utext)
 *     buffer = python.PyUnicode_AS_DATA(utext)             # <<<<<<<<<<<<<< 
 *     enc = _findEncodingName(buffer, l)
 *     if enc == NULL:
 */
__pyx_v_buffer = PyUnicode_AS_DATA(__pyx_v_utext);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":162
 *     l = python.PyUnicode_GET_DATA_SIZE(utext)
 *     buffer = python.PyUnicode_AS_DATA(utext)
 *     enc = _findEncodingName(buffer, l)             # <<<<<<<<<<<<<< 
 *     if enc == NULL:
 *         # apparently, libxml2 can't detect UTF-16 on some systems
 */
__pyx_v_enc = __pyx_f_4lxml_5etree__findEncodingName(__pyx_v_buffer,__pyx_v_l);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":163
 *     buffer = python.PyUnicode_AS_DATA(utext)
 *     enc = _findEncodingName(buffer, l)
 *     if enc == NULL:             # <<<<<<<<<<<<<< 
 *         # apparently, libxml2 can't detect UTF-16 on some systems
 *         if l >= 4 and \
 */
__pyx_2 = (__pyx_v_enc == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":165
 *     if enc == NULL:
 *         # apparently, libxml2 can't detect UTF-16 on some systems
 *         if l >= 4 and \             # <<<<<<<<<<<<<< 
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \
 *                buffer[2] == c't' and buffer[3] == c'\0':
 */
  __pyx_2 = (__pyx_v_l >= 4);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":166
 *         # apparently, libxml2 can't detect UTF-16 on some systems
 *         if l >= 4 and \
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \             # <<<<<<<<<<<<<< 
 *                buffer[2] == c't' and buffer[3] == c'\0':
 *             enc = "UTF-16LE"
 */
    __pyx_2 = ((__pyx_v_buffer[0]) == '<');
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":166
 *         # apparently, libxml2 can't detect UTF-16 on some systems
 *         if l >= 4 and \
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \             # <<<<<<<<<<<<<< 
 *                buffer[2] == c't' and buffer[3] == c'\0':
 *             enc = "UTF-16LE"
 */
      __pyx_2 = ((__pyx_v_buffer[1]) == '\0');
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":167
 *         if l >= 4 and \
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \
 *                buffer[2] == c't' and buffer[3] == c'\0':             # <<<<<<<<<<<<<< 
 *             enc = "UTF-16LE"
 *         elif l >= 4 and \
 */
        __pyx_2 = ((__pyx_v_buffer[2]) == 't');
        if (__pyx_2) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":167
 *         if l >= 4 and \
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \
 *                buffer[2] == c't' and buffer[3] == c'\0':             # <<<<<<<<<<<<<< 
 *             enc = "UTF-16LE"
 *         elif l >= 4 and \
 */
          __pyx_2 = ((__pyx_v_buffer[3]) == '\0');
        }
      }
    }
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":168
 *                buffer[0] == c'<' and buffer[1] == c'\0' and \
 *                buffer[2] == c't' and buffer[3] == c'\0':
 *             enc = "UTF-16LE"             # <<<<<<<<<<<<<< 
 *         elif l >= 4 and \
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \
 */
    __pyx_v_enc = __pyx_k500;
    goto __pyx_L3;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":169
 *                buffer[2] == c't' and buffer[3] == c'\0':
 *             enc = "UTF-16LE"
 *         elif l >= 4 and \             # <<<<<<<<<<<<<< 
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \
 *                buffer[2] == c'\0' and buffer[3] == c't':
 */
  __pyx_2 = (__pyx_v_l >= 4);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":170
 *             enc = "UTF-16LE"
 *         elif l >= 4 and \
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \             # <<<<<<<<<<<<<< 
 *                buffer[2] == c'\0' and buffer[3] == c't':
 *             enc = "UTF-16BE"
 */
    __pyx_2 = ((__pyx_v_buffer[0]) == '\0');
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":170
 *             enc = "UTF-16LE"
 *         elif l >= 4 and \
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \             # <<<<<<<<<<<<<< 
 *                buffer[2] == c'\0' and buffer[3] == c't':
 *             enc = "UTF-16BE"
 */
      __pyx_2 = ((__pyx_v_buffer[1]) == '<');
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":171
 *         elif l >= 4 and \
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \
 *                buffer[2] == c'\0' and buffer[3] == c't':             # <<<<<<<<<<<<<< 
 *             enc = "UTF-16BE"
 *         else:
 */
        __pyx_2 = ((__pyx_v_buffer[2]) == '\0');
        if (__pyx_2) {

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":171
 *         elif l >= 4 and \
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \
 *                buffer[2] == c'\0' and buffer[3] == c't':             # <<<<<<<<<<<<<< 
 *             enc = "UTF-16BE"
 *         else:
 */
          __pyx_2 = ((__pyx_v_buffer[3]) == 't');
        }
      }
    }
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":172
 *                buffer[0] == c'\0' and buffer[1] == c'<' and \
 *                buffer[2] == c'\0' and buffer[3] == c't':
 *             enc = "UTF-16BE"             # <<<<<<<<<<<<<< 
 *         else:
 *             # not my fault, it's YOUR broken system :)
 */
    __pyx_v_enc = __pyx_k501;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":175
 *         else:
 *             # not my fault, it's YOUR broken system :)
 *             return             # <<<<<<<<<<<<<< 
 *     enchandler = tree.xmlFindCharEncodingHandler(enc)
 *     if enchandler is not NULL:
 */
    goto __pyx_L0;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":176
 *             # not my fault, it's YOUR broken system :)
 *             return
 *     enchandler = tree.xmlFindCharEncodingHandler(enc)             # <<<<<<<<<<<<<< 
 *     if enchandler is not NULL:
 *         global _UNICODE_ENCODING
 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_enc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":177
 *             return
 *     enchandler = tree.xmlFindCharEncodingHandler(enc)
 *     if enchandler is not NULL:             # <<<<<<<<<<<<<< 
 *         global _UNICODE_ENCODING
 *         tree.xmlCharEncCloseFunc(enchandler)
 */
__pyx_2 = (__pyx_v_enchandler != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":179
 *     if enchandler is not NULL:
 *         global _UNICODE_ENCODING
 *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<< 
 *         _UNICODE_ENCODING = enc
 * 
 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":180
 *         global _UNICODE_ENCODING
 *         tree.xmlCharEncCloseFunc(enchandler)
 *         _UNICODE_ENCODING = enc             # <<<<<<<<<<<<<< 
 * 
 * cdef char* _findEncodingName(char* buffer, int size):
 */
  __pyx_v_4lxml_5etree__UNICODE_ENCODING = __pyx_v_enc;
  goto __pyx_L4;
}
__pyx_L4:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree._setupPythonUnicode");
__pyx_L0:;
Py_DECREF(__pyx_v_utext);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":182
 *         _UNICODE_ENCODING = enc
 * 
 * cdef char* _findEncodingName(char* buffer, int size):             # <<<<<<<<<<<<<< 
 *     "Work around bug in libxml2: find iconv name of encoding on our own."
 *     cdef tree.xmlCharEncoding enc
 */

static char __pyx_k502[] = "UTF-16LE";
static char __pyx_k503[] = "UTF-16BE";
static char __pyx_k504[] = "UCS-4LE";
static char __pyx_k505[] = "UCS-4BE";

static  char *__pyx_f_4lxml_5etree__findEncodingName(char *__pyx_v_buffer,int __pyx_v_size) {
xmlCharEncoding __pyx_v_enc;
char *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":185
 *     "Work around bug in libxml2: find iconv name of encoding on our own."
 *     cdef tree.xmlCharEncoding enc
 *     enc = tree.xmlDetectCharEncoding(buffer, size)             # <<<<<<<<<<<<<< 
 *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
 *         return "UTF-16LE"
 */
__pyx_v_enc = xmlDetectCharEncoding(__pyx_v_buffer,__pyx_v_size);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":186
 *     cdef tree.xmlCharEncoding enc
 *     enc = tree.xmlDetectCharEncoding(buffer, size)
 *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:             # <<<<<<<<<<<<<< 
 *         return "UTF-16LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16LE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":187
 *     enc = tree.xmlDetectCharEncoding(buffer, size)
 *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
 *         return "UTF-16LE"             # <<<<<<<<<<<<<< 
 *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
 *         return "UTF-16BE"
 */
  __pyx_r = __pyx_k502;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":188
 *     if enc == tree.XML_CHAR_ENCODING_UTF16LE:
 *         return "UTF-16LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:             # <<<<<<<<<<<<<< 
 *         return "UTF-16BE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16BE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":189
 *         return "UTF-16LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
 *         return "UTF-16BE"             # <<<<<<<<<<<<<< 
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
 *         return "UCS-4LE"
 */
  __pyx_r = __pyx_k503;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":190
 *     elif enc == tree.XML_CHAR_ENCODING_UTF16BE:
 *         return "UTF-16BE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:             # <<<<<<<<<<<<<< 
 *         return "UCS-4LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4LE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":191
 *         return "UTF-16BE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
 *         return "UCS-4LE"             # <<<<<<<<<<<<<< 
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
 *         return "UCS-4BE"
 */
  __pyx_r = __pyx_k504;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":192
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4LE:
 *         return "UCS-4LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:             # <<<<<<<<<<<<<< 
 *         return "UCS-4BE"
 *     elif enc == tree.XML_CHAR_ENCODING_NONE:
 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4BE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":193
 *         return "UCS-4LE"
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
 *         return "UCS-4BE"             # <<<<<<<<<<<<<< 
 *     elif enc == tree.XML_CHAR_ENCODING_NONE:
 *         return NULL
 */
  __pyx_r = __pyx_k505;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":194
 *     elif enc == tree.XML_CHAR_ENCODING_UCS4BE:
 *         return "UCS-4BE"
 *     elif enc == tree.XML_CHAR_ENCODING_NONE:             # <<<<<<<<<<<<<< 
 *         return NULL
 *     else:
 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_NONE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":195
 *         return "UCS-4BE"
 *     elif enc == tree.XML_CHAR_ENCODING_NONE:
 *         return NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         return tree.xmlGetCharEncodingName(enc)
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":197
 *         return NULL
 *     else:
 *         return tree.xmlGetCharEncodingName(enc)             # <<<<<<<<<<<<<< 
 * 
 * _setupPythonUnicode()
 */
  __pyx_r = xmlGetCharEncodingName(__pyx_v_enc);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":213
 *     cdef cstd.size_t _bytes_read
 *     cdef char* _c_url
 *     def __init__(self, filelike, exc_context, url, encoding):             # <<<<<<<<<<<<<< 
 *         self._exc_context = exc_context
 *         self._filelike = filelike
 */

static PyObject *__pyx_k506p;

static char __pyx_k506[] = "";

static int __pyx_pf_4lxml_5etree_18_FileReaderContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_18_FileReaderContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filelike = 0;
PyObject *__pyx_v_exc_context = 0;
PyObject *__pyx_v_url = 0;
PyObject *__pyx_v_encoding = 0;
int __pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"filelike","exc_context","url","encoding",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_filelike, &__pyx_v_exc_context, &__pyx_v_url, &__pyx_v_encoding))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filelike);
Py_INCREF(__pyx_v_exc_context);
Py_INCREF(__pyx_v_url);
Py_INCREF(__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":214
 *     cdef char* _c_url
 *     def __init__(self, filelike, exc_context, url, encoding):
 *         self._exc_context = exc_context             # <<<<<<<<<<<<<< 
 *         self._filelike = filelike
 *         self._encoding = encoding
 */
if (!__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_4lxml_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 214; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":214
 *     cdef char* _c_url
 *     def __init__(self, filelike, exc_context, url, encoding):
 *         self._exc_context = exc_context             # <<<<<<<<<<<<<< 
 *         self._filelike = filelike
 *         self._encoding = encoding
 */
Py_INCREF(__pyx_v_exc_context);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_exc_context));
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":215
 *     def __init__(self, filelike, exc_context, url, encoding):
 *         self._exc_context = exc_context
 *         self._filelike = filelike             # <<<<<<<<<<<<<< 
 *         self._encoding = encoding
 *         self._url = url
 */
Py_INCREF(__pyx_v_filelike);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_filelike);
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_filelike = __pyx_v_filelike;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":216
 *         self._exc_context = exc_context
 *         self._filelike = filelike
 *         self._encoding = encoding             # <<<<<<<<<<<<<< 
 *         self._url = url
 *         if url is None:
 */
Py_INCREF(__pyx_v_encoding);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_encoding);
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_encoding = __pyx_v_encoding;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":217
 *         self._filelike = filelike
 *         self._encoding = encoding
 *         self._url = url             # <<<<<<<<<<<<<< 
 *         if url is None:
 *             self._c_url = NULL
 */
Py_INCREF(__pyx_v_url);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_url);
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_url = __pyx_v_url;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":218
 *         self._encoding = encoding
 *         self._url = url
 *         if url is None:             # <<<<<<<<<<<<<< 
 *             self._c_url = NULL
 *         else:
 */
__pyx_1 = (__pyx_v_url == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":219
 *         self._url = url
 *         if url is None:
 *             self._c_url = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             self._c_url = _cstr(url)
 */
  ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_c_url = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":221
 *             self._c_url = NULL
 *         else:
 *             self._c_url = _cstr(url)             # <<<<<<<<<<<<<< 
 *         self._bytes  = ''
 *         self._bytes_read = 0
 */
  ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_c_url = _cstr(__pyx_v_url);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":222
 *         else:
 *             self._c_url = _cstr(url)
 *         self._bytes  = ''             # <<<<<<<<<<<<<< 
 *         self._bytes_read = 0
 * 
 */
Py_INCREF(__pyx_k506p);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes);
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes = __pyx_k506p;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":223
 *             self._c_url = _cstr(url)
 *         self._bytes  = ''
 *         self._bytes_read = 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlparser.xmlParserInput* _createParserInput(
 */
((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_v_self)->_bytes_read = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._FileReaderContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_filelike);
Py_DECREF(__pyx_v_exc_context);
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":225
 *         self._bytes_read = 0
 * 
 *     cdef xmlparser.xmlParserInput* _createParserInput(             # <<<<<<<<<<<<<< 
 *             self, xmlparser.xmlParserCtxt* ctxt):
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 */

static  xmlParserInput *__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInput(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self,xmlParserCtxt *__pyx_v_ctxt) {
xmlParserInputBuffer *__pyx_v_c_buffer;
xmlParserInput *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":228
 *             self, xmlparser.xmlParserCtxt* ctxt):
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)             # <<<<<<<<<<<<<< 
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser
 */
__pyx_v_c_buffer = xmlAllocParserInputBuffer(0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":229
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
 *         c_buffer.context = <python.PyObject*>self             # <<<<<<<<<<<<<< 
 *         c_buffer.readcallback = _readFilelikeParser
 *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)
 */
__pyx_v_c_buffer->context = ((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":230
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser             # <<<<<<<<<<<<<< 
 *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)
 * 
 */
__pyx_v_c_buffer->readcallback = __pyx_f_4lxml_5etree__readFilelikeParser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":231
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser
 *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _readDoc(self, xmlparser.xmlParserCtxt* ctxt, int options):
 */
__pyx_r = xmlNewIOInputStream(__pyx_v_ctxt,__pyx_v_c_buffer,0);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":233
 *         return xmlparser.xmlNewIOInputStream(ctxt, c_buffer, 0)
 * 
 *     cdef xmlDoc* _readDoc(self, xmlparser.xmlParserCtxt* ctxt, int options):             # <<<<<<<<<<<<<< 
 *         cdef xmlDoc* result
 *         cdef char* c_encoding
 */

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) {
xmlDoc *__pyx_v_result;
char *__pyx_v_c_encoding;
xmlDoc *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":237
 *         cdef char* c_encoding
 * 
 *         if self._encoding is None:             # <<<<<<<<<<<<<< 
 *             c_encoding = NULL
 *         else:
 */
__pyx_1 = (__pyx_v_self->_encoding == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":238
 * 
 *         if self._encoding is None:
 *             c_encoding = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             c_encoding = _cstr(self._encoding)
 */
  __pyx_v_c_encoding = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":240
 *             c_encoding = NULL
 *         else:
 *             c_encoding = _cstr(self._encoding)             # <<<<<<<<<<<<<< 
 * 
 *         with nogil:
 */
  __pyx_v_c_encoding = _cstr(__pyx_v_self->_encoding);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":242
 *             c_encoding = _cstr(self._encoding)
 * 
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             if ctxt.html:
 *                 result = htmlparser.htmlCtxtReadIO(
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":243
 * 
 *         with nogil:
 *             if ctxt.html:             # <<<<<<<<<<<<<< 
 *                 result = htmlparser.htmlCtxtReadIO(
 *                     ctxt, _readFilelikeParser, NULL, <python.PyObject*>self,
 */
    __pyx_1 = __pyx_v_ctxt->html;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":246
 *                 result = htmlparser.htmlCtxtReadIO(
 *                     ctxt, _readFilelikeParser, NULL, <python.PyObject*>self,
 *                     self._c_url, c_encoding, options)             # <<<<<<<<<<<<<< 
 *             else:
 *                 result = xmlparser.xmlCtxtReadIO(
 */
      __pyx_v_result = htmlCtxtReadIO(__pyx_v_ctxt,__pyx_f_4lxml_5etree__readFilelikeParser,NULL,((PyObject *)__pyx_v_self),__pyx_v_self->_c_url,__pyx_v_c_encoding,__pyx_v_options);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":250
 *                 result = xmlparser.xmlCtxtReadIO(
 *                     ctxt, _readFilelikeParser, NULL, <python.PyObject*>self,
 *                     self._c_url, c_encoding, options)             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
      __pyx_v_result = xmlCtxtReadIO(__pyx_v_ctxt,__pyx_f_4lxml_5etree__readFilelikeParser,NULL,((PyObject *)__pyx_v_self),__pyx_v_self->_c_url,__pyx_v_c_encoding,__pyx_v_options);
    }
    __pyx_L6:;
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":251
 *                     ctxt, _readFilelikeParser, NULL, <python.PyObject*>self,
 *                     self._c_url, c_encoding, options)
 *         return result             # <<<<<<<<<<<<<< 
 * 
 *     cdef tree.xmlDtd* _readDtd(self):
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":253
 *         return result
 * 
 *     cdef tree.xmlDtd* _readDtd(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
 */

static  xmlDtd *__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd(struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_self) {
xmlParserInputBuffer *__pyx_v_c_buffer;
xmlDtd *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":255
 *     cdef tree.xmlDtd* _readDtd(self):
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)             # <<<<<<<<<<<<<< 
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser
 */
__pyx_v_c_buffer = xmlAllocParserInputBuffer(0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":256
 *         cdef xmlparser.xmlParserInputBuffer* c_buffer
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
 *         c_buffer.context = <python.PyObject*>self             # <<<<<<<<<<<<<< 
 *         c_buffer.readcallback = _readFilelikeParser
 *         with nogil:
 */
__pyx_v_c_buffer->context = ((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":257
 *         c_buffer = xmlparser.xmlAllocParserInputBuffer(0)
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
 */
__pyx_v_c_buffer->readcallback = __pyx_f_4lxml_5etree__readFilelikeParser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":258
 *         c_buffer.context = <python.PyObject*>self
 *         c_buffer.readcallback = _readFilelikeParser
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
 * 
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":259
 *         c_buffer.readcallback = _readFilelikeParser
 *         with nogil:
 *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)             # <<<<<<<<<<<<<< 
 * 
 *     cdef int copyToBuffer(self, char* c_buffer, int c_size):
 */
    __pyx_r = xmlIOParseDTD(NULL,__pyx_v_c_buffer,0);
    goto __pyx_L2;
  }
  /*finally:*/ {
    int __pyx_why;
    __pyx_why = 0; goto __pyx_L4;
    __pyx_L2: __pyx_why = 3; goto __pyx_L4;
    __pyx_L4:;
    Py_BLOCK_THREADS
    switch (__pyx_why) {
      case 3: goto __pyx_L0;
    }
  }
}

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":261
 *             return xmlparser.xmlIOParseDTD(NULL, c_buffer, 0)
 * 
 *     cdef int copyToBuffer(self, char* c_buffer, int c_size):             # <<<<<<<<<<<<<< 
 *         cdef char* c_start
 *         cdef Py_ssize_t byte_count, remaining
 */

static PyObject *__pyx_k507p;

static char __pyx_k507[] = "reading file objects must return plain strings";

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_size) {
char *__pyx_v_c_start;
Py_ssize_t __pyx_v_byte_count;
Py_ssize_t __pyx_v_remaining;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":264
 *         cdef char* c_start
 *         cdef Py_ssize_t byte_count, remaining
 *         if self._bytes_read < 0:             # <<<<<<<<<<<<<< 
 *             return 0
 *         try:
 */
__pyx_1 = (__pyx_v_self->_bytes_read < 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":265
 *         cdef Py_ssize_t byte_count, remaining
 *         if self._bytes_read < 0:
 *             return 0             # <<<<<<<<<<<<<< 
 *         try:
 *             byte_count = python.PyString_GET_SIZE(self._bytes)
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":266
 *         if self._bytes_read < 0:
 *             return 0
 *         try:             # <<<<<<<<<<<<<< 
 *             byte_count = python.PyString_GET_SIZE(self._bytes)
 *             remaining = byte_count - self._bytes_read
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":267
 *             return 0
 *         try:
 *             byte_count = python.PyString_GET_SIZE(self._bytes)             # <<<<<<<<<<<<<< 
 *             remaining = byte_count - self._bytes_read
 *             if remaining <= 0:
 */
  __pyx_v_byte_count = PyString_GET_SIZE(__pyx_v_self->_bytes);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":268
 *         try:
 *             byte_count = python.PyString_GET_SIZE(self._bytes)
 *             remaining = byte_count - self._bytes_read             # <<<<<<<<<<<<<< 
 *             if remaining <= 0:
 *                 self._bytes = self._filelike.read(c_size)
 */
  __pyx_v_remaining = (__pyx_v_byte_count - __pyx_v_self->_bytes_read);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":269
 *             byte_count = python.PyString_GET_SIZE(self._bytes)
 *             remaining = byte_count - self._bytes_read
 *             if remaining <= 0:             # <<<<<<<<<<<<<< 
 *                 self._bytes = self._filelike.read(c_size)
 *                 if not python.PyString_Check(self._bytes):
 */
  __pyx_1 = (__pyx_v_remaining <= 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":270
 *             remaining = byte_count - self._bytes_read
 *             if remaining <= 0:
 *                 self._bytes = self._filelike.read(c_size)             # <<<<<<<<<<<<<< 
 *                 if not python.PyString_Check(self._bytes):
 *                     raise TypeError, "reading file objects must return plain strings"
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_n_read); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 270; goto __pyx_L3;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":270
 *             remaining = byte_count - self._bytes_read
 *             if remaining <= 0:
 *                 self._bytes = self._filelike.read(c_size)             # <<<<<<<<<<<<<< 
 *                 if not python.PyString_Check(self._bytes):
 *                     raise TypeError, "reading file objects must return plain strings"
 */
    __pyx_3 = PyInt_FromLong(__pyx_v_c_size); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 270; goto __pyx_L3;}
    __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 270; goto __pyx_L3;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 270; goto __pyx_L3;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":270
 *             remaining = byte_count - self._bytes_read
 *             if remaining <= 0:
 *                 self._bytes = self._filelike.read(c_size)             # <<<<<<<<<<<<<< 
 *                 if not python.PyString_Check(self._bytes):
 *                     raise TypeError, "reading file objects must return plain strings"
 */
    Py_DECREF(__pyx_v_self->_bytes);
    __pyx_v_self->_bytes = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":271
 *             if remaining <= 0:
 *                 self._bytes = self._filelike.read(c_size)
 *                 if not python.PyString_Check(self._bytes):             # <<<<<<<<<<<<<< 
 *                     raise TypeError, "reading file objects must return plain strings"
 *                 remaining = python.PyString_GET_SIZE(self._bytes)
 */
    __pyx_1 = (!PyString_Check(__pyx_v_self->_bytes));
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":272
 *                 self._bytes = self._filelike.read(c_size)
 *                 if not python.PyString_Check(self._bytes):
 *                     raise TypeError, "reading file objects must return plain strings"             # <<<<<<<<<<<<<< 
 *                 remaining = python.PyString_GET_SIZE(self._bytes)
 *                 self._bytes_read = 0
 */
      __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k507p, 0);
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 272; goto __pyx_L3;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":273
 *                 if not python.PyString_Check(self._bytes):
 *                     raise TypeError, "reading file objects must return plain strings"
 *                 remaining = python.PyString_GET_SIZE(self._bytes)             # <<<<<<<<<<<<<< 
 *                 self._bytes_read = 0
 *                 if remaining == 0:
 */
    __pyx_v_remaining = PyString_GET_SIZE(__pyx_v_self->_bytes);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":274
 *                     raise TypeError, "reading file objects must return plain strings"
 *                 remaining = python.PyString_GET_SIZE(self._bytes)
 *                 self._bytes_read = 0             # <<<<<<<<<<<<<< 
 *                 if remaining == 0:
 *                     self._bytes_read = -1
 */
    __pyx_v_self->_bytes_read = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":275
 *                 remaining = python.PyString_GET_SIZE(self._bytes)
 *                 self._bytes_read = 0
 *                 if remaining == 0:             # <<<<<<<<<<<<<< 
 *                     self._bytes_read = -1
 *                     return 0
 */
    __pyx_1 = (__pyx_v_remaining == 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":276
 *                 self._bytes_read = 0
 *                 if remaining == 0:
 *                     self._bytes_read = -1             # <<<<<<<<<<<<<< 
 *                     return 0
 *             if c_size > remaining:
 */
      __pyx_v_self->_bytes_read = -1;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":277
 *                 if remaining == 0:
 *                     self._bytes_read = -1
 *                     return 0             # <<<<<<<<<<<<<< 
 *             if c_size > remaining:
 *                 c_size = remaining
 */
      __pyx_r = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":278
 *                     self._bytes_read = -1
 *                     return 0
 *             if c_size > remaining:             # <<<<<<<<<<<<<< 
 *                 c_size = remaining
 *             c_start = _cstr(self._bytes) + self._bytes_read
 */
  __pyx_1 = (__pyx_v_c_size > __pyx_v_remaining);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":279
 *                     return 0
 *             if c_size > remaining:
 *                 c_size = remaining             # <<<<<<<<<<<<<< 
 *             c_start = _cstr(self._bytes) + self._bytes_read
 *             self._bytes_read = self._bytes_read + c_size
 */
    __pyx_v_c_size = __pyx_v_remaining;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":280
 *             if c_size > remaining:
 *                 c_size = remaining
 *             c_start = _cstr(self._bytes) + self._bytes_read             # <<<<<<<<<<<<<< 
 *             self._bytes_read = self._bytes_read + c_size
 *             cstd.memcpy(c_buffer, c_start, c_size)
 */
  __pyx_v_c_start = (_cstr(__pyx_v_self->_bytes) + __pyx_v_self->_bytes_read);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":281
 *                 c_size = remaining
 *             c_start = _cstr(self._bytes) + self._bytes_read
 *             self._bytes_read = self._bytes_read + c_size             # <<<<<<<<<<<<<< 
 *             cstd.memcpy(c_buffer, c_start, c_size)
 *             return c_size
 */
  __pyx_v_self->_bytes_read = (__pyx_v_self->_bytes_read + __pyx_v_c_size);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":282
 *             c_start = _cstr(self._bytes) + self._bytes_read
 *             self._bytes_read = self._bytes_read + c_size
 *             cstd.memcpy(c_buffer, c_start, c_size)             # <<<<<<<<<<<<<< 
 *             return c_size
 *         except:
 */
  memcpy(__pyx_v_c_buffer,__pyx_v_c_start,__pyx_v_c_size);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":283
 *             self._bytes_read = self._bytes_read + c_size
 *             cstd.memcpy(c_buffer, c_start, c_size)
 *             return c_size             # <<<<<<<<<<<<<< 
 *         except:
 *             self._exc_context._store_raised()
 */
  __pyx_r = __pyx_v_c_size;
  goto __pyx_L0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":284
 *             cstd.memcpy(c_buffer, c_start, c_size)
 *             return c_size
 *         except:             # <<<<<<<<<<<<<< 
 *             self._exc_context._store_raised()
 *             return -1
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree.copyToBuffer");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_3) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 284; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":285
 *             return c_size
 *         except:
 *             self._exc_context._store_raised()             # <<<<<<<<<<<<<< 
 *             return -1
 * 
 */
  ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":286
 *         except:
 *             self._exc_context._store_raised()
 *             return -1             # <<<<<<<<<<<<<< 
 * 
 * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:
 */
  __pyx_r = -1;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._FileReaderContext.copyToBuffer");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":288
 *             return -1
 * 
 * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:             # <<<<<<<<<<<<<< 
 *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)
 * 
 */

static  int __pyx_f_4lxml_5etree__readFilelikeParser(void *__pyx_v_ctxt,char *__pyx_v_c_buffer,int __pyx_v_c_size) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyGILState_STATE _save = PyGILState_Ensure();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":289
 * 
 * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:
 *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":289
 * 
 * cdef int _readFilelikeParser(void* ctxt, char* c_buffer, int c_size) with gil:
 *     return (<_FileReaderContext>ctxt).copyToBuffer(c_buffer, c_size)             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_1)->__pyx_vtab)->copyToBuffer(((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_1),__pyx_v_c_buffer,__pyx_v_c_size);
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
PyGILState_Release(_save);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":295
 * ############################################################
 * 
 * cdef  xmlparser.xmlParserInput* _parser_resolve_from_python(             # <<<<<<<<<<<<<< 
 *     char* c_url, char* c_pubid, xmlparser.xmlParserCtxt* c_context,
 *     int* error) with gil:
 */

static  xmlParserInput *__pyx_f_4lxml_5etree__parser_resolve_from_python(char *__pyx_v_c_url,char *__pyx_v_c_pubid,xmlParserCtxt *__pyx_v_c_context,int *__pyx_v_error) {
xmlParserInput *__pyx_v_c_input;
struct __pyx_obj_4lxml_5etree__ResolverContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_file_context;
PyObject *__pyx_v_url;
PyObject *__pyx_v_pubid;
PyObject *__pyx_v_data;
xmlParserInput *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_url = Py_None; Py_INCREF(Py_None);
__pyx_v_pubid = Py_None; Py_INCREF(Py_None);
__pyx_v_data = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":303
 *     cdef _InputDocument   doc_ref
 *     cdef _FileReaderContext file_context
 *     error[0] = 0             # <<<<<<<<<<<<<< 
 *     context = <_ResolverContext>c_context._private
 *     try:
 */
(__pyx_v_error[0]) = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":304
 *     cdef _FileReaderContext file_context
 *     error[0] = 0
 *     context = <_ResolverContext>c_context._private             # <<<<<<<<<<<<<< 
 *     try:
 *         if c_url is NULL:
 */
__pyx_1 = (PyObject *)__pyx_v_c_context->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":305
 *     error[0] = 0
 *     context = <_ResolverContext>c_context._private
 *     try:             # <<<<<<<<<<<<<< 
 *         if c_url is NULL:
 *             url = None
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":306
 *     context = <_ResolverContext>c_context._private
 *     try:
 *         if c_url is NULL:             # <<<<<<<<<<<<<< 
 *             url = None
 *         elif c_context.myDoc is NULL or c_context.myDoc.URL is NULL:
 */
  __pyx_2 = (__pyx_v_c_url == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":307
 *     try:
 *         if c_url is NULL:
 *             url = None             # <<<<<<<<<<<<<< 
 *         elif c_context.myDoc is NULL or c_context.myDoc.URL is NULL:
 *             # parsing a main document, so URL was passed verbatimly by user
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = Py_None;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":308
 *         if c_url is NULL:
 *             url = None
 *         elif c_context.myDoc is NULL or c_context.myDoc.URL is NULL:             # <<<<<<<<<<<<<< 
 *             # parsing a main document, so URL was passed verbatimly by user
 *             url = c_url
 */
  __pyx_2 = (__pyx_v_c_context->myDoc == NULL);
  if (!__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":308
 *         if c_url is NULL:
 *             url = None
 *         elif c_context.myDoc is NULL or c_context.myDoc.URL is NULL:             # <<<<<<<<<<<<<< 
 *             # parsing a main document, so URL was passed verbatimly by user
 *             url = c_url
 */
    __pyx_2 = (__pyx_v_c_context->myDoc->URL == NULL);
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":310
 *         elif c_context.myDoc is NULL or c_context.myDoc.URL is NULL:
 *             # parsing a main document, so URL was passed verbatimly by user
 *             url = c_url             # <<<<<<<<<<<<<< 
 *         else:
 *             # parsing a related document (DTD etc.) => UTF-8 encoded URL
 */
    __pyx_1 = PyString_FromString(__pyx_v_c_url); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 310; goto __pyx_L2;}
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":313
 *         else:
 *             # parsing a related document (DTD etc.) => UTF-8 encoded URL
 *             url = funicode(c_url)             # <<<<<<<<<<<<<< 
 *         if c_pubid is NULL:
 *             pubid = None
 */
    __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_url); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 313; goto __pyx_L2;}
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":314
 *             # parsing a related document (DTD etc.) => UTF-8 encoded URL
 *             url = funicode(c_url)
 *         if c_pubid is NULL:             # <<<<<<<<<<<<<< 
 *             pubid = None
 *         else:
 */
  __pyx_2 = (__pyx_v_c_pubid == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":315
 *             url = funicode(c_url)
 *         if c_pubid is NULL:
 *             pubid = None             # <<<<<<<<<<<<<< 
 *         else:
 *             pubid = funicode(c_pubid) # always UTF-8
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_pubid);
    __pyx_v_pubid = Py_None;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":317
 *             pubid = None
 *         else:
 *             pubid = funicode(c_pubid) # always UTF-8             # <<<<<<<<<<<<<< 
 * 
 *         doc_ref = context._resolvers.resolve(url, pubid, context)
 */
    __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_pubid); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 317; goto __pyx_L2;}
    Py_DECREF(__pyx_v_pubid);
    __pyx_v_pubid = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":319
 *             pubid = funicode(c_pubid) # always UTF-8
 * 
 *         doc_ref = context._resolvers.resolve(url, pubid, context)             # <<<<<<<<<<<<<< 
 *         if doc_ref is None:
 *             return NULL
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_resolvers), __pyx_n_resolve); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 319; goto __pyx_L2;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":319
 *             pubid = funicode(c_pubid) # always UTF-8
 * 
 *         doc_ref = context._resolvers.resolve(url, pubid, context)             # <<<<<<<<<<<<<< 
 *         if doc_ref is None:
 *             return NULL
 */
  __pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 319; goto __pyx_L2;}
  Py_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_url);
  Py_INCREF(__pyx_v_pubid);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_pubid);
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_3, 2, ((PyObject *)__pyx_v_context));
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 319; goto __pyx_L2;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 319; goto __pyx_L2;}
  Py_DECREF(((PyObject *)__pyx_v_doc_ref));
  __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":320
 * 
 *         doc_ref = context._resolvers.resolve(url, pubid, context)
 *         if doc_ref is None:             # <<<<<<<<<<<<<< 
 *             return NULL
 *     except:
 */
  __pyx_2 = (((PyObject *)__pyx_v_doc_ref) == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":321
 *         doc_ref = context._resolvers.resolve(url, pubid, context)
 *         if doc_ref is None:
 *             return NULL             # <<<<<<<<<<<<<< 
 *     except:
 *         context._store_raised()
 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":322
 *         if doc_ref is None:
 *             return NULL
 *     except:             # <<<<<<<<<<<<<< 
 *         context._store_raised()
 *         error[0] = 1
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._parser_resolve_from_python");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 322; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":323
 *             return NULL
 *     except:
 *         context._store_raised()             # <<<<<<<<<<<<<< 
 *         error[0] = 1
 *         return NULL
 */
  ((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));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":324
 *     except:
 *         context._store_raised()
 *         error[0] = 1             # <<<<<<<<<<<<<< 
 *         return NULL
 * 
 */
  (__pyx_v_error[0]) = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":325
 *         context._store_raised()
 *         error[0] = 1
 *         return NULL             # <<<<<<<<<<<<<< 
 * 
 *     c_input = NULL
 */
  __pyx_r = NULL;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":327
 *         return NULL
 * 
 *     c_input = NULL             # <<<<<<<<<<<<<< 
 *     data = None
 *     if doc_ref._type == PARSER_DATA_STRING:
 */
__pyx_v_c_input = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":328
 * 
 *     c_input = NULL
 *     data = None             # <<<<<<<<<<<<<< 
 *     if doc_ref._type == PARSER_DATA_STRING:
 *         data = doc_ref._data_bytes
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_data);
__pyx_v_data = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":329
 *     c_input = NULL
 *     data = None
 *     if doc_ref._type == PARSER_DATA_STRING:             # <<<<<<<<<<<<<< 
 *         data = doc_ref._data_bytes
 *         c_input = xmlparser.xmlNewStringInputStream(
 */
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_STRING);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":330
 *     data = None
 *     if doc_ref._type == PARSER_DATA_STRING:
 *         data = doc_ref._data_bytes             # <<<<<<<<<<<<<< 
 *         c_input = xmlparser.xmlNewStringInputStream(
 *             c_context, _cstr(data))
 */
  Py_INCREF(__pyx_v_doc_ref->_data_bytes);
  Py_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_v_doc_ref->_data_bytes;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":332
 *         data = doc_ref._data_bytes
 *         c_input = xmlparser.xmlNewStringInputStream(
 *             c_context, _cstr(data))             # <<<<<<<<<<<<<< 
 *     elif doc_ref._type == PARSER_DATA_FILENAME:
 *         c_input = xmlparser.xmlNewInputFromFile(
 */
  __pyx_v_c_input = xmlNewStringInputStream(__pyx_v_c_context,_cstr(__pyx_v_data));
  goto __pyx_L7;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":333
 *         c_input = xmlparser.xmlNewStringInputStream(
 *             c_context, _cstr(data))
 *     elif doc_ref._type == PARSER_DATA_FILENAME:             # <<<<<<<<<<<<<< 
 *         c_input = xmlparser.xmlNewInputFromFile(
 *             c_context, _cstr(doc_ref._data_bytes))
 */
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":335
 *     elif doc_ref._type == PARSER_DATA_FILENAME:
 *         c_input = xmlparser.xmlNewInputFromFile(
 *             c_context, _cstr(doc_ref._data_bytes))             # <<<<<<<<<<<<<< 
 *     elif doc_ref._type == PARSER_DATA_FILE:
 *         file_context = _FileReaderContext(doc_ref._file, context, url)
 */
  __pyx_v_c_input = xmlNewInputFromFile(__pyx_v_c_context,_cstr(__pyx_v_doc_ref->_data_bytes));
  goto __pyx_L7;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":336
 *         c_input = xmlparser.xmlNewInputFromFile(
 *             c_context, _cstr(doc_ref._data_bytes))
 *     elif doc_ref._type == PARSER_DATA_FILE:             # <<<<<<<<<<<<<< 
 *         file_context = _FileReaderContext(doc_ref._file, context, url)
 *         c_input = file_context._createParserInput(c_context)
 */
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILE);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":337
 *             c_context, _cstr(doc_ref._data_bytes))
 *     elif doc_ref._type == PARSER_DATA_FILE:
 *         file_context = _FileReaderContext(doc_ref._file, context, url)             # <<<<<<<<<<<<<< 
 *         c_input = file_context._createParserInput(c_context)
 *         data = file_context
 */
  __pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_INCREF(__pyx_v_doc_ref->_file);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_doc_ref->_file);
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_context));
  Py_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_url);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext), __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__FileReaderContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 337; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_file_context));
  __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":338
 *     elif doc_ref._type == PARSER_DATA_FILE:
 *         file_context = _FileReaderContext(doc_ref._file, context, url)
 *         c_input = file_context._createParserInput(c_context)             # <<<<<<<<<<<<<< 
 *         data = file_context
 * 
 */
  __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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":339
 *         file_context = _FileReaderContext(doc_ref._file, context, url)
 *         c_input = file_context._createParserInput(c_context)
 *         data = file_context             # <<<<<<<<<<<<<< 
 * 
 *     if data is not None:
 */
  Py_INCREF(((PyObject *)__pyx_v_file_context));
  Py_DECREF(__pyx_v_data);
  __pyx_v_data = ((PyObject *)__pyx_v_file_context);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":341
 *         data = file_context
 * 
 *     if data is not None:             # <<<<<<<<<<<<<< 
 *         context._storage.add(data)
 *     return c_input
 */
__pyx_2 = (__pyx_v_data != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":342
 * 
 *     if data is not None:
 *         context._storage.add(data)             # <<<<<<<<<<<<<< 
 *     return c_input
 * 
 */
  __pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_context->_storage->__pyx_vtab)->add(__pyx_v_context->_storage,__pyx_v_data); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 342; goto __pyx_L1;}
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":343
 *     if data is not None:
 *         context._storage.add(data)
 *     return c_input             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.xmlParserInput* _local_resolver(char* c_url, char* c_pubid,
 */
__pyx_r = __pyx_v_c_input;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._parser_resolve_from_python");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_file_context);
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_pubid);
Py_DECREF(__pyx_v_data);
PyGILState_Release(_save);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":345
 *     return c_input
 * 
 * cdef xmlparser.xmlParserInput* _local_resolver(char* c_url, char* c_pubid,             # <<<<<<<<<<<<<< 
 *                                                xmlparser.xmlParserCtxt* c_context):
 *     # no Python objects here, may be called without thread context !
 */

static  xmlParserInput *__pyx_f_4lxml_5etree__local_resolver(char *__pyx_v_c_url,char *__pyx_v_c_pubid,xmlParserCtxt *__pyx_v_c_context) {
xmlParserInput *__pyx_v_c_input;
int __pyx_v_error;
xmlParserInput *__pyx_r;
int __pyx_1;
int __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":351
 *     cdef xmlparser.xmlParserInput* c_input
 *     cdef int error
 *     if c_context._private is NULL:             # <<<<<<<<<<<<<< 
 *         if __DEFAULT_ENTITY_LOADER is NULL:
 *             return NULL
 */
__pyx_1 = (__pyx_v_c_context->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":352
 *     cdef int error
 *     if c_context._private is NULL:
 *         if __DEFAULT_ENTITY_LOADER is NULL:             # <<<<<<<<<<<<<< 
 *             return NULL
 *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
 */
  __pyx_1 = (__pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":353
 *     if c_context._private is NULL:
 *         if __DEFAULT_ENTITY_LOADER is NULL:
 *             return NULL             # <<<<<<<<<<<<<< 
 *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
 * 
 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":354
 *         if __DEFAULT_ENTITY_LOADER is NULL:
 *             return NULL
 *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)             # <<<<<<<<<<<<<< 
 * 
 *     c_input = _parser_resolve_from_python(c_url, c_pubid, c_context, &error)
 */
  __pyx_r = __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER(__pyx_v_c_url,__pyx_v_c_pubid,__pyx_v_c_context);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":356
 *         return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
 * 
 *     c_input = _parser_resolve_from_python(c_url, c_pubid, c_context, &error)             # <<<<<<<<<<<<<< 
 * 
 *     if c_input is not NULL:
 */
__pyx_v_c_input = __pyx_f_4lxml_5etree__parser_resolve_from_python(__pyx_v_c_url,__pyx_v_c_pubid,__pyx_v_c_context,(&__pyx_v_error));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":358
 *     c_input = _parser_resolve_from_python(c_url, c_pubid, c_context, &error)
 * 
 *     if c_input is not NULL:             # <<<<<<<<<<<<<< 
 *         return c_input
 *     if error:
 */
__pyx_1 = (__pyx_v_c_input != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":359
 * 
 *     if c_input is not NULL:
 *         return c_input             # <<<<<<<<<<<<<< 
 *     if error:
 *         return NULL
 */
  __pyx_r = __pyx_v_c_input;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":360
 *     if c_input is not NULL:
 *         return c_input
 *     if error:             # <<<<<<<<<<<<<< 
 *         return NULL
 *     if __DEFAULT_ENTITY_LOADER is NULL:
 */
__pyx_2 = __pyx_v_error;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":361
 *         return c_input
 *     if error:
 *         return NULL             # <<<<<<<<<<<<<< 
 *     if __DEFAULT_ENTITY_LOADER is NULL:
 *         return NULL
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":362
 *     if error:
 *         return NULL
 *     if __DEFAULT_ENTITY_LOADER is NULL:             # <<<<<<<<<<<<<< 
 *         return NULL
 *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
 */
__pyx_1 = (__pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":363
 *         return NULL
 *     if __DEFAULT_ENTITY_LOADER is NULL:
 *         return NULL             # <<<<<<<<<<<<<< 
 *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)
 * 
 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":364
 *     if __DEFAULT_ENTITY_LOADER is NULL:
 *         return NULL
 *     return __DEFAULT_ENTITY_LOADER(c_url, c_pubid, c_context)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.xmlExternalEntityLoader __DEFAULT_ENTITY_LOADER
 */
__pyx_r = __pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER(__pyx_v_c_url,__pyx_v_c_pubid,__pyx_v_c_context);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":384
 *     cdef python.PyThread_type_lock _lock
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._lock is not NULL:
 *             python.PyThread_free_lock(self._lock)
 */

static void __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":385
 * 
 *     def __dealloc__(self):
 *         if self._lock is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyThread_free_lock(self._lock)
 *         if self._c_ctxt is not NULL:
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_lock != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":386
 *     def __dealloc__(self):
 *         if self._lock is not NULL:
 *             python.PyThread_free_lock(self._lock)             # <<<<<<<<<<<<<< 
 *         if self._c_ctxt is not NULL:
 *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
 */
  PyThread_free_lock(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_lock);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":387
 *         if self._lock is not NULL:
 *             python.PyThread_free_lock(self._lock)
 *         if self._c_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_c_ctxt != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":388
 *             python.PyThread_free_lock(self._lock)
 *         if self._c_ctxt is not NULL:
 *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _copy(self):
 */
  xmlFreeParserCtxt(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self)->_c_ctxt);
  goto __pyx_L3;
}
__pyx_L3:;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":390
 *             xmlparser.xmlFreeParserCtxt(self._c_ctxt)
 * 
 *     cdef _ParserContext _copy(self):             # <<<<<<<<<<<<<< 
 *         cdef _ParserContext context
 *         context = self.__class__()
 */

static PyObject *__pyx_n___class__;

static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_14_ParserContext__copy(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":392
 *     cdef _ParserContext _copy(self):
 *         cdef _ParserContext context
 *         context = self.__class__()             # <<<<<<<<<<<<<< 
 *         _initParserContext(context, self._resolvers._copy(), NULL)
 *         return context
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 392; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 392; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 392; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":393
 *         cdef _ParserContext context
 *         context = self.__class__()
 *         _initParserContext(context, self._resolvers._copy(), NULL)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_1 = ((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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 393; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":393
 *         cdef _ParserContext context
 *         context = self.__class__()
 *         _initParserContext(context, self._resolvers._copy(), NULL)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_2 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_context,((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_1),NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 393; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":394
 *         context = self.__class__()
 *         _initParserContext(context, self._resolvers._copy(), NULL)
 *         return context             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = __pyx_v_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ParserContext._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":396
 *         return context
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *         self._c_ctxt = c_ctxt
 *         c_ctxt._private = <void*>self
 */

static  void __pyx_f_4lxml_5etree_14_ParserContext__initParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self,xmlParserCtxt *__pyx_v_c_ctxt) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":397
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
 *         self._c_ctxt = c_ctxt             # <<<<<<<<<<<<<< 
 *         c_ctxt._private = <void*>self
 * 
 */
__pyx_v_self->_c_ctxt = __pyx_v_c_ctxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":398
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
 *         self._c_ctxt = c_ctxt
 *         c_ctxt._private = <void*>self             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _resetParserContext(self):
 */
__pyx_v_c_ctxt->_private = ((void *)__pyx_v_self);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":400
 *         c_ctxt._private = <void*>self
 * 
 *     cdef void _resetParserContext(self):             # <<<<<<<<<<<<<< 
 *         if self._c_ctxt is not NULL:
 *             if self._c_ctxt.html:
 */

static  void __pyx_f_4lxml_5etree_14_ParserContext__resetParserContext(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":401
 * 
 *     cdef void _resetParserContext(self):
 *         if self._c_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *             if self._c_ctxt.html:
 *                 htmlparser.htmlCtxtReset(self._c_ctxt)
 */
__pyx_1 = (__pyx_v_self->_c_ctxt != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":402
 *     cdef void _resetParserContext(self):
 *         if self._c_ctxt is not NULL:
 *             if self._c_ctxt.html:             # <<<<<<<<<<<<<< 
 *                 htmlparser.htmlCtxtReset(self._c_ctxt)
 *             elif self._c_ctxt.spaceTab is not NULL or \
 */
  __pyx_1 = __pyx_v_self->_c_ctxt->html;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":403
 *         if self._c_ctxt is not NULL:
 *             if self._c_ctxt.html:
 *                 htmlparser.htmlCtxtReset(self._c_ctxt)             # <<<<<<<<<<<<<< 
 *             elif self._c_ctxt.spaceTab is not NULL or \
 *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
 */
    htmlCtxtReset(__pyx_v_self->_c_ctxt);
    goto __pyx_L3;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":404
 *             if self._c_ctxt.html:
 *                 htmlparser.htmlCtxtReset(self._c_ctxt)
 *             elif self._c_ctxt.spaceTab is not NULL or \             # <<<<<<<<<<<<<< 
 *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
 *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
 */
  __pyx_1 = (__pyx_v_self->_c_ctxt->spaceTab != NULL);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":405
 *                 htmlparser.htmlCtxtReset(self._c_ctxt)
 *             elif self._c_ctxt.spaceTab is not NULL or \
 *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2             # <<<<<<<<<<<<<< 
 *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
 * 
 */
    __pyx_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20629);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":406
 *             elif self._c_ctxt.spaceTab is not NULL or \
 *                     _LIBXML_VERSION_INT >= 20629: # work around bug in libxml2
 *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *     cdef int prepare(self) except -1:
 */
    xmlClearParserCtxt(__pyx_v_self->_c_ctxt);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":408
 *                 xmlparser.xmlClearParserCtxt(self._c_ctxt)
 * 
 *     cdef int prepare(self) except -1:             # <<<<<<<<<<<<<< 
 *         cdef int result
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 */

static PyObject *__pyx_k508p;

static char __pyx_k508[] = "parser locking failed";

static  int __pyx_f_4lxml_5etree_14_ParserContext_prepare(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
int __pyx_v_result;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":410
 *     cdef int prepare(self) except -1:
 *         cdef int result
 *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":410
 *     cdef int prepare(self) except -1:
 *         cdef int result
 *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 */
  __pyx_1 = (__pyx_v_self->_lock != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":411
 *         cdef int result
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 result = python.PyThread_acquire_lock(
 *                     self._lock, python.WAIT_LOCK)
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":413
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 *                     self._lock, python.WAIT_LOCK)             # <<<<<<<<<<<<<< 
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"
 */
      __pyx_v_result = PyThread_acquire_lock(__pyx_v_self->_lock,WAIT_LOCK);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":414
 *                 result = python.PyThread_acquire_lock(
 *                     self._lock, python.WAIT_LOCK)
 *             if result == 0:             # <<<<<<<<<<<<<< 
 *                 raise ParserError, "parser locking failed"
 *         self._error_log.connect()
 */
  __pyx_1 = (__pyx_v_result == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":415
 *                     self._lock, python.WAIT_LOCK)
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         return 0
 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 415; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":415
 *                     self._lock, python.WAIT_LOCK)
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         return 0
 */
    __Pyx_Raise(__pyx_2, __pyx_k508p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 415; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":416
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":417
 *                 raise ParserError, "parser locking failed"
 *         self._error_log.connect()
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef int cleanup(self) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ParserContext.prepare");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":419
 *         return 0
 * 
 *     cdef int cleanup(self) except -1:             # <<<<<<<<<<<<<< 
 *         self._resetParserContext()
 *         self.clear()
 */

static  int __pyx_f_4lxml_5etree_14_ParserContext_cleanup(struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_self) {
int __pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":420
 * 
 *     cdef int cleanup(self) except -1:
 *         self._resetParserContext()             # <<<<<<<<<<<<<< 
 *         self.clear()
 *         self._error_log.disconnect()
 */
((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->_resetParserContext(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":421
 *     cdef int cleanup(self) except -1:
 *         self._resetParserContext()
 *         self.clear()             # <<<<<<<<<<<<<< 
 *         self._error_log.disconnect()
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 */
((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));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":422
 *         self._resetParserContext()
 *         self.clear()
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 *             python.PyThread_release_lock(self._lock)
 */
((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":423
 *         self.clear()
 *         self._error_log.disconnect()
 *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyThread_release_lock(self._lock)
 *         return 0
 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":423
 *         self.clear()
 *         self._error_log.disconnect()
 *         if config.ENABLE_THREADING and self._lock is not NULL:             # <<<<<<<<<<<<<< 
 *             python.PyThread_release_lock(self._lock)
 *         return 0
 */
  __pyx_1 = (__pyx_v_self->_lock != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":424
 *         self._error_log.disconnect()
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 *             python.PyThread_release_lock(self._lock)             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
  PyThread_release_lock(__pyx_v_self->_lock);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":425
 *         if config.ENABLE_THREADING and self._lock is not NULL:
 *             python.PyThread_release_lock(self._lock)
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _handleParseResult(self, _BaseParser parser,
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":427
 *         return 0
 * 
 *     cdef object _handleParseResult(self, _BaseParser parser,             # <<<<<<<<<<<<<< 
 *                                    xmlDoc* result, filename):
 *         cdef xmlDoc* c_doc
 */

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) {
xmlDoc *__pyx_v_c_doc;
int __pyx_v_recover;
PyObject *__pyx_r;
xmlDoc *__pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":431
 *         cdef xmlDoc* c_doc
 *         cdef bint recover
 *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<< 
 *         c_doc = _handleParseResult(self, self._c_ctxt, result,
 *                                    filename, recover)
 */
__pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":433
 *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
 *         c_doc = _handleParseResult(self, self._c_ctxt, result,
 *                                    filename, recover)             # <<<<<<<<<<<<<< 
 *         return _documentFactory(c_doc, parser)
 * 
 */
__pyx_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_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":434
 *         c_doc = _handleParseResult(self, self._c_ctxt, result,
 *                                    filename, recover)
 *         return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 434; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._ParserContext._handleParseResult");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":436
 *         return _documentFactory(c_doc, parser)
 * 
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,             # <<<<<<<<<<<<<< 
 *                                        xmlDoc* result, filename) except NULL:
 *         cdef bint recover
 */

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) {
int __pyx_v_recover;
xmlDoc *__pyx_r;
xmlDoc *__pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":439
 *                                        xmlDoc* result, filename) except NULL:
 *         cdef bint recover
 *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<< 
 *         return _handleParseResult(self, self._c_ctxt, result,
 *                                    filename, recover)
 */
__pyx_v_recover = (__pyx_v_parser->_parse_options & XML_PARSE_RECOVER);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":441
 *         recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
 *         return _handleParseResult(self, self._c_ctxt, result,
 *                                    filename, recover)             # <<<<<<<<<<<<<< 
 * 
 * cdef _initParserContext(_ParserContext context,
 */
__pyx_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_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 440; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._ParserContext._handleParseResultDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":443
 *                                    filename, recover)
 * 
 * cdef _initParserContext(_ParserContext context,             # <<<<<<<<<<<<<< 
 *                         _ResolverRegistry resolvers,
 *                         xmlparser.xmlParserCtxt* c_ctxt):
 */

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) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_context);
Py_INCREF(__pyx_v_resolvers);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":446
 *                         _ResolverRegistry resolvers,
 *                         xmlparser.xmlParserCtxt* c_ctxt):
 *     _initResolverContext(context, resolvers)             # <<<<<<<<<<<<<< 
 *     if not config.ENABLE_THREADING:
 *         context._lock = NULL
 */
__pyx_1 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context),__pyx_v_resolvers); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 446; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":447
 *                         xmlparser.xmlParserCtxt* c_ctxt):
 *     _initResolverContext(context, resolvers)
 *     if not config.ENABLE_THREADING:             # <<<<<<<<<<<<<< 
 *         context._lock = NULL
 *     else:
 */
__pyx_2 = (!ENABLE_THREADING);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":448
 *     _initResolverContext(context, resolvers)
 *     if not config.ENABLE_THREADING:
 *         context._lock = NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         context._lock = python.PyThread_allocate_lock()
 */
  __pyx_v_context->_lock = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":450
 *         context._lock = NULL
 *     else:
 *         context._lock = python.PyThread_allocate_lock()             # <<<<<<<<<<<<<< 
 *     if c_ctxt is not NULL:
 *         context._initParserContext(c_ctxt)
 */
  __pyx_v_context->_lock = PyThread_allocate_lock();
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":451
 *     else:
 *         context._lock = python.PyThread_allocate_lock()
 *     if c_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *         context._initParserContext(c_ctxt)
 *     context._error_log = _ErrorLog()
 */
__pyx_2 = (__pyx_v_c_ctxt != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":452
 *         context._lock = python.PyThread_allocate_lock()
 *     if c_ctxt is not NULL:
 *         context._initParserContext(c_ctxt)             # <<<<<<<<<<<<<< 
 *     context._error_log = _ErrorLog()
 * 
 */
  ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_initParserContext(__pyx_v_context,__pyx_v_c_ctxt);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":453
 *     if c_ctxt is not NULL:
 *         context._initParserContext(c_ctxt)
 *     context._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 453; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 453; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":453
 *     if c_ctxt is not NULL:
 *         context._initParserContext(c_ctxt)
 *     context._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,
 */
Py_DECREF(((PyObject *)__pyx_v_context->_error_log));
__pyx_v_context->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_1);
__pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._initParserContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_resolvers);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":455
 *     context._error_log = _ErrorLog()
 * 
 * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,             # <<<<<<<<<<<<<< 
 *                           _ErrorLog error_log) except 0:
 *     if filename is not None and \
 */

static PyObject *__pyx_n_IOError;

static PyObject *__pyx_k509p;
static PyObject *__pyx_k510p;
static PyObject *__pyx_k511p;
static PyObject *__pyx_k512p;

static PyObject *__pyx_builtin_IOError;

static char __pyx_k509[] = "Error reading file '%s': %s";
static char __pyx_k510[] = "Error reading '%s'";
static char __pyx_k511[] = "Document is not well formed";
static char __pyx_k512[] = "line %d: %s";

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) {
PyObject *__pyx_v_message;
PyObject *__pyx_v_code;
PyObject *__pyx_v_line;
PyObject *__pyx_v_column;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_filename);
Py_INCREF((PyObject *)__pyx_v_error_log);
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_code = Py_None; Py_INCREF(Py_None);
__pyx_v_line = Py_None; Py_INCREF(Py_None);
__pyx_v_column = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":457
 * cdef int _raiseParseError(xmlparser.xmlParserCtxt* ctxt, filename,
 *                           _ErrorLog error_log) except 0:
 *     if filename is not None and \             # <<<<<<<<<<<<<< 
 *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:
 *         if ctxt.lastError.message is not NULL:
 */
__pyx_1 = (__pyx_v_filename != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":458
 *                           _ErrorLog error_log) except 0:
 *     if filename is not None and \
 *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:             # <<<<<<<<<<<<<< 
 *         if ctxt.lastError.message is not NULL:
 *             message = "Error reading file '%s': %s" % (
 */
  __pyx_1 = (__pyx_v_ctxt->lastError.domain == XML_FROM_IO);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":459
 *     if filename is not None and \
 *            ctxt.lastError.domain == xmlerror.XML_FROM_IO:
 *         if ctxt.lastError.message is not NULL:             # <<<<<<<<<<<<<< 
 *             message = "Error reading file '%s': %s" % (
 *                 filename, (ctxt.lastError.message).strip())
 */
  __pyx_1 = (__pyx_v_ctxt->lastError.message != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":461
 *         if ctxt.lastError.message is not NULL:
 *             message = "Error reading file '%s': %s" % (
 *                 filename, (ctxt.lastError.message).strip())             # <<<<<<<<<<<<<< 
 *         else:
 *             message = "Error reading '%s'" % filename
 */
    __pyx_2 = PyString_FromString(__pyx_v_ctxt->lastError.message); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_strip); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; goto __pyx_L1;}
    Py_INCREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
    __pyx_2 = 0;
    __pyx_2 = PyNumber_Remainder(__pyx_k509p, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 460; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":463
 *                 filename, (ctxt.lastError.message).strip())
 *         else:
 *             message = "Error reading '%s'" % filename             # <<<<<<<<<<<<<< 
 *         raise IOError(message)
 *     elif error_log:
 */
    __pyx_3 = PyNumber_Remainder(__pyx_k510p, __pyx_v_filename); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 463; goto __pyx_L1;}
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":464
 *         else:
 *             message = "Error reading '%s'" % filename
 *         raise IOError(message)             # <<<<<<<<<<<<<< 
 *     elif error_log:
 *         raise error_log._buildParseException(
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; goto __pyx_L1;}
  Py_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_message);
  __pyx_3 = PyObject_CallObject(__pyx_builtin_IOError, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":465
 *             message = "Error reading '%s'" % filename
 *         raise IOError(message)
 *     elif error_log:             # <<<<<<<<<<<<<< 
 *         raise error_log._buildParseException(
 *             XMLSyntaxError, "Document is not well formed")
 */
__pyx_1 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_error_log)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 465; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":467
 *     elif error_log:
 *         raise error_log._buildParseException(
 *             XMLSyntaxError, "Document is not well formed")             # <<<<<<<<<<<<<< 
 *     elif ctxt.lastError.message is not NULL:
 *         message = (ctxt.lastError.message).strip()
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 467; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":467
 *     elif error_log:
 *         raise error_log._buildParseException(
 *             XMLSyntaxError, "Document is not well formed")             # <<<<<<<<<<<<<< 
 *     elif ctxt.lastError.message is not NULL:
 *         message = (ctxt.lastError.message).strip()
 */
  __pyx_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_2,__pyx_k511p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 466; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 466; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":468
 *         raise error_log._buildParseException(
 *             XMLSyntaxError, "Document is not well formed")
 *     elif ctxt.lastError.message is not NULL:             # <<<<<<<<<<<<<< 
 *         message = (ctxt.lastError.message).strip()
 *         code = ctxt.lastError.code
 */
__pyx_1 = (__pyx_v_ctxt->lastError.message != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":469
 *             XMLSyntaxError, "Document is not well formed")
 *     elif ctxt.lastError.message is not NULL:
 *         message = (ctxt.lastError.message).strip()             # <<<<<<<<<<<<<< 
 *         code = ctxt.lastError.code
 *         line = ctxt.lastError.line
 */
  __pyx_2 = PyString_FromString(__pyx_v_ctxt->lastError.message); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 469; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_strip); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 469; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 469; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":470
 *     elif ctxt.lastError.message is not NULL:
 *         message = (ctxt.lastError.message).strip()
 *         code = ctxt.lastError.code             # <<<<<<<<<<<<<< 
 *         line = ctxt.lastError.line
 *         column = ctxt.lastError.int2
 */
  __pyx_3 = PyInt_FromLong(__pyx_v_ctxt->lastError.code); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 470; goto __pyx_L1;}
  Py_DECREF(__pyx_v_code);
  __pyx_v_code = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":471
 *         message = (ctxt.lastError.message).strip()
 *         code = ctxt.lastError.code
 *         line = ctxt.lastError.line             # <<<<<<<<<<<<<< 
 *         column = ctxt.lastError.int2
 *         if ctxt.lastError.line > 0:
 */
  __pyx_2 = PyInt_FromLong(__pyx_v_ctxt->lastError.line); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 471; goto __pyx_L1;}
  Py_DECREF(__pyx_v_line);
  __pyx_v_line = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":472
 *         code = ctxt.lastError.code
 *         line = ctxt.lastError.line
 *         column = ctxt.lastError.int2             # <<<<<<<<<<<<<< 
 *         if ctxt.lastError.line > 0:
 *             message = "line %d: %s" % (line, message)
 */
  __pyx_3 = PyInt_FromLong(__pyx_v_ctxt->lastError.int2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 472; goto __pyx_L1;}
  Py_DECREF(__pyx_v_column);
  __pyx_v_column = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":473
 *         line = ctxt.lastError.line
 *         column = ctxt.lastError.int2
 *         if ctxt.lastError.line > 0:             # <<<<<<<<<<<<<< 
 *             message = "line %d: %s" % (line, message)
 *         raise XMLSyntaxError(message, code, line, column)
 */
  __pyx_1 = (__pyx_v_ctxt->lastError.line > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":474
 *         column = ctxt.lastError.int2
 *         if ctxt.lastError.line > 0:
 *             message = "line %d: %s" % (line, message)             # <<<<<<<<<<<<<< 
 *         raise XMLSyntaxError(message, code, line, column)
 *     else:
 */
    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    Py_INCREF(__pyx_v_line);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_line);
    Py_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_message);
    __pyx_3 = PyNumber_Remainder(__pyx_k512p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 474; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":475
 *         if ctxt.lastError.line > 0:
 *             message = "line %d: %s" % (line, message)
 *         raise XMLSyntaxError(message, code, line, column)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 475; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":475
 *         if ctxt.lastError.line > 0:
 *             message = "line %d: %s" % (line, message)
 *         raise XMLSyntaxError(message, code, line, column)             # <<<<<<<<<<<<<< 
 *     else:
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 */
  __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 475; goto __pyx_L1;}
  Py_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_message);
  Py_INCREF(__pyx_v_code);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_code);
  Py_INCREF(__pyx_v_line);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_line);
  Py_INCREF(__pyx_v_column);
  PyTuple_SET_ITEM(__pyx_3, 3, __pyx_v_column);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 475; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, 0, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 475; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":477
 *         raise XMLSyntaxError(message, code, line, column)
 *     else:
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _handleParseResult(_ParserContext context,
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 477; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":477
 *         raise XMLSyntaxError(message, code, line, column)
 *     else:
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _handleParseResult(_ParserContext context,
 */
  __pyx_3 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 477; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":477
 *         raise XMLSyntaxError(message, code, line, column)
 *     else:
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _handleParseResult(_ParserContext context,
 */
  __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 477; goto __pyx_L1;}
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_4, 0, Py_None);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_num_0);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_4, 3, __pyx_num_0);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 477; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 477; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._raiseParseError");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_code);
Py_DECREF(__pyx_v_line);
Py_DECREF(__pyx_v_column);
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_error_log);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":479
 *         raise XMLSyntaxError(None, xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 * 
 * cdef xmlDoc* _handleParseResult(_ParserContext context,             # <<<<<<<<<<<<<< 
 *                                 xmlparser.xmlParserCtxt* c_ctxt,
 *                                 xmlDoc* result, filename,
 */

static PyObject *__pyx_n_WAR_UNDECLARED_ENTITY;
static PyObject *__pyx_n_ERR_UNDECLARED_ENTITY;

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) {
int __pyx_v_well_formed;
PyObject *__pyx_v_error;
xmlDoc *__pyx_r;
int __pyx_1;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
int __pyx_8;
Py_INCREF((PyObject *)__pyx_v_context);
Py_INCREF(__pyx_v_filename);
__pyx_v_error = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":484
 *                                 bint recover) except NULL:
 *     cdef bint well_formed
 *     if c_ctxt.myDoc is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_ctxt.myDoc != result:
 *             tree.xmlFreeDoc(c_ctxt.myDoc)
 */
__pyx_1 = (__pyx_v_c_ctxt->myDoc != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":485
 *     cdef bint well_formed
 *     if c_ctxt.myDoc is not NULL:
 *         if c_ctxt.myDoc != result:             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeDoc(c_ctxt.myDoc)
 *         c_ctxt.myDoc = NULL
 */
  __pyx_1 = (__pyx_v_c_ctxt->myDoc != __pyx_v_result);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":486
 *     if c_ctxt.myDoc is not NULL:
 *         if c_ctxt.myDoc != result:
 *             tree.xmlFreeDoc(c_ctxt.myDoc)             # <<<<<<<<<<<<<< 
 *         c_ctxt.myDoc = NULL
 * 
 */
    xmlFreeDoc(__pyx_v_c_ctxt->myDoc);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":487
 *         if c_ctxt.myDoc != result:
 *             tree.xmlFreeDoc(c_ctxt.myDoc)
 *         c_ctxt.myDoc = NULL             # <<<<<<<<<<<<<< 
 * 
 *     if result is not NULL:
 */
  __pyx_v_c_ctxt->myDoc = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":489
 *         c_ctxt.myDoc = NULL
 * 
 *     if result is not NULL:             # <<<<<<<<<<<<<< 
 *         if recover or (c_ctxt.wellFormed and \
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 */
__pyx_1 = (__pyx_v_result != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":490
 * 
 *     if result is not NULL:
 *         if recover or (c_ctxt.wellFormed and \             # <<<<<<<<<<<<<< 
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 *             well_formed = 1
 */
  __pyx_1 = __pyx_v_recover;
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":490
 * 
 *     if result is not NULL:
 *         if recover or (c_ctxt.wellFormed and \             # <<<<<<<<<<<<<< 
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 *             well_formed = 1
 */
    __pyx_1 = __pyx_v_c_ctxt->wellFormed;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":491
 *     if result is not NULL:
 *         if recover or (c_ctxt.wellFormed and \
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):             # <<<<<<<<<<<<<< 
 *             well_formed = 1
 *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
 */
      __pyx_1 = (__pyx_v_c_ctxt->lastError.level < XML_ERR_ERROR);
    }
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":492
 *         if recover or (c_ctxt.wellFormed and \
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 *             well_formed = 1             # <<<<<<<<<<<<<< 
 *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
 *                  and context is not None:
 */
    __pyx_v_well_formed = 1;
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":493
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 *             well_formed = 1
 *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \             # <<<<<<<<<<<<<< 
 *                  and context is not None:
 *             # in this mode, we ignore errors about undefined entities
 */
  __pyx_1 = (!__pyx_v_c_ctxt->replaceEntities);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":493
 *                        c_ctxt.lastError.level < xmlerror.XML_ERR_ERROR):
 *             well_formed = 1
 *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \             # <<<<<<<<<<<<<< 
 *                  and context is not None:
 *             # in this mode, we ignore errors about undefined entities
 */
    __pyx_1 = (!__pyx_v_c_ctxt->validate);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":494
 *             well_formed = 1
 *         elif not c_ctxt.replaceEntities and not c_ctxt.validate \
 *                  and context is not None:             # <<<<<<<<<<<<<< 
 *             # in this mode, we ignore errors about undefined entities
 *             for error in context._error_log.filter_from_errors():
 */
      __pyx_1 = (((PyObject *)__pyx_v_context) != Py_None);
    }
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":496
 *                  and context is not None:
 *             # in this mode, we ignore errors about undefined entities
 *             for error in context._error_log.filter_from_errors():             # <<<<<<<<<<<<<< 
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 */
    __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_n_filter_from_errors); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (PyList_CheckExact(__pyx_4)) { __pyx_2 = 0; __pyx_3 = __pyx_4; Py_INCREF(__pyx_3); }
    else { __pyx_3 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 496; goto __pyx_L1;} }
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":496
 *                  and context is not None:
 *             # in this mode, we ignore errors about undefined entities
 *             for error in context._error_log.filter_from_errors():             # <<<<<<<<<<<<<< 
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 */
      if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); }
      else {
        __pyx_4 = PyIter_Next(__pyx_3);
        if (!__pyx_4) {
          break;
        }
      }
      Py_DECREF(__pyx_v_error);
      __pyx_v_error = __pyx_4;
      __pyx_4 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":497
 *             # in this mode, we ignore errors about undefined entities
 *             for error in context._error_log.filter_from_errors():
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \             # <<<<<<<<<<<<<< 
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 *                     well_formed = 0
 */
      __pyx_5 = PyObject_GetAttr(__pyx_v_error, __pyx_n_type); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":497
 *             # in this mode, we ignore errors about undefined entities
 *             for error in context._error_log.filter_from_errors():
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \             # <<<<<<<<<<<<<< 
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 *                     well_formed = 0
 */
      __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}
      __pyx_7 = PyObject_GetAttr(__pyx_6, __pyx_n_WAR_UNDECLARED_ENTITY); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_4 = PyObject_RichCompare(__pyx_5, __pyx_7, Py_NE); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}
      if (__pyx_1) {
        Py_DECREF(__pyx_4); __pyx_4 = 0;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":498
 *             for error in context._error_log.filter_from_errors():
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:             # <<<<<<<<<<<<<< 
 *                     well_formed = 0
 *                     break
 */
        __pyx_6 = PyObject_GetAttr(__pyx_v_error, __pyx_n_type); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 498; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":498
 *             for error in context._error_log.filter_from_errors():
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:             # <<<<<<<<<<<<<< 
 *                     well_formed = 0
 *                     break
 */
        __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 498; goto __pyx_L1;}
        __pyx_7 = PyObject_GetAttr(__pyx_5, __pyx_n_ERR_UNDECLARED_ENTITY); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 498; goto __pyx_L1;}
        Py_DECREF(__pyx_5); __pyx_5 = 0;
        __pyx_4 = PyObject_RichCompare(__pyx_6, __pyx_7, Py_NE); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 498; goto __pyx_L1;}
        Py_DECREF(__pyx_6); __pyx_6 = 0;
        Py_DECREF(__pyx_7); __pyx_7 = 0;
      }
      __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 497; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":499
 *                 if error.type != ErrorTypes.WAR_UNDECLARED_ENTITY and \
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 *                     well_formed = 0             # <<<<<<<<<<<<<< 
 *                     break
 *             else:
 */
        __pyx_v_well_formed = 0;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":500
 *                        error.type != ErrorTypes.ERR_UNDECLARED_ENTITY:
 *                     well_formed = 0
 *                     break             # <<<<<<<<<<<<<< 
 *             else:
 *                 well_formed = 1
 */
        goto __pyx_L7;
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":502
 *                     break
 *             else:
 *                 well_formed = 1             # <<<<<<<<<<<<<< 
 *         else:
 *             well_formed = 0
 */
      __pyx_v_well_formed = 1;
    }
    __pyx_L7:;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":504
 *                 well_formed = 1
 *         else:
 *             well_formed = 0             # <<<<<<<<<<<<<< 
 * 
 *         if well_formed:
 */
    __pyx_v_well_formed = 0;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":506
 *             well_formed = 0
 * 
 *         if well_formed:             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *         else:
 */
  __pyx_1 = __pyx_v_well_formed;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":507
 * 
 *         if well_formed:
 *             __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<< 
 *         else:
 *             # free broken document
 */
    ((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);
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":510
 *         else:
 *             # free broken document
 *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<< 
 *             result = NULL
 * 
 */
    xmlFreeDoc(__pyx_v_result);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":511
 *             # free broken document
 *             tree.xmlFreeDoc(result)
 *             result = NULL             # <<<<<<<<<<<<<< 
 * 
 *     if context is not None and context._has_raised():
 */
    __pyx_v_result = NULL;
  }
  __pyx_L9:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":513
 *             result = NULL
 * 
 *     if context is not None and context._has_raised():             # <<<<<<<<<<<<<< 
 *         if result is not NULL:
 *             tree.xmlFreeDoc(result)
 */
__pyx_1 = (((PyObject *)__pyx_v_context) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":513
 *             result = NULL
 * 
 *     if context is not None and context._has_raised():             # <<<<<<<<<<<<<< 
 *         if result is not NULL:
 *             tree.xmlFreeDoc(result)
 */
  __pyx_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));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":514
 * 
 *     if context is not None and context._has_raised():
 *         if result is not NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeDoc(result)
 *             result = NULL
 */
  __pyx_1 = (__pyx_v_result != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":515
 *     if context is not None and context._has_raised():
 *         if result is not NULL:
 *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<< 
 *             result = NULL
 *         context._raise_if_stored()
 */
    xmlFreeDoc(__pyx_v_result);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":516
 *         if result is not NULL:
 *             tree.xmlFreeDoc(result)
 *             result = NULL             # <<<<<<<<<<<<<< 
 *         context._raise_if_stored()
 * 
 */
    __pyx_v_result = NULL;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":517
 *             tree.xmlFreeDoc(result)
 *             result = NULL
 *         context._raise_if_stored()             # <<<<<<<<<<<<<< 
 * 
 *     if result is NULL:
 */
  __pyx_8 = ((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_8 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 517; goto __pyx_L1;}
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":519
 *         context._raise_if_stored()
 * 
 *     if result is NULL:             # <<<<<<<<<<<<<< 
 *         if context is not None:
 *             _raiseParseError(c_ctxt, filename, context._error_log)
 */
__pyx_1 = (__pyx_v_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":520
 * 
 *     if result is NULL:
 *         if context is not None:             # <<<<<<<<<<<<<< 
 *             _raiseParseError(c_ctxt, filename, context._error_log)
 *         else:
 */
  __pyx_1 = (((PyObject *)__pyx_v_context) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":521
 *     if result is NULL:
 *         if context is not None:
 *             _raiseParseError(c_ctxt, filename, context._error_log)             # <<<<<<<<<<<<<< 
 *         else:
 *             _raiseParseError(c_ctxt, filename, None)
 */
    __pyx_8 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt,__pyx_v_filename,__pyx_v_context->_error_log); if (unlikely(__pyx_8 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 521; goto __pyx_L1;}
    goto __pyx_L13;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":523
 *             _raiseParseError(c_ctxt, filename, context._error_log)
 *         else:
 *             _raiseParseError(c_ctxt, filename, None)             # <<<<<<<<<<<<<< 
 *     elif result.URL is NULL and filename is not None:
 *         result.URL = tree.xmlStrdup(_cstr(filename))
 */
    __pyx_8 = __pyx_f_4lxml_5etree__raiseParseError(__pyx_v_c_ctxt,__pyx_v_filename,((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None)); if (unlikely(__pyx_8 == 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 523; goto __pyx_L1;}
  }
  __pyx_L13:;
  goto __pyx_L12;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":524
 *         else:
 *             _raiseParseError(c_ctxt, filename, None)
 *     elif result.URL is NULL and filename is not None:             # <<<<<<<<<<<<<< 
 *         result.URL = tree.xmlStrdup(_cstr(filename))
 *     return result
 */
__pyx_1 = (__pyx_v_result->URL == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":524
 *         else:
 *             _raiseParseError(c_ctxt, filename, None)
 *     elif result.URL is NULL and filename is not None:             # <<<<<<<<<<<<<< 
 *         result.URL = tree.xmlStrdup(_cstr(filename))
 *     return result
 */
  __pyx_1 = (__pyx_v_filename != Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":525
 *             _raiseParseError(c_ctxt, filename, None)
 *     elif result.URL is NULL and filename is not None:
 *         result.URL = tree.xmlStrdup(_cstr(filename))             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
  __pyx_v_result->URL = xmlStrdup(_cstr(__pyx_v_filename));
  goto __pyx_L12;
}
__pyx_L12:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":526
 *     elif result.URL is NULL and filename is not None:
 *         result.URL = tree.xmlStrdup(_cstr(filename))
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree._handleParseResult");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_error);
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":543
 *     cdef int _default_encoding_int
 * 
 *     def __init__(self, int parse_options, bint for_html,             # <<<<<<<<<<<<<< 
 *                  remove_comments, remove_pis,
 *                  target, filename, encoding):
 */

static PyObject *__pyx_n_LookupError;

static PyObject *__pyx_k513p;
static PyObject *__pyx_k514p;

static PyObject *__pyx_builtin_LookupError;

static char __pyx_k513[] = "This class cannot be instantiated";
static char __pyx_k514[] = "unknown encoding: '%s'";

static int __pyx_pf_4lxml_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_parse_options;
int __pyx_v_for_html;
PyObject *__pyx_v_remove_comments = 0;
PyObject *__pyx_v_remove_pis = 0;
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_filename = 0;
PyObject *__pyx_v_encoding = 0;
int __pyx_v_c_encoding;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"parse_options","for_html","remove_comments","remove_pis","target","filename","encoding",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "iiOOOOO", __pyx_argnames, &__pyx_v_parse_options, &__pyx_v_for_html, &__pyx_v_remove_comments, &__pyx_v_remove_pis, &__pyx_v_target, &__pyx_v_filename, &__pyx_v_encoding))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_filename);
Py_INCREF(__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":548
 *         cdef int c_encoding
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if not isinstance(self, HTMLParser) and \             # <<<<<<<<<<<<<< 
 *                 not isinstance(self, XMLParser) and \
 *                 not isinstance(self, iterparse):
 */
__pyx_2 = PyObject_IsInstance(__pyx_v_self,((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 548; goto __pyx_L1;}
__pyx_1 = (!__pyx_2);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":549
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if not isinstance(self, HTMLParser) and \
 *                 not isinstance(self, XMLParser) and \             # <<<<<<<<<<<<<< 
 *                 not isinstance(self, iterparse):
 *             raise TypeError, "This class cannot be instantiated"
 */
  __pyx_2 = PyObject_IsInstance(__pyx_v_self,((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 549; goto __pyx_L1;}
  __pyx_1 = (!__pyx_2);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":550
 *         if not isinstance(self, HTMLParser) and \
 *                 not isinstance(self, XMLParser) and \
 *                 not isinstance(self, iterparse):             # <<<<<<<<<<<<<< 
 *             raise TypeError, "This class cannot be instantiated"
 * 
 */
    __pyx_2 = PyObject_IsInstance(__pyx_v_self,((PyObject*)__pyx_ptype_4lxml_5etree_iterparse)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 550; goto __pyx_L1;}
    __pyx_1 = (!__pyx_2);
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":551
 *                 not isinstance(self, XMLParser) and \
 *                 not isinstance(self, iterparse):
 *             raise TypeError, "This class cannot be instantiated"             # <<<<<<<<<<<<<< 
 * 
 *         self._parse_options = parse_options
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k513p, 0);
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 551; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":553
 *             raise TypeError, "This class cannot be instantiated"
 * 
 *         self._parse_options = parse_options             # <<<<<<<<<<<<<< 
 *         self._filename = filename
 *         self._target = target
 */
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_parse_options = __pyx_v_parse_options;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":554
 * 
 *         self._parse_options = parse_options
 *         self._filename = filename             # <<<<<<<<<<<<<< 
 *         self._target = target
 *         self._for_html = for_html
 */
Py_INCREF(__pyx_v_filename);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_filename);
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_filename = __pyx_v_filename;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":555
 *         self._parse_options = parse_options
 *         self._filename = filename
 *         self._target = target             # <<<<<<<<<<<<<< 
 *         self._for_html = for_html
 *         self._remove_comments = remove_comments
 */
Py_INCREF(__pyx_v_target);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_target);
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_target = __pyx_v_target;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":556
 *         self._filename = filename
 *         self._target = target
 *         self._for_html = for_html             # <<<<<<<<<<<<<< 
 *         self._remove_comments = remove_comments
 *         self._remove_pis = remove_pis
 */
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_for_html = __pyx_v_for_html;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":557
 *         self._target = target
 *         self._for_html = for_html
 *         self._remove_comments = remove_comments             # <<<<<<<<<<<<<< 
 *         self._remove_pis = remove_pis
 * 
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_remove_comments); if (unlikely((__pyx_2 == -1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 557; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":557
 *         self._target = target
 *         self._for_html = for_html
 *         self._remove_comments = remove_comments             # <<<<<<<<<<<<<< 
 *         self._remove_pis = remove_pis
 * 
 */
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_remove_comments = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":558
 *         self._for_html = for_html
 *         self._remove_comments = remove_comments
 *         self._remove_pis = remove_pis             # <<<<<<<<<<<<<< 
 * 
 *         self._resolvers = _ResolverRegistry()
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_pis); if (unlikely((__pyx_1 == -1))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 558; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":558
 *         self._for_html = for_html
 *         self._remove_comments = remove_comments
 *         self._remove_pis = remove_pis             # <<<<<<<<<<<<<< 
 * 
 *         self._resolvers = _ResolverRegistry()
 */
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_remove_pis = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":560
 *         self._remove_pis = remove_pis
 * 
 *         self._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<< 
 * 
 *         if encoding is None:
 */
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ResolverRegistry), 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 560; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 560; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":560
 *         self._remove_pis = remove_pis
 * 
 *         self._resolvers = _ResolverRegistry()             # <<<<<<<<<<<<<< 
 * 
 *         if encoding is None:
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers));
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":562
 *         self._resolvers = _ResolverRegistry()
 * 
 *         if encoding is None:             # <<<<<<<<<<<<<< 
 *             self._default_encoding = None
 *             self._default_encoding_int = tree.XML_CHAR_ENCODING_NONE
 */
__pyx_2 = (__pyx_v_encoding == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":563
 * 
 *         if encoding is None:
 *             self._default_encoding = None             # <<<<<<<<<<<<<< 
 *             self._default_encoding_int = tree.XML_CHAR_ENCODING_NONE
 *         else:
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
  ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding = Py_None;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":564
 *         if encoding is None:
 *             self._default_encoding = None
 *             self._default_encoding_int = tree.XML_CHAR_ENCODING_NONE             # <<<<<<<<<<<<<< 
 *         else:
 *             encoding = _utf8(encoding)
 */
  ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding_int = XML_CHAR_ENCODING_NONE;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":566
 *             self._default_encoding_int = tree.XML_CHAR_ENCODING_NONE
 *         else:
 *             encoding = _utf8(encoding)             # <<<<<<<<<<<<<< 
 *             c_encoding = tree.xmlParseCharEncoding(_cstr(encoding))
 *             if c_encoding == tree.XML_CHAR_ENCODING_ERROR or \
 */
  __pyx_3 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 566; goto __pyx_L1;}
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":567
 *         else:
 *             encoding = _utf8(encoding)
 *             c_encoding = tree.xmlParseCharEncoding(_cstr(encoding))             # <<<<<<<<<<<<<< 
 *             if c_encoding == tree.XML_CHAR_ENCODING_ERROR or \
 *                    c_encoding == tree.XML_CHAR_ENCODING_NONE:
 */
  __pyx_v_c_encoding = xmlParseCharEncoding(_cstr(__pyx_v_encoding));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":568
 *             encoding = _utf8(encoding)
 *             c_encoding = tree.xmlParseCharEncoding(_cstr(encoding))
 *             if c_encoding == tree.XML_CHAR_ENCODING_ERROR or \             # <<<<<<<<<<<<<< 
 *                    c_encoding == tree.XML_CHAR_ENCODING_NONE:
 *                 raise LookupError, "unknown encoding: '%s'" % encoding
 */
  __pyx_1 = (__pyx_v_c_encoding == XML_CHAR_ENCODING_ERROR);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":569
 *             c_encoding = tree.xmlParseCharEncoding(_cstr(encoding))
 *             if c_encoding == tree.XML_CHAR_ENCODING_ERROR or \
 *                    c_encoding == tree.XML_CHAR_ENCODING_NONE:             # <<<<<<<<<<<<<< 
 *                 raise LookupError, "unknown encoding: '%s'" % encoding
 *             self._default_encoding = encoding
 */
    __pyx_1 = (__pyx_v_c_encoding == XML_CHAR_ENCODING_NONE);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":570
 *             if c_encoding == tree.XML_CHAR_ENCODING_ERROR or \
 *                    c_encoding == tree.XML_CHAR_ENCODING_NONE:
 *                 raise LookupError, "unknown encoding: '%s'" % encoding             # <<<<<<<<<<<<<< 
 *             self._default_encoding = encoding
 *             self._default_encoding_int = c_encoding
 */
    __pyx_3 = PyNumber_Remainder(__pyx_k514p, __pyx_v_encoding); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 570; goto __pyx_L1;}
    __Pyx_Raise(__pyx_builtin_LookupError, __pyx_3, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 570; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":571
 *                    c_encoding == tree.XML_CHAR_ENCODING_NONE:
 *                 raise LookupError, "unknown encoding: '%s'" % encoding
 *             self._default_encoding = encoding             # <<<<<<<<<<<<<< 
 *             self._default_encoding_int = c_encoding
 * 
 */
  Py_INCREF(__pyx_v_encoding);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding);
  ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding = __pyx_v_encoding;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":572
 *                 raise LookupError, "unknown encoding: '%s'" % encoding
 *             self._default_encoding = encoding
 *             self._default_encoding_int = c_encoding             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _getParserContext(self):
 */
  ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_default_encoding_int = __pyx_v_c_encoding;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._BaseParser.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_remove_comments);
Py_DECREF(__pyx_v_remove_pis);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_filename);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":574
 *             self._default_encoding_int = c_encoding
 * 
 *     cdef _ParserContext _getParserContext(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._parser_context is None:
 */

static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_BaseParser__getParserContext(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
xmlParserCtxt *__pyx_v_pctxt;
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":576
 *     cdef _ParserContext _getParserContext(self):
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._parser_context is None:             # <<<<<<<<<<<<<< 
 *             self._parser_context = self._createContext(self._target)
 *             pctxt = self._newParserCtxt()
 */
__pyx_1 = (((PyObject *)__pyx_v_self->_parser_context) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":577
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._parser_context is None:
 *             self._parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<< 
 *             pctxt = self._newParserCtxt()
 *             if pctxt is NULL:
 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_createContext(__pyx_v_self,__pyx_v_self->_target)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 577; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":577
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._parser_context is None:
 *             self._parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<< 
 *             pctxt = self._newParserCtxt()
 *             if pctxt is NULL:
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_parser_context));
  __pyx_v_self->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":578
 *         if self._parser_context is None:
 *             self._parser_context = self._createContext(self._target)
 *             pctxt = self._newParserCtxt()             # <<<<<<<<<<<<<< 
 *             if pctxt is NULL:
 *                 python.PyErr_NoMemory()
 */
  __pyx_v_pctxt = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newParserCtxt(__pyx_v_self);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":579
 *             self._parser_context = self._createContext(self._target)
 *             pctxt = self._newParserCtxt()
 *             if pctxt is NULL:             # <<<<<<<<<<<<<< 
 *                 python.PyErr_NoMemory()
 *             _initParserContext(self._parser_context, self._resolvers, pctxt)
 */
  __pyx_1 = (__pyx_v_pctxt == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":580
 *             pctxt = self._newParserCtxt()
 *             if pctxt is NULL:
 *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *             _initParserContext(self._parser_context, self._resolvers, pctxt)
 *             if self._remove_comments:
 */
    __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 580; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":581
 *             if pctxt is NULL:
 *                 python.PyErr_NoMemory()
 *             _initParserContext(self._parser_context, self._resolvers, pctxt)             # <<<<<<<<<<<<<< 
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL
 */
  __pyx_2 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_self->_parser_context,__pyx_v_self->_resolvers,__pyx_v_pctxt); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 581; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":582
 *                 python.PyErr_NoMemory()
 *             _initParserContext(self._parser_context, self._resolvers, pctxt)
 *             if self._remove_comments:             # <<<<<<<<<<<<<< 
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:
 */
  __pyx_1 = __pyx_v_self->_remove_comments;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":583
 *             _initParserContext(self._parser_context, self._resolvers, pctxt)
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL             # <<<<<<<<<<<<<< 
 *             if self._remove_pis:
 *                 pctxt.sax.processingInstruction = NULL
 */
    __pyx_v_pctxt->sax->comment = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":584
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:             # <<<<<<<<<<<<<< 
 *                 pctxt.sax.processingInstruction = NULL
 *             # hard switch-off for CDATA nodes => makes them plain text
 */
  __pyx_1 = __pyx_v_self->_remove_pis;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":585
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:
 *                 pctxt.sax.processingInstruction = NULL             # <<<<<<<<<<<<<< 
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL
 */
    __pyx_v_pctxt->sax->processingInstruction = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":587
 *                 pctxt.sax.processingInstruction = NULL
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL             # <<<<<<<<<<<<<< 
 *         return self._parser_context
 * 
 */
  __pyx_v_pctxt->sax->cdataBlock = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":588
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL
 *         return self._parser_context             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _getPushParserContext(self):
 */
Py_INCREF(((PyObject *)__pyx_v_self->_parser_context));
__pyx_r = __pyx_v_self->_parser_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._getParserContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":590
 *         return self._parser_context
 * 
 *     cdef _ParserContext _getPushParserContext(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._push_parser_context is None:
 */

static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_11_BaseParser__getPushParserContext(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
xmlParserCtxt *__pyx_v_pctxt;
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":592
 *     cdef _ParserContext _getPushParserContext(self):
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._push_parser_context is None:             # <<<<<<<<<<<<<< 
 *             self._push_parser_context = self._createContext(self._target)
 *             pctxt = self._newPushParserCtxt()
 */
__pyx_1 = (((PyObject *)__pyx_v_self->_push_parser_context) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":593
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._push_parser_context is None:
 *             self._push_parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<< 
 *             pctxt = self._newPushParserCtxt()
 *             if pctxt is NULL:
 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_createContext(__pyx_v_self,__pyx_v_self->_target)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 593; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":593
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         if self._push_parser_context is None:
 *             self._push_parser_context = self._createContext(self._target)             # <<<<<<<<<<<<<< 
 *             pctxt = self._newPushParserCtxt()
 *             if pctxt is NULL:
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_push_parser_context));
  __pyx_v_self->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":594
 *         if self._push_parser_context is None:
 *             self._push_parser_context = self._createContext(self._target)
 *             pctxt = self._newPushParserCtxt()             # <<<<<<<<<<<<<< 
 *             if pctxt is NULL:
 *                 python.PyErr_NoMemory()
 */
  __pyx_v_pctxt = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_newPushParserCtxt(__pyx_v_self);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":595
 *             self._push_parser_context = self._createContext(self._target)
 *             pctxt = self._newPushParserCtxt()
 *             if pctxt is NULL:             # <<<<<<<<<<<<<< 
 *                 python.PyErr_NoMemory()
 *             _initParserContext(
 */
  __pyx_1 = (__pyx_v_pctxt == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":596
 *             pctxt = self._newPushParserCtxt()
 *             if pctxt is NULL:
 *                 python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *             _initParserContext(
 *                 self._push_parser_context, self._resolvers, pctxt)
 */
    __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 596; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":598
 *                 python.PyErr_NoMemory()
 *             _initParserContext(
 *                 self._push_parser_context, self._resolvers, pctxt)             # <<<<<<<<<<<<<< 
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL
 */
  __pyx_2 = __pyx_f_4lxml_5etree__initParserContext(__pyx_v_self->_push_parser_context,__pyx_v_self->_resolvers,__pyx_v_pctxt); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 597; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":599
 *             _initParserContext(
 *                 self._push_parser_context, self._resolvers, pctxt)
 *             if self._remove_comments:             # <<<<<<<<<<<<<< 
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:
 */
  __pyx_1 = __pyx_v_self->_remove_comments;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":600
 *                 self._push_parser_context, self._resolvers, pctxt)
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL             # <<<<<<<<<<<<<< 
 *             if self._remove_pis:
 *                 pctxt.sax.processingInstruction = NULL
 */
    __pyx_v_pctxt->sax->comment = NULL;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":601
 *             if self._remove_comments:
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:             # <<<<<<<<<<<<<< 
 *                 pctxt.sax.processingInstruction = NULL
 *             # hard switch-off for CDATA nodes => makes them plain text
 */
  __pyx_1 = __pyx_v_self->_remove_pis;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":602
 *                 pctxt.sax.comment = NULL
 *             if self._remove_pis:
 *                 pctxt.sax.processingInstruction = NULL             # <<<<<<<<<<<<<< 
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL
 */
    __pyx_v_pctxt->sax->processingInstruction = NULL;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":604
 *                 pctxt.sax.processingInstruction = NULL
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL             # <<<<<<<<<<<<<< 
 *         return self._push_parser_context
 * 
 */
  __pyx_v_pctxt->sax->cdataBlock = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":605
 *             # hard switch-off for CDATA nodes => makes them plain text
 *             pctxt.sax.cdataBlock = NULL
 *         return self._push_parser_context             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _createContext(self, target):
 */
Py_INCREF(((PyObject *)__pyx_v_self->_push_parser_context));
__pyx_r = __pyx_v_self->_push_parser_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._getPushParserContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":607
 *         return self._push_parser_context
 * 
 *     cdef _ParserContext _createContext(self, target):             # <<<<<<<<<<<<<< 
 *         cdef _TargetParserContext context
 *         if target is None:
 */

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) {
struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_target);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":609
 *     cdef _ParserContext _createContext(self, target):
 *         cdef _TargetParserContext context
 *         if target is None:             # <<<<<<<<<<<<<< 
 *             return _ParserContext()
 *         context = _TargetParserContext()
 */
__pyx_1 = (__pyx_v_target == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":610
 *         cdef _TargetParserContext context
 *         if target is None:
 *             return _ParserContext()             # <<<<<<<<<<<<<< 
 *         context = _TargetParserContext()
 *         context._setTarget(target)
 */
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ParserContext), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 610; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 610; goto __pyx_L1;}
  __pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":611
 *         if target is None:
 *             return _ParserContext()
 *         context = _TargetParserContext()             # <<<<<<<<<<<<<< 
 *         context._setTarget(target)
 *         return context
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__TargetParserContext), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 611; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__TargetParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 611; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":612
 *             return _ParserContext()
 *         context = _TargetParserContext()
 *         context._setTarget(target)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_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_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 612; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":613
 *         context = _TargetParserContext()
 *         context._setTarget(target)
 *         return context             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context);
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._createContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_target);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":615
 *         return context
 * 
 *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):             # <<<<<<<<<<<<<< 
 *         if self._for_html:
 *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
 */

static char __pyx_k515[] = "dummy";

static  xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
xmlParserCtxt *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":616
 * 
 *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
 *         if self._for_html:             # <<<<<<<<<<<<<< 
 *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
 *         else:
 */
__pyx_1 = __pyx_v_self->_for_html;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":617
 *     cdef xmlparser.xmlParserCtxt* _newParserCtxt(self):
 *         if self._for_html:
 *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)             # <<<<<<<<<<<<<< 
 *         else:
 *             return xmlparser.xmlNewParserCtxt()
 */
  __pyx_r = htmlCreateMemoryParserCtxt(__pyx_k515,5);
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":619
 *             return htmlparser.htmlCreateMemoryParserCtxt('dummy', 5)
 *         else:
 *             return xmlparser.xmlNewParserCtxt()             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlparser.xmlParserCtxt* _newPushParserCtxt(self):
 */
  __pyx_r = xmlNewParserCtxt();
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":621
 *             return xmlparser.xmlNewParserCtxt()
 * 
 *     cdef xmlparser.xmlParserCtxt* _newPushParserCtxt(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlparser.xmlParserCtxt* c_ctxt
 *         cdef char* c_filename
 */

static  xmlParserCtxt *__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
xmlParserCtxt *__pyx_v_c_ctxt;
char *__pyx_v_c_filename;
xmlParserCtxt *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":624
 *         cdef xmlparser.xmlParserCtxt* c_ctxt
 *         cdef char* c_filename
 *         if self._filename is not None:             # <<<<<<<<<<<<<< 
 *             c_filename = _cstr(self._filename)
 *         else:
 */
__pyx_1 = (__pyx_v_self->_filename != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":625
 *         cdef char* c_filename
 *         if self._filename is not None:
 *             c_filename = _cstr(self._filename)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_filename = NULL
 */
  __pyx_v_c_filename = _cstr(__pyx_v_self->_filename);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":627
 *             c_filename = _cstr(self._filename)
 *         else:
 *             c_filename = NULL             # <<<<<<<<<<<<<< 
 *         if self._for_html:
 *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
 */
  __pyx_v_c_filename = NULL;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":628
 *         else:
 *             c_filename = NULL
 *         if self._for_html:             # <<<<<<<<<<<<<< 
 *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
 *                 NULL, NULL, NULL, 0, c_filename, self._default_encoding_int)
 */
__pyx_1 = __pyx_v_self->_for_html;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":630
 *         if self._for_html:
 *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
 *                 NULL, NULL, NULL, 0, c_filename, self._default_encoding_int)             # <<<<<<<<<<<<<< 
 *             if c_ctxt is not NULL:
 *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)
 */
  __pyx_v_c_ctxt = htmlCreatePushParserCtxt(NULL,NULL,NULL,0,__pyx_v_c_filename,__pyx_v_self->_default_encoding_int);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":631
 *             c_ctxt = htmlparser.htmlCreatePushParserCtxt(
 *                 NULL, NULL, NULL, 0, c_filename, self._default_encoding_int)
 *             if c_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)
 *         else:
 */
  __pyx_1 = (__pyx_v_c_ctxt != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":632
 *                 NULL, NULL, NULL, 0, c_filename, self._default_encoding_int)
 *             if c_ctxt is not NULL:
 *                 htmlparser.htmlCtxtUseOptions(c_ctxt, self._parse_options)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
 */
    htmlCtxtUseOptions(__pyx_v_c_ctxt,__pyx_v_self->_parse_options);
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":635
 *         else:
 *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
 *                 NULL, NULL, NULL, 0, c_filename)             # <<<<<<<<<<<<<< 
 *             if c_ctxt is not NULL:
 *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
 */
  __pyx_v_c_ctxt = xmlCreatePushParserCtxt(NULL,NULL,NULL,0,__pyx_v_c_filename);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":636
 *             c_ctxt = xmlparser.xmlCreatePushParserCtxt(
 *                 NULL, NULL, NULL, 0, c_filename)
 *             if c_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
 *                 if self._default_encoding_int != tree.XML_CHAR_ENCODING_NONE:
 */
  __pyx_1 = (__pyx_v_c_ctxt != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":637
 *                 NULL, NULL, NULL, 0, c_filename)
 *             if c_ctxt is not NULL:
 *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)             # <<<<<<<<<<<<<< 
 *                 if self._default_encoding_int != tree.XML_CHAR_ENCODING_NONE:
 *                     xmlparser.xmlSwitchEncoding(
 */
    xmlCtxtUseOptions(__pyx_v_c_ctxt,__pyx_v_self->_parse_options);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":638
 *             if c_ctxt is not NULL:
 *                 xmlparser.xmlCtxtUseOptions(c_ctxt, self._parse_options)
 *                 if self._default_encoding_int != tree.XML_CHAR_ENCODING_NONE:             # <<<<<<<<<<<<<< 
 *                     xmlparser.xmlSwitchEncoding(
 *                         c_ctxt, self._default_encoding_int)
 */
    __pyx_1 = (__pyx_v_self->_default_encoding_int != XML_CHAR_ENCODING_NONE);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":640
 *                 if self._default_encoding_int != tree.XML_CHAR_ENCODING_NONE:
 *                     xmlparser.xmlSwitchEncoding(
 *                         c_ctxt, self._default_encoding_int)             # <<<<<<<<<<<<<< 
 *         return c_ctxt
 * 
 */
      xmlSwitchEncoding(__pyx_v_c_ctxt,__pyx_v_self->_default_encoding_int);
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":641
 *                     xmlparser.xmlSwitchEncoding(
 *                         c_ctxt, self._default_encoding_int)
 *         return c_ctxt             # <<<<<<<<<<<<<< 
 * 
 *     property error_log:
 */
__pyx_r = __pyx_v_c_ctxt;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":646
 *         """The error log of the last parser run.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef _ParserContext context
 *             context = self._getParserContext()
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(PyObject *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":648
 *         def __get__(self):
 *             cdef _ParserContext context
 *             context = self._getParserContext()             # <<<<<<<<<<<<<< 
 *             return context._error_log.copy()
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 648; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":649
 *             cdef _ParserContext context
 *             context = self._getParserContext()
 *             return context._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 *     property resolvers:
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 649; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 649; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser.error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":652
 * 
 *     property resolvers:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return self._resolvers
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":653
 *     property resolvers:
 *         def __get__(self):
 *             return self._resolvers             # <<<<<<<<<<<<<< 
 * 
 *     property version:
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers));
__pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_resolvers);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":657
 *     property version:
 *         "The version of the underlying XML parser."
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return "libxml2 %d.%d.%d" % LIBXML_VERSION
 * 
 */

static PyObject *__pyx_k516p;

static char __pyx_k516[] = "libxml2 %d.%d.%d";

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":658
 *         "The version of the underlying XML parser."
 *         def __get__(self):
 *             return "libxml2 %d.%d.%d" % LIBXML_VERSION             # <<<<<<<<<<<<<< 
 * 
 *     def setElementClassLookup(self, ElementClassLookup lookup = None):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LIBXML_VERSION); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 658; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k516p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 658; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser.version.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":660
 *             return "libxml2 %d.%d.%d" % LIBXML_VERSION
 * 
 *     def setElementClassLookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *         "Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead."
 *         self.set_element_class_lookup(lookup)
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_11_BaseParser_setElementClassLookup[] = "Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead.";
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_lookup = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"lookup",0};
__pyx_v_lookup = __pyx_k169;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lookup);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup"))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 660; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":662
 *     def setElementClassLookup(self, ElementClassLookup lookup = None):
 *         "Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead."
 *         self.set_element_class_lookup(lookup)             # <<<<<<<<<<<<<< 
 * 
 *     def set_element_class_lookup(self, ElementClassLookup lookup = None):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_set_element_class_lookup); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 662; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":662
 *     def setElementClassLookup(self, ElementClassLookup lookup = None):
 *         "Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead."
 *         self.set_element_class_lookup(lookup)             # <<<<<<<<<<<<<< 
 * 
 *     def set_element_class_lookup(self, ElementClassLookup lookup = None):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 662; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_lookup));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_lookup));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 662; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._BaseParser.setElementClassLookup");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":664
 *         self.set_element_class_lookup(lookup)
 * 
 *     def set_element_class_lookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *         """Set a lookup scheme for element classes generated from this parser.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_11_BaseParser_set_element_class_lookup[] = "Set a lookup scheme for element classes generated from this parser.\n\n        Reset it by passing None or nothing.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementClassLookup *__pyx_v_lookup = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"lookup",0};
__pyx_v_lookup = __pyx_k170;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lookup);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_4lxml_5etree_ElementClassLookup, 1, "lookup"))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 664; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":669
 *         Reset it by passing None or nothing.
 *         """
 *         self._class_lookup = lookup             # <<<<<<<<<<<<<< 
 * 
 *     cdef _BaseParser _copy(self):
 */
Py_INCREF(((PyObject *)__pyx_v_lookup));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_class_lookup));
((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_self)->_class_lookup = __pyx_v_lookup;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._BaseParser.set_element_class_lookup");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":671
 *         self._class_lookup = lookup
 * 
 *     cdef _BaseParser _copy(self):             # <<<<<<<<<<<<<< 
 *         "Create a new parser with the same configuration."
 *         cdef _BaseParser parser
 */

static  struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_f_4lxml_5etree_11_BaseParser__copy(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser;
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":674
 *         "Create a new parser with the same configuration."
 *         cdef _BaseParser parser
 *         parser = self.__class__()             # <<<<<<<<<<<<<< 
 *         parser._parse_options = self._parse_options
 *         parser._for_html = self._for_html
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n___class__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 674; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 674; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__BaseParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 674; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_parser));
__pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":675
 *         cdef _BaseParser parser
 *         parser = self.__class__()
 *         parser._parse_options = self._parse_options             # <<<<<<<<<<<<<< 
 *         parser._for_html = self._for_html
 *         parser._remove_comments = self._remove_comments
 */
__pyx_v_parser->_parse_options = __pyx_v_self->_parse_options;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":676
 *         parser = self.__class__()
 *         parser._parse_options = self._parse_options
 *         parser._for_html = self._for_html             # <<<<<<<<<<<<<< 
 *         parser._remove_comments = self._remove_comments
 *         parser._remove_pis = self._remove_pis
 */
__pyx_v_parser->_for_html = __pyx_v_self->_for_html;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":677
 *         parser._parse_options = self._parse_options
 *         parser._for_html = self._for_html
 *         parser._remove_comments = self._remove_comments             # <<<<<<<<<<<<<< 
 *         parser._remove_pis = self._remove_pis
 *         parser._filename = self._filename
 */
__pyx_v_parser->_remove_comments = __pyx_v_self->_remove_comments;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":678
 *         parser._for_html = self._for_html
 *         parser._remove_comments = self._remove_comments
 *         parser._remove_pis = self._remove_pis             # <<<<<<<<<<<<<< 
 *         parser._filename = self._filename
 *         parser._resolvers = self._resolvers
 */
__pyx_v_parser->_remove_pis = __pyx_v_self->_remove_pis;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":679
 *         parser._remove_comments = self._remove_comments
 *         parser._remove_pis = self._remove_pis
 *         parser._filename = self._filename             # <<<<<<<<<<<<<< 
 *         parser._resolvers = self._resolvers
 *         parser._target = self._target
 */
Py_INCREF(__pyx_v_self->_filename);
Py_DECREF(__pyx_v_parser->_filename);
__pyx_v_parser->_filename = __pyx_v_self->_filename;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":680
 *         parser._remove_pis = self._remove_pis
 *         parser._filename = self._filename
 *         parser._resolvers = self._resolvers             # <<<<<<<<<<<<<< 
 *         parser._target = self._target
 *         parser._class_lookup  = self._class_lookup
 */
Py_INCREF(((PyObject *)__pyx_v_self->_resolvers));
Py_DECREF(((PyObject *)__pyx_v_parser->_resolvers));
__pyx_v_parser->_resolvers = __pyx_v_self->_resolvers;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":681
 *         parser._filename = self._filename
 *         parser._resolvers = self._resolvers
 *         parser._target = self._target             # <<<<<<<<<<<<<< 
 *         parser._class_lookup  = self._class_lookup
 *         return parser
 */
Py_INCREF(__pyx_v_self->_target);
Py_DECREF(__pyx_v_parser->_target);
__pyx_v_parser->_target = __pyx_v_self->_target;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":682
 *         parser._resolvers = self._resolvers
 *         parser._target = self._target
 *         parser._class_lookup  = self._class_lookup             # <<<<<<<<<<<<<< 
 *         return parser
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_self->_class_lookup));
Py_DECREF(((PyObject *)__pyx_v_parser->_class_lookup));
__pyx_v_parser->_class_lookup = __pyx_v_self->_class_lookup;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":683
 *         parser._target = self._target
 *         parser._class_lookup  = self._class_lookup
 *         return parser             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_INCREF(((PyObject *)__pyx_v_parser));
__pyx_r = __pyx_v_parser;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":685
 *         return parser
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         "Create a new parser with the same configuration."
 *         return self._copy()
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_11_BaseParser_copy[] = "Create a new parser with the same configuration.";
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":687
 *     def copy(self):
 *         "Create a new parser with the same configuration."
 *         return self._copy()             # <<<<<<<<<<<<<< 
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 687; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._BaseParser.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":689
 *         return self._copy()
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with this parser.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_11_BaseParser_makeelement[] = "Creates a new element associated with this parser.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_11_BaseParser_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__tag = 0;
PyObject *__pyx_v_attrib = 0;
PyObject *__pyx_v_nsmap = 0;
PyObject *__pyx_v__extra = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"_tag","attrib","nsmap",0};
__pyx_v_attrib = __pyx_k171;
__pyx_v_nsmap = __pyx_k172;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v__tag, &__pyx_v_attrib, &__pyx_v_nsmap))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__extra);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":693
 *         """
 *         return _makeElement(_tag, NULL, None, self, None, None,
 *                             attrib, nsmap, _extra)             # <<<<<<<<<<<<<< 
 * 
 *     # internal parser methods
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 692; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._BaseParser.makeelement");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__extra);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":697
 *     # internal parser methods
 * 
 *     cdef xmlDoc* _parseUnicodeDoc(self, utext, char* c_filename) except NULL:             # <<<<<<<<<<<<<< 
 *         """Parse unicode document, share dictionary if possible.
 *         """
 */

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) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
xmlDoc *__pyx_v_result;
xmlParserCtxt *__pyx_v_pctxt;
Py_ssize_t __pyx_v_py_buffer_len;
int __pyx_v_buffer_len;
char *__pyx_v_c_text;
PyObject *__pyx_v_text_utf;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
int __pyx_4;
xmlDoc *__pyx_5;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_utext);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_text_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":706
 *         cdef int buffer_len
 *         cdef char* c_text
 *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)             # <<<<<<<<<<<<<< 
 *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
 *             text_utf = python.PyUnicode_AsUTF8String(utext)
 */
__pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":707
 *         cdef char* c_text
 *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)
 *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<< 
 *             text_utf = python.PyUnicode_AsUTF8String(utext)
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
 */
__pyx_1 = (__pyx_v_py_buffer_len > INT_MAX);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":707
 *         cdef char* c_text
 *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)
 *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<< 
 *             text_utf = python.PyUnicode_AsUTF8String(utext)
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
 */
  __pyx_1 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":708
 *         py_buffer_len = python.PyUnicode_GET_DATA_SIZE(utext)
 *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
 *             text_utf = python.PyUnicode_AsUTF8String(utext)             # <<<<<<<<<<<<<< 
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
 *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_utext); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 708; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text_utf);
  __pyx_v_text_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":709
 *         if py_buffer_len > python.INT_MAX or _UNICODE_ENCODING is NULL:
 *             text_utf = python.PyUnicode_AsUTF8String(utext)
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)             # <<<<<<<<<<<<<< 
 *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
 *         buffer_len = py_buffer_len
 */
  __pyx_v_py_buffer_len = PyString_GET_SIZE(__pyx_v_text_utf);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":710
 *             text_utf = python.PyUnicode_AsUTF8String(utext)
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
 *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)             # <<<<<<<<<<<<<< 
 *         buffer_len = py_buffer_len
 * 
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_parseDoc(__pyx_v_self,_cstr(__pyx_v_text_utf),__pyx_v_py_buffer_len,__pyx_v_c_filename); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 710; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":711
 *             py_buffer_len = python.PyString_GET_SIZE(text_utf)
 *             return self._parseDoc(_cstr(text_utf), py_buffer_len, c_filename)
 *         buffer_len = py_buffer_len             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getParserContext()
 */
__pyx_v_buffer_len = __pyx_v_py_buffer_len;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":713
 *         buffer_len = py_buffer_len
 * 
 *         context = self._getParserContext()             # <<<<<<<<<<<<<< 
 *         context.prepare()
 *         try:
 */
__pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 713; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":714
 * 
 *         context = self._getParserContext()
 *         context.prepare()             # <<<<<<<<<<<<<< 
 *         try:
 *             pctxt = context._c_ctxt
 */
__pyx_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 714; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":715
 *         context = self._getParserContext()
 *         context.prepare()
 *         try:             # <<<<<<<<<<<<<< 
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":716
 *         context.prepare()
 *         try:
 *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 */
  __pyx_v_pctxt = __pyx_v_context->_c_ctxt;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":717
 *         try:
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<< 
 * 
 *             c_text = python.PyUnicode_AS_DATA(utext)
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":719
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 *             c_text = python.PyUnicode_AS_DATA(utext)             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 if self._for_html:
 */
  __pyx_v_c_text = PyUnicode_AS_DATA(__pyx_v_utext);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":720
 * 
 *             c_text = python.PyUnicode_AS_DATA(utext)
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 if self._for_html:
 *                     result = htmlparser.htmlCtxtReadMemory(
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":721
 *             c_text = python.PyUnicode_AS_DATA(utext)
 *             with nogil:
 *                 if self._for_html:             # <<<<<<<<<<<<<< 
 *                     result = htmlparser.htmlCtxtReadMemory(
 *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
 */
      __pyx_1 = __pyx_v_self->_for_html;
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":724
 *                     result = htmlparser.htmlCtxtReadMemory(
 *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
 *                         self._parse_options)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     result = xmlparser.xmlCtxtReadMemory(
 */
        __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);
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":728
 *                     result = xmlparser.xmlCtxtReadMemory(
 *                         pctxt, c_text, buffer_len, c_filename, _UNICODE_ENCODING,
 *                         self._parse_options)             # <<<<<<<<<<<<<< 
 * 
 *             return context._handleParseResultDoc(self, result, None)
 */
        __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);
      }
      __pyx_L9:;
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":730
 *                         self._parse_options)
 * 
 *             return context._handleParseResultDoc(self, result, None)             # <<<<<<<<<<<<<< 
 *         finally:
 *             context.cleanup()
 */
  __pyx_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_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 730; goto __pyx_L4;}
  __pyx_r = __pyx_5;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L3: __pyx_why = 3; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":732
 *             return context._handleParseResultDoc(self, result, None)
 *         finally:
 *             context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _parseDoc(self, char* c_text, Py_ssize_t c_len,
 */
  __pyx_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 732; goto __pyx_L10;}
  goto __pyx_L11;
  __pyx_L10:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L11:;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._parseUnicodeDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_text_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_utext);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":734
 *             context.cleanup()
 * 
 *     cdef xmlDoc* _parseDoc(self, char* c_text, Py_ssize_t c_len,             # <<<<<<<<<<<<<< 
 *                            char* c_filename) except NULL:
 *         """Parse document, share dictionary if possible.
 */

static PyObject *__pyx_k517p;

static char __pyx_k517[] = "string is too long to parse it with libxml2";

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) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
xmlDoc *__pyx_v_result;
xmlParserCtxt *__pyx_v_pctxt;
char *__pyx_v_c_encoding;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
xmlDoc *__pyx_4;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":742
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         cdef char* c_encoding
 *         if c_len > python.INT_MAX:             # <<<<<<<<<<<<<< 
 *             raise ParserError, "string is too long to parse it with libxml2"
 * 
 */
__pyx_1 = (__pyx_v_c_len > INT_MAX);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":743
 *         cdef char* c_encoding
 *         if c_len > python.INT_MAX:
 *             raise ParserError, "string is too long to parse it with libxml2"             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getParserContext()
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 743; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":743
 *         cdef char* c_encoding
 *         if c_len > python.INT_MAX:
 *             raise ParserError, "string is too long to parse it with libxml2"             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getParserContext()
 */
  __Pyx_Raise(__pyx_2, __pyx_k517p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 743; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":745
 *             raise ParserError, "string is too long to parse it with libxml2"
 * 
 *         context = self._getParserContext()             # <<<<<<<<<<<<<< 
 *         context.prepare()
 *         try:
 */
__pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 745; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":746
 * 
 *         context = self._getParserContext()
 *         context.prepare()             # <<<<<<<<<<<<<< 
 *         try:
 *             pctxt = context._c_ctxt
 */
__pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 746; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":747
 *         context = self._getParserContext()
 *         context.prepare()
 *         try:             # <<<<<<<<<<<<<< 
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":748
 *         context.prepare()
 *         try:
 *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 */
  __pyx_v_pctxt = __pyx_v_context->_c_ctxt;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":749
 *         try:
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<< 
 * 
 *             if self._default_encoding is None:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":751
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 *             if self._default_encoding is None:             # <<<<<<<<<<<<<< 
 *                 c_encoding = NULL
 *             else:
 */
  __pyx_1 = (__pyx_v_self->_default_encoding == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":752
 * 
 *             if self._default_encoding is None:
 *                 c_encoding = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_encoding = _cstr(self._default_encoding)
 */
    __pyx_v_c_encoding = NULL;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":754
 *                 c_encoding = NULL
 *             else:
 *                 c_encoding = _cstr(self._default_encoding)             # <<<<<<<<<<<<<< 
 * 
 *             with nogil:
 */
    __pyx_v_c_encoding = _cstr(__pyx_v_self->_default_encoding);
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":756
 *                 c_encoding = _cstr(self._default_encoding)
 * 
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 if self._for_html:
 *                     result = htmlparser.htmlCtxtReadMemory(
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":757
 * 
 *             with nogil:
 *                 if self._for_html:             # <<<<<<<<<<<<<< 
 *                     result = htmlparser.htmlCtxtReadMemory(
 *                         pctxt, c_text, c_len, c_filename,
 */
      __pyx_1 = __pyx_v_self->_for_html;
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":760
 *                     result = htmlparser.htmlCtxtReadMemory(
 *                         pctxt, c_text, c_len, c_filename,
 *                         c_encoding, self._parse_options)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     result = xmlparser.xmlCtxtReadMemory(
 */
        __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);
        goto __pyx_L10;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":764
 *                     result = xmlparser.xmlCtxtReadMemory(
 *                         pctxt, c_text, c_len, c_filename,
 *                         c_encoding, self._parse_options)             # <<<<<<<<<<<<<< 
 * 
 *             return context._handleParseResultDoc(self, result, None)
 */
        __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);
      }
      __pyx_L10:;
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":766
 *                         c_encoding, self._parse_options)
 * 
 *             return context._handleParseResultDoc(self, result, None)             # <<<<<<<<<<<<<< 
 *         finally:
 *             context.cleanup()
 */
  __pyx_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_4 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 766; goto __pyx_L4;}
  __pyx_r = __pyx_4;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L3: __pyx_why = 3; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":768
 *             return context._handleParseResultDoc(self, result, None)
 *         finally:
 *             context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _parseDocFromFile(self, char* c_filename) except NULL:
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 768; goto __pyx_L11;}
  goto __pyx_L12;
  __pyx_L11:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L12:;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseParser._parseDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":770
 *             context.cleanup()
 * 
 *     cdef xmlDoc* _parseDocFromFile(self, char* c_filename) except NULL:             # <<<<<<<<<<<<<< 
 *         cdef _ParserContext context
 *         cdef xmlDoc* result
 */

static  xmlDoc *__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile(struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_self,char *__pyx_v_c_filename) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
xmlDoc *__pyx_v_result;
xmlParserCtxt *__pyx_v_pctxt;
int __pyx_v_orig_options;
char *__pyx_v_c_encoding;
xmlDoc *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
xmlDoc *__pyx_4;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":776
 *         cdef int orig_options
 *         cdef char* c_encoding
 *         result = NULL             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getParserContext()
 */
__pyx_v_result = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":778
 *         result = NULL
 * 
 *         context = self._getParserContext()             # <<<<<<<<<<<<<< 
 *         context.prepare()
 *         try:
 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 778; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":779
 * 
 *         context = self._getParserContext()
 *         context.prepare()             # <<<<<<<<<<<<<< 
 *         try:
 *             pctxt = context._c_ctxt
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 779; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":780
 *         context = self._getParserContext()
 *         context.prepare()
 *         try:             # <<<<<<<<<<<<<< 
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":781
 *         context.prepare()
 *         try:
 *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 */
  __pyx_v_pctxt = __pyx_v_context->_c_ctxt;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":782
 *         try:
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<< 
 * 
 *             if self._default_encoding is None:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":784
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 *             if self._default_encoding is None:             # <<<<<<<<<<<<<< 
 *                 c_encoding = NULL
 *             else:
 */
  __pyx_3 = (__pyx_v_self->_default_encoding == Py_None);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":785
 * 
 *             if self._default_encoding is None:
 *                 c_encoding = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_encoding = _cstr(self._default_encoding)
 */
    __pyx_v_c_encoding = NULL;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":787
 *                 c_encoding = NULL
 *             else:
 *                 c_encoding = _cstr(self._default_encoding)             # <<<<<<<<<<<<<< 
 * 
 *             orig_options = pctxt.options
 */
    __pyx_v_c_encoding = _cstr(__pyx_v_self->_default_encoding);
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":789
 *                 c_encoding = _cstr(self._default_encoding)
 * 
 *             orig_options = pctxt.options             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 if self._for_html:
 */
  __pyx_v_orig_options = __pyx_v_pctxt->options;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":790
 * 
 *             orig_options = pctxt.options
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 if self._for_html:
 *                     result = htmlparser.htmlCtxtReadFile(
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":791
 *             orig_options = pctxt.options
 *             with nogil:
 *                 if self._for_html:             # <<<<<<<<<<<<<< 
 *                     result = htmlparser.htmlCtxtReadFile(
 *                         pctxt, c_filename, c_encoding, self._parse_options)
 */
      __pyx_3 = __pyx_v_self->_for_html;
      if (__pyx_3) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":793
 *                 if self._for_html:
 *                     result = htmlparser.htmlCtxtReadFile(
 *                         pctxt, c_filename, c_encoding, self._parse_options)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     result = xmlparser.xmlCtxtReadFile(
 */
        __pyx_v_result = htmlCtxtReadFile(__pyx_v_pctxt,__pyx_v_c_filename,__pyx_v_c_encoding,__pyx_v_self->_parse_options);
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":796
 *                 else:
 *                     result = xmlparser.xmlCtxtReadFile(
 *                         pctxt, c_filename, c_encoding, self._parse_options)             # <<<<<<<<<<<<<< 
 *             pctxt.options = orig_options # work around libxml2 problem
 * 
 */
        __pyx_v_result = xmlCtxtReadFile(__pyx_v_pctxt,__pyx_v_c_filename,__pyx_v_c_encoding,__pyx_v_self->_parse_options);
      }
      __pyx_L9:;
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":797
 *                     result = xmlparser.xmlCtxtReadFile(
 *                         pctxt, c_filename, c_encoding, self._parse_options)
 *             pctxt.options = orig_options # work around libxml2 problem             # <<<<<<<<<<<<<< 
 * 
 *             return context._handleParseResultDoc(self, result, c_filename)
 */
  __pyx_v_pctxt->options = __pyx_v_orig_options;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":799
 *             pctxt.options = orig_options # work around libxml2 problem
 * 
 *             return context._handleParseResultDoc(self, result, c_filename)             # <<<<<<<<<<<<<< 
 *         finally:
 *             context.cleanup()
 */
  __pyx_1 = PyString_FromString(__pyx_v_c_filename); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 799; goto __pyx_L3;}
  __pyx_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_1); if (unlikely(__pyx_4 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 799; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = __pyx_4;
  goto __pyx_L2;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L2: __pyx_why = 3; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":801
 *             return context._handleParseResultDoc(self, result, c_filename)
 *         finally:
 *             context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _parseDocFromFilelike(self, filelike, filename) except NULL:
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 801; goto __pyx_L10;}
  goto __pyx_L11;
  __pyx_L10:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L11:;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._BaseParser._parseDocFromFile");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":803
 *             context.cleanup()
 * 
 *     cdef xmlDoc* _parseDocFromFilelike(self, filelike, filename) except NULL:             # <<<<<<<<<<<<<< 
 *         cdef _ParserContext context
 *         cdef _FileReaderContext file_context
 */

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) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_file_context;
xmlDoc *__pyx_v_result;
xmlParserCtxt *__pyx_v_pctxt;
xmlDoc *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
xmlDoc *__pyx_6;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filelike);
Py_INCREF(__pyx_v_filename);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":809
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         cdef char* c_filename
 *         if not filename:             # <<<<<<<<<<<<<< 
 *             filename = None
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_filename); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 809; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":810
 *         cdef char* c_filename
 *         if not filename:
 *             filename = None             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getParserContext()
 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = Py_None;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":812
 *             filename = None
 * 
 *         context = self._getParserContext()             # <<<<<<<<<<<<<< 
 *         context.prepare()
 *         try:
 */
__pyx_3 = ((PyObject *)((struct __pyx_vtabstruct_4lxml_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_getParserContext(__pyx_v_self)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 812; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":813
 * 
 *         context = self._getParserContext()
 *         context.prepare()             # <<<<<<<<<<<<<< 
 *         try:
 *             pctxt = context._c_ctxt
 */
__pyx_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 813; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":814
 *         context = self._getParserContext()
 *         context.prepare()
 *         try:             # <<<<<<<<<<<<<< 
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":815
 *         context.prepare()
 *         try:
 *             pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 *             file_context = _FileReaderContext(
 */
  __pyx_v_pctxt = __pyx_v_context->_c_ctxt;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":816
 *         try:
 *             pctxt = context._c_ctxt
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<< 
 *             file_context = _FileReaderContext(
 *                 filelike, context, filename, self._default_encoding)
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":818
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 *             file_context = _FileReaderContext(
 *                 filelike, context, filename, self._default_encoding)             # <<<<<<<<<<<<<< 
 *             result = file_context._readDoc(pctxt, self._parse_options)
 * 
 */
  __pyx_3 = PyTuple_New(4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 817; goto __pyx_L4;}
  Py_INCREF(__pyx_v_filelike);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filelike);
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_context));
  Py_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_filename);
  Py_INCREF(__pyx_v_self->_default_encoding);
  PyTuple_SET_ITEM(__pyx_3, 3, __pyx_v_self->_default_encoding);
  __pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext), __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 817; goto __pyx_L4;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__FileReaderContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 817; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_file_context));
  __pyx_v_file_context = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_5);
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":819
 *             file_context = _FileReaderContext(
 *                 filelike, context, filename, self._default_encoding)
 *             result = file_context._readDoc(pctxt, self._parse_options)             # <<<<<<<<<<<<<< 
 * 
 *             return context._handleParseResultDoc(
 */
  __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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":822
 * 
 *             return context._handleParseResultDoc(
 *                 self, result, filename)             # <<<<<<<<<<<<<< 
 *         finally:
 *             context.cleanup()
 */
  __pyx_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_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 821; goto __pyx_L4;}
  __pyx_r = __pyx_6;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L3: __pyx_why = 3; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_5); __pyx_5 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":824
 *                 self, result, filename)
 *         finally:
 *             context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
  __pyx_4 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 824; goto __pyx_L6;}
  goto __pyx_L7;
  __pyx_L6:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L7:;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._BaseParser._parseDocFromFilelike");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_file_context);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_filelike);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":839
 *         different from what the ``error_log`` property returns.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()
 */

static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(PyObject *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":841
 *         def __get__(self):
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *             return context._error_log.copy()
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 841; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":842
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()
 *             return context._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 *     def feed(self, data):
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 842; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 842; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._FeedParser.feed_error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":844
 *             return context._error_log.copy()
 * 
 *     def feed(self, data):             # <<<<<<<<<<<<<< 
 *         """Feeds data to the parser.  The argument should be an 8-bit string
 *         buffer containing encoded data, although Unicode is supported as long
 */

static PyObject *__pyx_k518p;
static PyObject *__pyx_k519p;

static char __pyx_k518[] = "Unicode parsing is not supported on this platform";
static char __pyx_k519[] = "Parsing requires string data";

static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_feed(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_4lxml_5etree_11_FeedParser_feed[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_feed(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_pctxt;
Py_ssize_t __pyx_v_py_buffer_len;
char *__pyx_v_c_data;
char *__pyx_v_c_encoding;
int __pyx_v_buffer_len;
int __pyx_v_error;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
char *__pyx_3;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_data);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":867
 *         cdef int buffer_len
 *         cdef int error
 *         if python.PyString_Check(data):             # <<<<<<<<<<<<<< 
 *             if self._default_encoding is None:
 *                 c_encoding = NULL
 */
__pyx_1 = PyString_Check(__pyx_v_data);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":868
 *         cdef int error
 *         if python.PyString_Check(data):
 *             if self._default_encoding is None:             # <<<<<<<<<<<<<< 
 *                 c_encoding = NULL
 *             else:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._default_encoding == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":869
 *         if python.PyString_Check(data):
 *             if self._default_encoding is None:
 *                 c_encoding = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 c_encoding = self._default_encoding
 */
    __pyx_v_c_encoding = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":871
 *                 c_encoding = NULL
 *             else:
 *                 c_encoding = self._default_encoding             # <<<<<<<<<<<<<< 
 *             c_data = _cstr(data)
 *             py_buffer_len = python.PyString_GET_SIZE(data)
 */
    __pyx_3 = PyString_AsString(((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._default_encoding); if (unlikely((!__pyx_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 871; goto __pyx_L1;}
    __pyx_v_c_encoding = __pyx_3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":872
 *             else:
 *                 c_encoding = self._default_encoding
 *             c_data = _cstr(data)             # <<<<<<<<<<<<<< 
 *             py_buffer_len = python.PyString_GET_SIZE(data)
 *         elif python.PyUnicode_Check(data):
 */
  __pyx_v_c_data = _cstr(__pyx_v_data);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":873
 *                 c_encoding = self._default_encoding
 *             c_data = _cstr(data)
 *             py_buffer_len = python.PyString_GET_SIZE(data)             # <<<<<<<<<<<<<< 
 *         elif python.PyUnicode_Check(data):
 *             if _UNICODE_ENCODING is NULL:
 */
  __pyx_v_py_buffer_len = PyString_GET_SIZE(__pyx_v_data);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":874
 *             c_data = _cstr(data)
 *             py_buffer_len = python.PyString_GET_SIZE(data)
 *         elif python.PyUnicode_Check(data):             # <<<<<<<<<<<<<< 
 *             if _UNICODE_ENCODING is NULL:
 *                 raise ParserError, \
 */
__pyx_1 = PyUnicode_Check(__pyx_v_data);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":875
 *             py_buffer_len = python.PyString_GET_SIZE(data)
 *         elif python.PyUnicode_Check(data):
 *             if _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<< 
 *                 raise ParserError, \
 *                       "Unicode parsing is not supported on this platform"
 */
  __pyx_2 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":876
 *         elif python.PyUnicode_Check(data):
 *             if _UNICODE_ENCODING is NULL:
 *                 raise ParserError, \             # <<<<<<<<<<<<<< 
 *                       "Unicode parsing is not supported on this platform"
 *             c_encoding = _UNICODE_ENCODING
 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 876; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":877
 *             if _UNICODE_ENCODING is NULL:
 *                 raise ParserError, \
 *                       "Unicode parsing is not supported on this platform"             # <<<<<<<<<<<<<< 
 *             c_encoding = _UNICODE_ENCODING
 *             c_data = python.PyUnicode_AS_DATA(data)
 */
    __Pyx_Raise(__pyx_4, __pyx_k518p, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 876; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":878
 *                 raise ParserError, \
 *                       "Unicode parsing is not supported on this platform"
 *             c_encoding = _UNICODE_ENCODING             # <<<<<<<<<<<<<< 
 *             c_data = python.PyUnicode_AS_DATA(data)
 *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
 */
  __pyx_v_c_encoding = __pyx_v_4lxml_5etree__UNICODE_ENCODING;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":879
 *                       "Unicode parsing is not supported on this platform"
 *             c_encoding = _UNICODE_ENCODING
 *             c_data = python.PyUnicode_AS_DATA(data)             # <<<<<<<<<<<<<< 
 *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
 *         else:
 */
  __pyx_v_c_data = PyUnicode_AS_DATA(__pyx_v_data);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":880
 *             c_encoding = _UNICODE_ENCODING
 *             c_data = python.PyUnicode_AS_DATA(data)
 *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "Parsing requires string data"
 */
  __pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_data);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":882
 *             py_buffer_len = python.PyUnicode_GET_DATA_SIZE(data)
 *         else:
 *             raise TypeError, "Parsing requires string data"             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getPushParserContext()
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k519p, 0);
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 882; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":884
 *             raise TypeError, "Parsing requires string data"
 * 
 *         context = self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *         pctxt = context._c_ctxt
 *         error = 0
 */
__pyx_4 = ((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_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 884; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":885
 * 
 *         context = self._getPushParserContext()
 *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *         error = 0
 *         if not self._feed_parser_running:
 */
__pyx_v_pctxt = __pyx_v_context->_c_ctxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":886
 *         context = self._getPushParserContext()
 *         pctxt = context._c_ctxt
 *         error = 0             # <<<<<<<<<<<<<< 
 *         if not self._feed_parser_running:
 *             context.prepare()
 */
__pyx_v_error = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":887
 *         pctxt = context._c_ctxt
 *         error = 0
 *         if not self._feed_parser_running:             # <<<<<<<<<<<<<< 
 *             context.prepare()
 *             self._feed_parser_running = 1
 */
__pyx_2 = (!((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":888
 *         error = 0
 *         if not self._feed_parser_running:
 *             context.prepare()             # <<<<<<<<<<<<<< 
 *             self._feed_parser_running = 1
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 */
  __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->prepare(__pyx_v_context); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 888; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":889
 *         if not self._feed_parser_running:
 *             context.prepare()
 *             self._feed_parser_running = 1             # <<<<<<<<<<<<<< 
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 */
  ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":890
 *             context.prepare()
 *             self._feed_parser_running = 1
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)             # <<<<<<<<<<<<<< 
 * 
 *             if py_buffer_len > python.INT_MAX:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":892
 *             __GLOBAL_PARSER_CONTEXT.initParserDict(pctxt)
 * 
 *             if py_buffer_len > python.INT_MAX:             # <<<<<<<<<<<<<< 
 *                 buffer_len = python.INT_MAX
 *             else:
 */
  __pyx_2 = (__pyx_v_py_buffer_len > INT_MAX);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":893
 * 
 *             if py_buffer_len > python.INT_MAX:
 *                 buffer_len = python.INT_MAX             # <<<<<<<<<<<<<< 
 *             else:
 *                 buffer_len = <int>py_buffer_len
 */
    __pyx_v_buffer_len = INT_MAX;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":895
 *                 buffer_len = python.INT_MAX
 *             else:
 *                 buffer_len = <int>py_buffer_len             # <<<<<<<<<<<<<< 
 *             if self._for_html:
 *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
 */
    __pyx_v_buffer_len = ((int)__pyx_v_py_buffer_len);
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":896
 *             else:
 *                 buffer_len = <int>py_buffer_len
 *             if self._for_html:             # <<<<<<<<<<<<<< 
 *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
 *                                            c_encoding, self._parse_options)
 */
  __pyx_2 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":898
 *             if self._for_html:
 *                 error = _htmlCtxtResetPush(pctxt, c_data, buffer_len,
 *                                            c_encoding, self._parse_options)             # <<<<<<<<<<<<<< 
 *             else:
 *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)
 */
    __pyx_1 = __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_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 897; goto __pyx_L1;}
    __pyx_v_error = __pyx_1;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":900
 *                                            c_encoding, self._parse_options)
 *             else:
 *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)             # <<<<<<<<<<<<<< 
 *                 error = xmlparser.xmlCtxtResetPush(
 *                     pctxt, c_data, buffer_len, NULL, c_encoding)
 */
    xmlCtxtUseOptions(__pyx_v_pctxt,((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._parse_options);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":902
 *                 xmlparser.xmlCtxtUseOptions(pctxt, self._parse_options)
 *                 error = xmlparser.xmlCtxtResetPush(
 *                     pctxt, c_data, buffer_len, NULL, c_encoding)             # <<<<<<<<<<<<<< 
 *             py_buffer_len = py_buffer_len - buffer_len
 *             c_data = c_data + buffer_len
 */
    __pyx_v_error = xmlCtxtResetPush(__pyx_v_pctxt,__pyx_v_c_data,__pyx_v_buffer_len,NULL,__pyx_v_c_encoding);
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":903
 *                 error = xmlparser.xmlCtxtResetPush(
 *                     pctxt, c_data, buffer_len, NULL, c_encoding)
 *             py_buffer_len = py_buffer_len - buffer_len             # <<<<<<<<<<<<<< 
 *             c_data = c_data + buffer_len
 * 
 */
  __pyx_v_py_buffer_len = (__pyx_v_py_buffer_len - __pyx_v_buffer_len);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":904
 *                     pctxt, c_data, buffer_len, NULL, c_encoding)
 *             py_buffer_len = py_buffer_len - buffer_len
 *             c_data = c_data + buffer_len             # <<<<<<<<<<<<<< 
 * 
 *         while error == 0 and py_buffer_len > 0:
 */
  __pyx_v_c_data = (__pyx_v_c_data + __pyx_v_buffer_len);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":906
 *             c_data = c_data + buffer_len
 * 
 *         while error == 0 and py_buffer_len > 0:             # <<<<<<<<<<<<<< 
 *             if py_buffer_len > python.INT_MAX:
 *                 buffer_len = python.INT_MAX
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":906
 *             c_data = c_data + buffer_len
 * 
 *         while error == 0 and py_buffer_len > 0:             # <<<<<<<<<<<<<< 
 *             if py_buffer_len > python.INT_MAX:
 *                 buffer_len = python.INT_MAX
 */
  __pyx_2 = (__pyx_v_error == 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":906
 *             c_data = c_data + buffer_len
 * 
 *         while error == 0 and py_buffer_len > 0:             # <<<<<<<<<<<<<< 
 *             if py_buffer_len > python.INT_MAX:
 *                 buffer_len = python.INT_MAX
 */
    __pyx_2 = (__pyx_v_py_buffer_len > 0);
  }
  if (!__pyx_2) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":907
 * 
 *         while error == 0 and py_buffer_len > 0:
 *             if py_buffer_len > python.INT_MAX:             # <<<<<<<<<<<<<< 
 *                 buffer_len = python.INT_MAX
 *             else:
 */
  __pyx_2 = (__pyx_v_py_buffer_len > INT_MAX);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":908
 *         while error == 0 and py_buffer_len > 0:
 *             if py_buffer_len > python.INT_MAX:
 *                 buffer_len = python.INT_MAX             # <<<<<<<<<<<<<< 
 *             else:
 *                 buffer_len = <int>py_buffer_len
 */
    __pyx_v_buffer_len = INT_MAX;
    goto __pyx_L10;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":910
 *                 buffer_len = python.INT_MAX
 *             else:
 *                 buffer_len = <int>py_buffer_len             # <<<<<<<<<<<<<< 
 *             if self._for_html:
 *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
 */
    __pyx_v_buffer_len = ((int)__pyx_v_py_buffer_len);
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":911
 *             else:
 *                 buffer_len = <int>py_buffer_len
 *             if self._for_html:             # <<<<<<<<<<<<<< 
 *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
 *             else:
 */
  __pyx_2 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":912
 *                 buffer_len = <int>py_buffer_len
 *             if self._for_html:
 *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<< 
 *             else:
 *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
 */
    __pyx_v_error = htmlParseChunk(__pyx_v_pctxt,__pyx_v_c_data,__pyx_v_buffer_len,0);
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":914
 *                 error = htmlparser.htmlParseChunk(pctxt, c_data, buffer_len, 0)
 *             else:
 *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<< 
 *             py_buffer_len = py_buffer_len - buffer_len
 *             c_data = c_data + buffer_len
 */
    __pyx_v_error = xmlParseChunk(__pyx_v_pctxt,__pyx_v_c_data,__pyx_v_buffer_len,0);
  }
  __pyx_L11:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":915
 *             else:
 *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
 *             py_buffer_len = py_buffer_len - buffer_len             # <<<<<<<<<<<<<< 
 *             c_data = c_data + buffer_len
 * 
 */
  __pyx_v_py_buffer_len = (__pyx_v_py_buffer_len - __pyx_v_buffer_len);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":916
 *                 error = xmlparser.xmlParseChunk(pctxt, c_data, buffer_len, 0)
 *             py_buffer_len = py_buffer_len - buffer_len
 *             c_data = c_data + buffer_len             # <<<<<<<<<<<<<< 
 * 
 *         if error:
 */
  __pyx_v_c_data = (__pyx_v_c_data + __pyx_v_buffer_len);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":918
 *             c_data = c_data + buffer_len
 * 
 *         if error:             # <<<<<<<<<<<<<< 
 *             self._feed_parser_running = 0
 *             try:
 */
__pyx_1 = __pyx_v_error;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":919
 * 
 *         if error:
 *             self._feed_parser_running = 0             # <<<<<<<<<<<<<< 
 *             try:
 *                 context._handleParseResult(self, NULL, None)
 */
  ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":920
 *         if error:
 *             self._feed_parser_running = 0
 *             try:             # <<<<<<<<<<<<<< 
 *                 context._handleParseResult(self, NULL, None)
 *             finally:
 */
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":921
 *             self._feed_parser_running = 0
 *             try:
 *                 context._handleParseResult(self, NULL, None)             # <<<<<<<<<<<<<< 
 *             finally:
 *                 context.cleanup()
 */
    __pyx_4 = ((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_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 921; goto __pyx_L14;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_why = 0; goto __pyx_L15;
    __pyx_L14: {
      __pyx_why = 4;
      Py_XDECREF(__pyx_4); __pyx_4 = 0;
      PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L15;
    }
    __pyx_L15:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":923
 *                 context._handleParseResult(self, NULL, None)
 *             finally:
 *                 context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 *     def close(self):
 */
    __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 923; goto __pyx_L16;}
    goto __pyx_L17;
    __pyx_L16:;
    if (__pyx_why == 4) {
      Py_XDECREF(__pyx_exc_type);
      Py_XDECREF(__pyx_exc_value);
      Py_XDECREF(__pyx_exc_tb);
    }
    goto __pyx_L1;
    __pyx_L17:;
    switch (__pyx_why) {
      case 4: {
        PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L1;
      }
    }
  }
  goto __pyx_L12;
}
__pyx_L12:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._FeedParser.feed");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":925
 *                 context.cleanup()
 * 
 *     def close(self):             # <<<<<<<<<<<<<< 
 *         """Terminates feeding data to this parser.  This tells the parser to
 *         process any remaining data in the feed buffer, and then returns the
 */

static PyObject *__pyx_k520p;

static char __pyx_k520[] = "no element found";

static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_11_FeedParser_close[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_11_FeedParser_close(PyObject *__pyx_v_self, PyObject *unused) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_pctxt;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":938
 *         cdef xmlDoc* c_doc
 *         cdef _Document doc
 *         if not self._feed_parser_running:             # <<<<<<<<<<<<<< 
 *             raise XMLSyntaxError("no element found",
 *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 */
__pyx_1 = (!((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":939
 *         cdef _Document doc
 *         if not self._feed_parser_running:
 *             raise XMLSyntaxError("no element found",             # <<<<<<<<<<<<<< 
 *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 * 
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 939; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":940
 *         if not self._feed_parser_running:
 *             raise XMLSyntaxError("no element found",
 *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getPushParserContext()
 */
  __pyx_3 = PyInt_FromLong(XML_ERR_INTERNAL_ERROR); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":940
 *         if not self._feed_parser_running:
 *             raise XMLSyntaxError("no element found",
 *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)             # <<<<<<<<<<<<<< 
 * 
 *         context = self._getPushParserContext()
 */
  __pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 939; goto __pyx_L1;}
  Py_INCREF(__pyx_k520p);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k520p);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_num_0);
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_4, 3, __pyx_num_0);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 939; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 939; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":942
 *                                  xmlerror.XML_ERR_INTERNAL_ERROR, 0, 0)
 * 
 *         context = self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *         pctxt = context._c_ctxt
 * 
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 942; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":943
 * 
 *         context = self._getPushParserContext()
 *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 * 
 *         self._feed_parser_running = 0
 */
__pyx_v_pctxt = __pyx_v_context->_c_ctxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":945
 *         pctxt = context._c_ctxt
 * 
 *         self._feed_parser_running = 0             # <<<<<<<<<<<<<< 
 *         if self._for_html:
 *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
 */
((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->_feed_parser_running = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":946
 * 
 *         self._feed_parser_running = 0
 *         if self._for_html:             # <<<<<<<<<<<<<< 
 *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
 *         else:
 */
__pyx_1 = ((struct __pyx_obj_4lxml_5etree__FeedParser *)__pyx_v_self)->__pyx_base._for_html;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":947
 *         self._feed_parser_running = 0
 *         if self._for_html:
 *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<< 
 *         else:
 *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 */
  htmlParseChunk(__pyx_v_pctxt,NULL,0,1);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":949
 *             htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
 *         else:
 *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<< 
 *         try:
 *             result = context._handleParseResult(self, pctxt.myDoc, None)
 */
  xmlParseChunk(__pyx_v_pctxt,NULL,0,1);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":950
 *         else:
 *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 *         try:             # <<<<<<<<<<<<<< 
 *             result = context._handleParseResult(self, pctxt.myDoc, None)
 *         finally:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":951
 *             xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 *         try:
 *             result = context._handleParseResult(self, pctxt.myDoc, None)             # <<<<<<<<<<<<<< 
 *         finally:
 *             context.cleanup()
 */
  __pyx_4 = ((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_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 951; goto __pyx_L5;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_4;
  __pyx_4 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L6;
  __pyx_L5: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":953
 *             result = context._handleParseResult(self, pctxt.myDoc, None)
 *         finally:
 *             context.cleanup()             # <<<<<<<<<<<<<< 
 * 
 *         if isinstance(result, _Document):
 */
  __pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__ParserContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->cleanup(__pyx_v_context); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 953; goto __pyx_L7;}
  goto __pyx_L8;
  __pyx_L7:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L8:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":955
 *             context.cleanup()
 * 
 *         if isinstance(result, _Document):             # <<<<<<<<<<<<<< 
 *             return (<_Document>result).getroot()
 *         else:
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_result,((PyObject*)__pyx_ptype_4lxml_5etree__Document)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 955; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":956
 * 
 *         if isinstance(result, _Document):
 *             return (<_Document>result).getroot()             # <<<<<<<<<<<<<< 
 *         else:
 *             return result
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)((struct LxmlDocument *)__pyx_v_result)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_result)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 956; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L9;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":958
 *             return (<_Document>result).getroot()
 *         else:
 *             return result             # <<<<<<<<<<<<<< 
 * 
 * cdef int _htmlCtxtResetPush(xmlparser.xmlParserCtxt* c_ctxt,
 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
}
__pyx_L9:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._FeedParser.close");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":960
 *             return result
 * 
 * cdef int _htmlCtxtResetPush(xmlparser.xmlParserCtxt* c_ctxt,             # <<<<<<<<<<<<<< 
 *                              char* c_data, int buffer_len,
 *                              char* c_encoding, int parse_options) except -1:
 */

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) {
PyObject *__pyx_v_error;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
__pyx_v_error = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":965
 *     cdef xmlparser.xmlParserInput* c_input_stream
 *     # libxml2 crashes if spaceTab is not initialised
 *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:             # <<<<<<<<<<<<<< 
 *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))
 *         c_ctxt.spaceMax = 10
 */
__pyx_1 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20629);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":965
 *     cdef xmlparser.xmlParserInput* c_input_stream
 *     # libxml2 crashes if spaceTab is not initialised
 *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:             # <<<<<<<<<<<<<< 
 *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))
 *         c_ctxt.spaceMax = 10
 */
  __pyx_1 = (__pyx_v_c_ctxt->spaceTab == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":966
 *     # libxml2 crashes if spaceTab is not initialised
 *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:
 *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))             # <<<<<<<<<<<<<< 
 *         c_ctxt.spaceMax = 10
 * 
 */
  __pyx_v_c_ctxt->spaceTab = ((int *)xmlMalloc((10 * (sizeof(int)))));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":967
 *     if _LIBXML_VERSION_INT < 20629 and c_ctxt.spaceTab is NULL:
 *         c_ctxt.spaceTab = <int*>tree.xmlMalloc(10 * sizeof(int))
 *         c_ctxt.spaceMax = 10             # <<<<<<<<<<<<<< 
 * 
 *     # libxml2 lacks an HTML push parser setup function
 */
  __pyx_v_c_ctxt->spaceMax = 10;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":970
 * 
 *     # libxml2 lacks an HTML push parser setup function
 *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)             # <<<<<<<<<<<<<< 
 *     if error:
 *         return error
 */
__pyx_2 = PyInt_FromLong(xmlCtxtResetPush(__pyx_v_c_ctxt,NULL,0,NULL,__pyx_v_c_encoding)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 970; goto __pyx_L1;}
Py_DECREF(__pyx_v_error);
__pyx_v_error = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":971
 *     # libxml2 lacks an HTML push parser setup function
 *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)
 *     if error:             # <<<<<<<<<<<<<< 
 *         return error
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_error); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 971; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":972
 *     error = xmlparser.xmlCtxtResetPush(c_ctxt, NULL, 0, NULL, c_encoding)
 *     if error:
 *         return error             # <<<<<<<<<<<<<< 
 * 
 *     # fix libxml2 setup for HTML
 */
  __pyx_3 = PyInt_AsLong(__pyx_v_error); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 972; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":975
 * 
 *     # fix libxml2 setup for HTML
 *     c_ctxt.progressive = 1             # <<<<<<<<<<<<<< 
 *     c_ctxt.html = 1
 *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
 */
__pyx_v_c_ctxt->progressive = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":976
 *     # fix libxml2 setup for HTML
 *     c_ctxt.progressive = 1
 *     c_ctxt.html = 1             # <<<<<<<<<<<<<< 
 *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
 * 
 */
__pyx_v_c_ctxt->html = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":977
 *     c_ctxt.progressive = 1
 *     c_ctxt.html = 1
 *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)             # <<<<<<<<<<<<<< 
 * 
 *     if c_data is not NULL and buffer_len > 0:
 */
htmlCtxtUseOptions(__pyx_v_c_ctxt,__pyx_v_parse_options);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":979
 *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
 * 
 *     if c_data is not NULL and buffer_len > 0:             # <<<<<<<<<<<<<< 
 *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)
 *     return 0
 */
__pyx_1 = (__pyx_v_c_data != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":979
 *     htmlparser.htmlCtxtUseOptions(c_ctxt, parse_options)
 * 
 *     if c_data is not NULL and buffer_len > 0:             # <<<<<<<<<<<<<< 
 *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)
 *     return 0
 */
  __pyx_1 = (__pyx_v_buffer_len > 0);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":980
 * 
 *     if c_data is not NULL and buffer_len > 0:
 *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)             # <<<<<<<<<<<<<< 
 *     return 0
 * 
 */
  __pyx_r = htmlParseChunk(__pyx_v_c_ctxt,__pyx_v_c_data,__pyx_v_buffer_len,0);
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":981
 *     if c_data is not NULL and buffer_len > 0:
 *         return htmlparser.htmlParseChunk(c_ctxt, c_data, buffer_len, 0)
 *     return 0             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._htmlCtxtResetPush");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_error);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":999
 *     cdef int _sax_event_filter
 *     cdef int _sax_event_propagate
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<< 
 *         return None
 *     cdef _handleSaxEnd(self, tag):
 */

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) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1000
 *     cdef int _sax_event_propagate
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         return None             # <<<<<<<<<<<<<< 
 *     cdef _handleSaxEnd(self, tag):
 *         return None
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1001
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         return None
 *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<< 
 *         return None
 *     cdef int _handleSaxData(self, data) except -1:
 */

static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1002
 *         return None
 *     cdef _handleSaxEnd(self, tag):
 *         return None             # <<<<<<<<<<<<<< 
 *     cdef int _handleSaxData(self, data) except -1:
 *         return 0
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1003
 *     cdef _handleSaxEnd(self, tag):
 *         return None
 *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<< 
 *         return 0
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 */

static  int __pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self,PyObject *__pyx_v_data) {
int __pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1004
 *         return None
 *     cdef int _handleSaxData(self, data) except -1:
 *         return 0             # <<<<<<<<<<<<<< 
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 *         return 0
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1005
 *     cdef int _handleSaxData(self, data) except -1:
 *         return 0
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<< 
 *         return 0
 *     cdef _handleSaxPi(self, target, data):
 */

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) {
int __pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_root_tag);
Py_INCREF(__pyx_v_public_id);
Py_INCREF(__pyx_v_system_id);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1006
 *         return 0
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 *         return 0             # <<<<<<<<<<<<<< 
 *     cdef _handleSaxPi(self, target, data):
 *         return None
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_root_tag);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_id);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1007
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 *         return 0
 *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<< 
 *         return None
 *     cdef _handleSaxComment(self, comment):
 */

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) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1008
 *         return 0
 *     cdef _handleSaxPi(self, target, data):
 *         return None             # <<<<<<<<<<<<<< 
 *     cdef _handleSaxComment(self, comment):
 *         return None
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1009
 *     cdef _handleSaxPi(self, target, data):
 *         return None
 *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment(struct __pyx_obj_4lxml_5etree__SaxParserTarget *__pyx_v_self,PyObject *__pyx_v_comment) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_comment);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1010
 *         return None
 *     cdef _handleSaxComment(self, comment):
 *         return None             # <<<<<<<<<<<<<< 
 * 
 * cdef class _SaxParserContext(_ParserContext):
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_comment);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1025
 *     cdef xmlparser.processingInstructionSAXFunc    _origSaxPi
 * 
 *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):             # <<<<<<<<<<<<<< 
 *         self._target = target
 * 
 */

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) {
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1026
 * 
 *     cdef void _setSaxParserTarget(self, _SaxParserTarget target):
 *         self._target = target             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
 */
Py_INCREF(((PyObject *)__pyx_v_target));
Py_DECREF(((PyObject *)__pyx_v_self->_target));
__pyx_v_self->_target = __pyx_v_target;

Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1028
 *         self._target = target
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *         "wrap original SAX2 callbacks"
 *         cdef xmlparser.xmlSAXHandler* sax
 */

static  void __pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext(struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_self,xmlParserCtxt *__pyx_v_c_ctxt) {
xmlSAXHandler *__pyx_v_sax;
int __pyx_1;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1031
 *         "wrap original SAX2 callbacks"
 *         cdef xmlparser.xmlSAXHandler* sax
 *         _ParserContext._initParserContext(self, c_ctxt)             # <<<<<<<<<<<<<< 
 *         sax = c_ctxt.sax
 *         if self._target._sax_event_propagate & SAX_EVENT_START:
 */
__pyx_vtabptr_4lxml_5etree__ParserContext->_initParserContext(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self),__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1032
 *         cdef xmlparser.xmlSAXHandler* sax
 *         _ParserContext._initParserContext(self, c_ctxt)
 *         sax = c_ctxt.sax             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_propagate & SAX_EVENT_START:
 *             # propagate => keep orig callback
 */
__pyx_v_sax = __pyx_v_c_ctxt->sax;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1033
 *         _ParserContext._initParserContext(self, c_ctxt)
 *         sax = c_ctxt.sax
 *         if self._target._sax_event_propagate & SAX_EVENT_START:             # <<<<<<<<<<<<<< 
 *             # propagate => keep orig callback
 *             self._origSaxStart = sax.startElementNs
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_START);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1035
 *         if self._target._sax_event_propagate & SAX_EVENT_START:
 *             # propagate => keep orig callback
 *             self._origSaxStart = sax.startElementNs             # <<<<<<<<<<<<<< 
 *             self._origSaxStartNoNs = sax.startElement
 *         else:
 */
  __pyx_v_self->_origSaxStart = __pyx_v_sax->startElementNs;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1036
 *             # propagate => keep orig callback
 *             self._origSaxStart = sax.startElementNs
 *             self._origSaxStartNoNs = sax.startElement             # <<<<<<<<<<<<<< 
 *         else:
 *             # otherwise: never call orig callback
 */
  __pyx_v_self->_origSaxStartNoNs = __pyx_v_sax->startElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1039
 *         else:
 *             # otherwise: never call orig callback
 *             self._origSaxStart = sax.startElementNs = NULL             # <<<<<<<<<<<<<< 
 *             self._origSaxStartNoNs = sax.startElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_START:
 */
  __pyx_v_self->_origSaxStart = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1039
 *         else:
 *             # otherwise: never call orig callback
 *             self._origSaxStart = sax.startElementNs = NULL             # <<<<<<<<<<<<<< 
 *             self._origSaxStartNoNs = sax.startElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_START:
 */
  __pyx_v_sax->startElementNs = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1040
 *             # otherwise: never call orig callback
 *             self._origSaxStart = sax.startElementNs = NULL
 *             self._origSaxStartNoNs = sax.startElement = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_START:
 *             # intercept => overwrite orig callback
 */
  __pyx_v_self->_origSaxStartNoNs = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1040
 *             # otherwise: never call orig callback
 *             self._origSaxStart = sax.startElementNs = NULL
 *             self._origSaxStartNoNs = sax.startElement = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_START:
 *             # intercept => overwrite orig callback
 */
  __pyx_v_sax->startElement = NULL;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1041
 *             self._origSaxStart = sax.startElementNs = NULL
 *             self._origSaxStartNoNs = sax.startElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_START:             # <<<<<<<<<<<<<< 
 *             # intercept => overwrite orig callback
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_START);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1043
 *         if self._target._sax_event_filter & SAX_EVENT_START:
 *             # intercept => overwrite orig callback
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<< 
 *                 sax.startElementNs = _handleSaxStart
 *             sax.startElement = _handleSaxStartNoNs
 */
  __pyx_2 = (__pyx_v_sax->initialized == XML_SAX2_MAGIC);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1044
 *             # intercept => overwrite orig callback
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 *                 sax.startElementNs = _handleSaxStart             # <<<<<<<<<<<<<< 
 *             sax.startElement = _handleSaxStartNoNs
 * 
 */
    __pyx_v_sax->startElementNs = __pyx_f_4lxml_5etree__handleSaxStart;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1045
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 *                 sax.startElementNs = _handleSaxStart
 *             sax.startElement = _handleSaxStartNoNs             # <<<<<<<<<<<<<< 
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_END:
 */
  __pyx_v_sax->startElement = __pyx_f_4lxml_5etree__handleSaxStartNoNs;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1047
 *             sax.startElement = _handleSaxStartNoNs
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_END:             # <<<<<<<<<<<<<< 
 *             self._origSaxEnd = sax.endElementNs
 *             self._origSaxEndNoNs = sax.endElement
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_END);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1048
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_END:
 *             self._origSaxEnd = sax.endElementNs             # <<<<<<<<<<<<<< 
 *             self._origSaxEndNoNs = sax.endElement
 *         else:
 */
  __pyx_v_self->_origSaxEnd = __pyx_v_sax->endElementNs;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1049
 *         if self._target._sax_event_propagate & SAX_EVENT_END:
 *             self._origSaxEnd = sax.endElementNs
 *             self._origSaxEndNoNs = sax.endElement             # <<<<<<<<<<<<<< 
 *         else:
 *             self._origSaxEnd = sax.endElementNs = NULL
 */
  __pyx_v_self->_origSaxEndNoNs = __pyx_v_sax->endElement;
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1051
 *             self._origSaxEndNoNs = sax.endElement
 *         else:
 *             self._origSaxEnd = sax.endElementNs = NULL             # <<<<<<<<<<<<<< 
 *             self._origSaxEndNoNs = sax.endElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 */
  __pyx_v_self->_origSaxEnd = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1051
 *             self._origSaxEndNoNs = sax.endElement
 *         else:
 *             self._origSaxEnd = sax.endElementNs = NULL             # <<<<<<<<<<<<<< 
 *             self._origSaxEndNoNs = sax.endElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 */
  __pyx_v_sax->endElementNs = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1052
 *         else:
 *             self._origSaxEnd = sax.endElementNs = NULL
 *             self._origSaxEndNoNs = sax.endElement = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 */
  __pyx_v_self->_origSaxEndNoNs = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1052
 *         else:
 *             self._origSaxEnd = sax.endElementNs = NULL
 *             self._origSaxEndNoNs = sax.endElement = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 */
  __pyx_v_sax->endElement = NULL;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1053
 *             self._origSaxEnd = sax.endElementNs = NULL
 *             self._origSaxEndNoNs = sax.endElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_END:             # <<<<<<<<<<<<<< 
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 *                 sax.endElementNs = _handleSaxEnd
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_END);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1054
 *             self._origSaxEndNoNs = sax.endElement = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:             # <<<<<<<<<<<<<< 
 *                 sax.endElementNs = _handleSaxEnd
 *             sax.endElement = _handleSaxEndNoNs
 */
  __pyx_2 = (__pyx_v_sax->initialized == XML_SAX2_MAGIC);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1055
 *         if self._target._sax_event_filter & SAX_EVENT_END:
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 *                 sax.endElementNs = _handleSaxEnd             # <<<<<<<<<<<<<< 
 *             sax.endElement = _handleSaxEndNoNs
 * 
 */
    __pyx_v_sax->endElementNs = __pyx_f_4lxml_5etree__handleSaxEnd;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1056
 *             if sax.initialized == xmlparser.XML_SAX2_MAGIC:
 *                 sax.endElementNs = _handleSaxEnd
 *             sax.endElement = _handleSaxEndNoNs             # <<<<<<<<<<<<<< 
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DATA:
 */
  __pyx_v_sax->endElement = __pyx_f_4lxml_5etree__handleSaxEndNoNs;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1058
 *             sax.endElement = _handleSaxEndNoNs
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DATA:             # <<<<<<<<<<<<<< 
 *             self._origSaxData = sax.characters
 *         else:
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1059
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DATA:
 *             self._origSaxData = sax.characters             # <<<<<<<<<<<<<< 
 *         else:
 *             self._origSaxData = sax.characters = NULL
 */
  __pyx_v_self->_origSaxData = __pyx_v_sax->characters;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1061
 *             self._origSaxData = sax.characters
 *         else:
 *             self._origSaxData = sax.characters = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_DATA:
 *             sax.characters = _handleSaxData
 */
  __pyx_v_self->_origSaxData = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1061
 *             self._origSaxData = sax.characters
 *         else:
 *             self._origSaxData = sax.characters = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_DATA:
 *             sax.characters = _handleSaxData
 */
  __pyx_v_sax->characters = NULL;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1062
 *         else:
 *             self._origSaxData = sax.characters = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_DATA:             # <<<<<<<<<<<<<< 
 *             sax.characters = _handleSaxData
 * 
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1063
 *             self._origSaxData = sax.characters = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_DATA:
 *             sax.characters = _handleSaxData             # <<<<<<<<<<<<<< 
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DOCTYPE:
 */
  __pyx_v_sax->characters = __pyx_f_4lxml_5etree__handleSaxData;
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1065
 *             sax.characters = _handleSaxData
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DOCTYPE:             # <<<<<<<<<<<<<< 
 *             self._origSaxDoctype = sax.internalSubset
 *         else:
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1066
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_DOCTYPE:
 *             self._origSaxDoctype = sax.internalSubset             # <<<<<<<<<<<<<< 
 *         else:
 *             self._origSaxDoctype = sax.internalSubset = NULL
 */
  __pyx_v_self->_origSaxDoctype = __pyx_v_sax->internalSubset;
  goto __pyx_L10;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1068
 *             self._origSaxDoctype = sax.internalSubset
 *         else:
 *             self._origSaxDoctype = sax.internalSubset = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
 *             sax.internalSubset = _handleSaxDoctype
 */
  __pyx_v_self->_origSaxDoctype = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1068
 *             self._origSaxDoctype = sax.internalSubset
 *         else:
 *             self._origSaxDoctype = sax.internalSubset = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
 *             sax.internalSubset = _handleSaxDoctype
 */
  __pyx_v_sax->internalSubset = NULL;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1069
 *         else:
 *             self._origSaxDoctype = sax.internalSubset = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:             # <<<<<<<<<<<<<< 
 *             sax.internalSubset = _handleSaxDoctype
 * 
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1070
 *             self._origSaxDoctype = sax.internalSubset = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_DOCTYPE:
 *             sax.internalSubset = _handleSaxDoctype             # <<<<<<<<<<<<<< 
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_PI:
 */
  __pyx_v_sax->internalSubset = __pyx_f_4lxml_5etree__handleSaxDoctype;
  goto __pyx_L11;
}
__pyx_L11:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1072
 *             sax.internalSubset = _handleSaxDoctype
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_PI:             # <<<<<<<<<<<<<< 
 *             self._origSaxPi = sax.processingInstruction
 *         else:
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_PI);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1073
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_PI:
 *             self._origSaxPi = sax.processingInstruction             # <<<<<<<<<<<<<< 
 *         else:
 *             self._origSaxPi = sax.processingInstruction = NULL
 */
  __pyx_v_self->_origSaxPi = __pyx_v_sax->processingInstruction;
  goto __pyx_L12;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1075
 *             self._origSaxPi = sax.processingInstruction
 *         else:
 *             self._origSaxPi = sax.processingInstruction = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_PI:
 *             sax.processingInstruction = _handleSaxPI
 */
  __pyx_v_self->_origSaxPi = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1075
 *             self._origSaxPi = sax.processingInstruction
 *         else:
 *             self._origSaxPi = sax.processingInstruction = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_PI:
 *             sax.processingInstruction = _handleSaxPI
 */
  __pyx_v_sax->processingInstruction = NULL;
}
__pyx_L12:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1076
 *         else:
 *             self._origSaxPi = sax.processingInstruction = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_PI:             # <<<<<<<<<<<<<< 
 *             sax.processingInstruction = _handleSaxPI
 * 
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_PI);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1077
 *             self._origSaxPi = sax.processingInstruction = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_PI:
 *             sax.processingInstruction = _handleSaxPI             # <<<<<<<<<<<<<< 
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:
 */
  __pyx_v_sax->processingInstruction = __pyx_f_4lxml_5etree__handleSaxPI;
  goto __pyx_L13;
}
__pyx_L13:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1079
 *             sax.processingInstruction = _handleSaxPI
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<< 
 *             self._origSaxComment = sax.comment
 *         else:
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_propagate & __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1080
 * 
 *         if self._target._sax_event_propagate & SAX_EVENT_COMMENT:
 *             self._origSaxComment = sax.comment             # <<<<<<<<<<<<<< 
 *         else:
 *             self._origSaxComment = sax.comment = NULL
 */
  __pyx_v_self->_origSaxComment = __pyx_v_sax->comment;
  goto __pyx_L14;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1082
 *             self._origSaxComment = sax.comment
 *         else:
 *             self._origSaxComment = sax.comment = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
 *             sax.comment = _handleSaxComment
 */
  __pyx_v_self->_origSaxComment = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1082
 *             self._origSaxComment = sax.comment
 *         else:
 *             self._origSaxComment = sax.comment = NULL             # <<<<<<<<<<<<<< 
 *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
 *             sax.comment = _handleSaxComment
 */
  __pyx_v_sax->comment = NULL;
}
__pyx_L14:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1083
 *         else:
 *             self._origSaxComment = sax.comment = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:             # <<<<<<<<<<<<<< 
 *             sax.comment = _handleSaxComment
 * 
 */
__pyx_1 = (__pyx_v_self->_target->_sax_event_filter & __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1084
 *             self._origSaxComment = sax.comment = NULL
 *         if self._target._sax_event_filter & SAX_EVENT_COMMENT:
 *             sax.comment = _handleSaxComment             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
 */
  __pyx_v_sax->comment = __pyx_f_4lxml_5etree__handleSaxComment;
  goto __pyx_L15;
}
__pyx_L15:;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1086
 *             sax.comment = _handleSaxComment
 * 
 *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *         self._store_raised()
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 */

static  void __pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException(struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_self,xmlParserCtxt *__pyx_v_c_ctxt) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1087
 * 
 *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
 *         self._store_raised()             # <<<<<<<<<<<<<< 
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 */
((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));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1088
 *     cdef void _handleSaxException(self, xmlparser.xmlParserCtxt* c_ctxt):
 *         self._store_raised()
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<< 
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1
 */
__pyx_1 = (__pyx_v_c_ctxt->errNo == XML_ERR_OK);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1089
 *         self._store_raised()
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<< 
 *         c_ctxt.disableSAX = 1
 * 
 */
  __pyx_v_c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1090
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxStart(void* ctxt, char* c_localname, char* c_prefix,
 */
__pyx_v_c_ctxt->disableSAX = 1;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1092
 *         c_ctxt.disableSAX = 1
 * 
 * cdef void _handleSaxStart(void* ctxt, char* c_localname, char* c_prefix,             # <<<<<<<<<<<<<< 
 *                           char* c_namespace, int c_nb_namespaces,
 *                           char** c_namespaces,
 */

static PyObject *__pyx_k521p;

static char __pyx_k521[] = "";
static char __pyx_k522[] = "strict";

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) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
struct LxmlElement *__pyx_v_element;
int __pyx_v_i;
PyObject *__pyx_v_tag;
PyObject *__pyx_v_attrib;
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
PyObject *__pyx_v_nsmap;
PyObject *__pyx_v_prefix;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);
__pyx_v_attrib = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_nsmap = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1101
 *     cdef _Element element
 *     cdef int i
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1102
 *     cdef int i
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1103
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxStart is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1104
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxStart is not NULL:
 *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1105
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxStart is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
 *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
 */
__pyx_1 = (__pyx_v_context->_origSaxStart != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1108
 *         context._origSaxStart(c_ctxt, c_localname, c_prefix, c_namespace,
 *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
 *                               c_nb_defaulted, c_attributes)             # <<<<<<<<<<<<<< 
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 */
  __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);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1109
 *                               c_nb_namespaces, c_namespaces, c_nb_attributes,
 *                               c_nb_defaulted, c_attributes)
 *     try:             # <<<<<<<<<<<<<< 
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 *         if c_nb_defaulted > 0:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1110
 *                               c_nb_defaulted, c_attributes)
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)             # <<<<<<<<<<<<<< 
 *         if c_nb_defaulted > 0:
 *             # only add default attributes if we asked for them
 */
  __pyx_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace,__pyx_v_c_localname); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1110; goto __pyx_L4;}
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1111
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 *         if c_nb_defaulted > 0:             # <<<<<<<<<<<<<< 
 *             # only add default attributes if we asked for them
 *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
 */
  __pyx_1 = (__pyx_v_c_nb_defaulted > 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1113
 *         if c_nb_defaulted > 0:
 *             # only add default attributes if we asked for them
 *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:             # <<<<<<<<<<<<<< 
 *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
 *         if c_nb_attributes == 0:
 */
    __pyx_1 = ((__pyx_v_c_ctxt->loadsubset & XML_COMPLETE_ATTRS) == 0);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1114
 *             # only add default attributes if we asked for them
 *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
 *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted             # <<<<<<<<<<<<<< 
 *         if c_nb_attributes == 0:
 *             attrib = EMPTY_READ_ONLY_DICT
 */
      __pyx_v_c_nb_attributes = (__pyx_v_c_nb_attributes - __pyx_v_c_nb_defaulted);
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1115
 *             if c_ctxt.loadsubset & xmlparser.XML_COMPLETE_ATTRS == 0:
 *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
 *         if c_nb_attributes == 0:             # <<<<<<<<<<<<<< 
 *             attrib = EMPTY_READ_ONLY_DICT
 *         else:
 */
  __pyx_1 = (__pyx_v_c_nb_attributes == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1116
 *                 c_nb_attributes = c_nb_attributes - c_nb_defaulted
 *         if c_nb_attributes == 0:
 *             attrib = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<< 
 *         else:
 *             attrib = {}
 */
    Py_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1118
 *             attrib = EMPTY_READ_ONLY_DICT
 *         else:
 *             attrib = {}             # <<<<<<<<<<<<<< 
 *             for i from 0 <= i < c_nb_attributes:
 *                 name = _namespacedNameFromNsName(
 */
    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1118; goto __pyx_L4;}
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1119
 *         else:
 *             attrib = {}
 *             for i from 0 <= i < c_nb_attributes:             # <<<<<<<<<<<<<< 
 *                 name = _namespacedNameFromNsName(
 *                     c_attributes[2], c_attributes[0])
 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_c_nb_attributes; __pyx_v_i++) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1121
 *             for i from 0 <= i < c_nb_attributes:
 *                 name = _namespacedNameFromNsName(
 *                     c_attributes[2], c_attributes[0])             # <<<<<<<<<<<<<< 
 *                 if c_attributes[3] is NULL:
 *                     value = ""
 */
      __pyx_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName((__pyx_v_c_attributes[2]),(__pyx_v_c_attributes[0])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1120; goto __pyx_L4;}
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_2;
      __pyx_2 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1122
 *                 name = _namespacedNameFromNsName(
 *                     c_attributes[2], c_attributes[0])
 *                 if c_attributes[3] is NULL:             # <<<<<<<<<<<<<< 
 *                     value = ""
 *                 else:
 */
      __pyx_1 = ((__pyx_v_c_attributes[3]) == NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1123
 *                     c_attributes[2], c_attributes[0])
 *                 if c_attributes[3] is NULL:
 *                     value = ""             # <<<<<<<<<<<<<< 
 *                 else:
 *                     value = python.PyUnicode_DecodeUTF8(
 */
        Py_INCREF(__pyx_k521p);
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_k521p;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1127
 *                     value = python.PyUnicode_DecodeUTF8(
 *                         c_attributes[3], c_attributes[4] - c_attributes[3],
 *                         "strict")             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(attrib, name, value)
 *                 c_attributes = c_attributes + 5
 */
        __pyx_2 = PyUnicode_DecodeUTF8((__pyx_v_c_attributes[3]),((__pyx_v_c_attributes[4]) - (__pyx_v_c_attributes[3])),__pyx_k522); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1125; goto __pyx_L4;}
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_2;
        __pyx_2 = 0;
      }
      __pyx_L11:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1128
 *                         c_attributes[3], c_attributes[4] - c_attributes[3],
 *                         "strict")
 *                 python.PyDict_SetItem(attrib, name, value)             # <<<<<<<<<<<<<< 
 *                 c_attributes = c_attributes + 5
 *         if c_nb_namespaces == 0:
 */
      __pyx_3 = PyDict_SetItem(__pyx_v_attrib,__pyx_v_name,__pyx_v_value); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1128; goto __pyx_L4;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1129
 *                         "strict")
 *                 python.PyDict_SetItem(attrib, name, value)
 *                 c_attributes = c_attributes + 5             # <<<<<<<<<<<<<< 
 *         if c_nb_namespaces == 0:
 *             nsmap = EMPTY_READ_ONLY_DICT
 */
      __pyx_v_c_attributes = (__pyx_v_c_attributes + 5);
    }
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1130
 *                 python.PyDict_SetItem(attrib, name, value)
 *                 c_attributes = c_attributes + 5
 *         if c_nb_namespaces == 0:             # <<<<<<<<<<<<<< 
 *             nsmap = EMPTY_READ_ONLY_DICT
 *         else:
 */
  __pyx_1 = (__pyx_v_c_nb_namespaces == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1131
 *                 c_attributes = c_attributes + 5
 *         if c_nb_namespaces == 0:
 *             nsmap = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<< 
 *         else:
 *             nsmap = {}
 */
    Py_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
    Py_DECREF(__pyx_v_nsmap);
    __pyx_v_nsmap = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1133
 *             nsmap = EMPTY_READ_ONLY_DICT
 *         else:
 *             nsmap = {}             # <<<<<<<<<<<<<< 
 *             for i from 0 <= i < c_nb_namespaces:
 *                 if c_namespaces[0] is NULL:
 */
    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1133; goto __pyx_L4;}
    Py_DECREF(__pyx_v_nsmap);
    __pyx_v_nsmap = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1134
 *         else:
 *             nsmap = {}
 *             for i from 0 <= i < c_nb_namespaces:             # <<<<<<<<<<<<<< 
 *                 if c_namespaces[0] is NULL:
 *                     prefix = None
 */
    for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_c_nb_namespaces; __pyx_v_i++) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1135
 *             nsmap = {}
 *             for i from 0 <= i < c_nb_namespaces:
 *                 if c_namespaces[0] is NULL:             # <<<<<<<<<<<<<< 
 *                     prefix = None
 *                 else:
 */
      __pyx_1 = ((__pyx_v_c_namespaces[0]) == NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1136
 *             for i from 0 <= i < c_nb_namespaces:
 *                 if c_namespaces[0] is NULL:
 *                     prefix = None             # <<<<<<<<<<<<<< 
 *                 else:
 *                     prefix = funicode(c_namespaces[0])
 */
        Py_INCREF(Py_None);
        Py_DECREF(__pyx_v_prefix);
        __pyx_v_prefix = Py_None;
        goto __pyx_L15;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1138
 *                     prefix = None
 *                 else:
 *                     prefix = funicode(c_namespaces[0])             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(
 *                     nsmap, prefix, funicode(c_namespaces[1]))
 */
        __pyx_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[0])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1138; goto __pyx_L4;}
        Py_DECREF(__pyx_v_prefix);
        __pyx_v_prefix = __pyx_2;
        __pyx_2 = 0;
      }
      __pyx_L15:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1140
 *                     prefix = funicode(c_namespaces[0])
 *                 python.PyDict_SetItem(
 *                     nsmap, prefix, funicode(c_namespaces[1]))             # <<<<<<<<<<<<<< 
 *                 c_namespaces = c_namespaces + 2
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)
 */
      __pyx_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_namespaces[1])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1140; goto __pyx_L4;}
      __pyx_3 = PyDict_SetItem(__pyx_v_nsmap,__pyx_v_prefix,__pyx_2); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1139; goto __pyx_L4;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1141
 *                 python.PyDict_SetItem(
 *                     nsmap, prefix, funicode(c_namespaces[1]))
 *                 c_namespaces = c_namespaces + 2             # <<<<<<<<<<<<<< 
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)
 *         if element is not None and c_ctxt.input is not NULL:
 */
      __pyx_v_c_namespaces = (__pyx_v_c_namespaces + 2);
    }
  }
  __pyx_L12:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1142
 *                     nsmap, prefix, funicode(c_namespaces[1]))
 *                 c_namespaces = c_namespaces + 2
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)             # <<<<<<<<<<<<<< 
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1142; goto __pyx_L4;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1142; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1143
 *                 c_namespaces = c_namespaces + 2
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)
 *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line
 */
  __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1143
 *                 c_namespaces = c_namespaces + 2
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)
 *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line
 */
    __pyx_1 = (__pyx_v_c_ctxt->input != NULL);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1144
 *         element = context._target._handleSaxStart(tag, attrib, nsmap)
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:             # <<<<<<<<<<<<<< 
 *                 element._c_node.line = <short>c_ctxt.input.line
 *             else:
 */
    __pyx_1 = (__pyx_v_c_ctxt->input->line < 65535);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1145
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line             # <<<<<<<<<<<<<< 
 *             else:
 *                 element._c_node.line = 65535
 */
      __pyx_v_element->_c_node->line = ((short)__pyx_v_c_ctxt->input->line);
      goto __pyx_L17;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1147
 *                 element._c_node.line = <short>c_ctxt.input.line
 *             else:
 *                 element._c_node.line = 65535             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
      __pyx_v_element->_c_node->line = 65535;
    }
    __pyx_L17:;
    goto __pyx_L16;
  }
  __pyx_L16:;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1148
 *             else:
 *                 element._c_node.line = 65535
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxStart");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1148; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1149
 *                 element._c_node.line = 65535
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxStartNoNs(void* ctxt, char* c_name,
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("lxml.etree._handleSaxStart");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_nsmap);
Py_DECREF(__pyx_v_prefix);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1151
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxStartNoNs(void* ctxt, char* c_name,             # <<<<<<<<<<<<<< 
 *                               char** c_attributes) with gil:
 *     cdef _SaxParserContext context
 */

static PyObject *__pyx_k523p;

static char __pyx_k523[] = "";

static  void __pyx_f_4lxml_5etree__handleSaxStartNoNs(void *__pyx_v_ctxt,char *__pyx_v_c_name,char **__pyx_v_c_attributes) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
struct LxmlElement *__pyx_v_element;
PyObject *__pyx_v_tag;
PyObject *__pyx_v_attrib;
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);
__pyx_v_attrib = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1156
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     cdef _Element element
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1157
 *     cdef _Element element
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1158
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxStartNoNs is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1159
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxStartNoNs is not NULL:
 *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1160
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxStartNoNs is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxStartNoNs != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1161
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxStartNoNs is not NULL:
 *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)             # <<<<<<<<<<<<<< 
 *     try:
 *         tag = funicode(c_name)
 */
  __pyx_v_context->_origSaxStartNoNs(__pyx_v_c_ctxt,__pyx_v_c_name,__pyx_v_c_attributes);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1162
 *     if context._origSaxStartNoNs is not NULL:
 *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
 *     try:             # <<<<<<<<<<<<<< 
 *         tag = funicode(c_name)
 *         if c_attributes is NULL:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1163
 *         context._origSaxStartNoNs(c_ctxt, c_name, c_attributes)
 *     try:
 *         tag = funicode(c_name)             # <<<<<<<<<<<<<< 
 *         if c_attributes is NULL:
 *             attrib = EMPTY_READ_ONLY_DICT
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1163; goto __pyx_L4;}
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1164
 *     try:
 *         tag = funicode(c_name)
 *         if c_attributes is NULL:             # <<<<<<<<<<<<<< 
 *             attrib = EMPTY_READ_ONLY_DICT
 *         else:
 */
  __pyx_1 = (__pyx_v_c_attributes == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1165
 *         tag = funicode(c_name)
 *         if c_attributes is NULL:
 *             attrib = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<< 
 *         else:
 *             attrib = {}
 */
    Py_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1167
 *             attrib = EMPTY_READ_ONLY_DICT
 *         else:
 *             attrib = {}             # <<<<<<<<<<<<<< 
 *             while c_attributes[0] is not NULL:
 *                 name = funicode(c_attributes[0])
 */
    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1167; goto __pyx_L4;}
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1168
 *         else:
 *             attrib = {}
 *             while c_attributes[0] is not NULL:             # <<<<<<<<<<<<<< 
 *                 name = funicode(c_attributes[0])
 *                 if c_attributes[1] is NULL:
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1168
 *         else:
 *             attrib = {}
 *             while c_attributes[0] is not NULL:             # <<<<<<<<<<<<<< 
 *                 name = funicode(c_attributes[0])
 *                 if c_attributes[1] is NULL:
 */
      __pyx_1 = ((__pyx_v_c_attributes[0]) != NULL);
      if (!__pyx_1) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1169
 *             attrib = {}
 *             while c_attributes[0] is not NULL:
 *                 name = funicode(c_attributes[0])             # <<<<<<<<<<<<<< 
 *                 if c_attributes[1] is NULL:
 *                     value = ""
 */
      __pyx_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[0])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1169; goto __pyx_L4;}
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_2;
      __pyx_2 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1170
 *             while c_attributes[0] is not NULL:
 *                 name = funicode(c_attributes[0])
 *                 if c_attributes[1] is NULL:             # <<<<<<<<<<<<<< 
 *                     value = ""
 *                 else:
 */
      __pyx_1 = ((__pyx_v_c_attributes[1]) == NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1171
 *                 name = funicode(c_attributes[0])
 *                 if c_attributes[1] is NULL:
 *                     value = ""             # <<<<<<<<<<<<<< 
 *                 else:
 *                     value = funicode(c_attributes[1])
 */
        Py_INCREF(__pyx_k523p);
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_k523p;
        goto __pyx_L9;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1173
 *                     value = ""
 *                 else:
 *                     value = funicode(c_attributes[1])             # <<<<<<<<<<<<<< 
 *                 c_attributes = c_attributes + 2
 *                 python.PyDict_SetItem(attrib, name, value)
 */
        __pyx_2 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_attributes[1])); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1173; goto __pyx_L4;}
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_2;
        __pyx_2 = 0;
      }
      __pyx_L9:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1174
 *                 else:
 *                     value = funicode(c_attributes[1])
 *                 c_attributes = c_attributes + 2             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(attrib, name, value)
 *         element = context._target._handleSaxStart(
 */
      __pyx_v_c_attributes = (__pyx_v_c_attributes + 2);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1175
 *                     value = funicode(c_attributes[1])
 *                 c_attributes = c_attributes + 2
 *                 python.PyDict_SetItem(attrib, name, value)             # <<<<<<<<<<<<<< 
 *         element = context._target._handleSaxStart(
 *             tag, attrib, EMPTY_READ_ONLY_DICT)
 */
      __pyx_3 = PyDict_SetItem(__pyx_v_attrib,__pyx_v_name,__pyx_v_value); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1175; goto __pyx_L4;}
    }
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1177
 *                 python.PyDict_SetItem(attrib, name, value)
 *         element = context._target._handleSaxStart(
 *             tag, attrib, EMPTY_READ_ONLY_DICT)             # <<<<<<<<<<<<<< 
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1176; goto __pyx_L4;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1176; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1178
 *         element = context._target._handleSaxStart(
 *             tag, attrib, EMPTY_READ_ONLY_DICT)
 *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line
 */
  __pyx_1 = (((PyObject *)__pyx_v_element) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1178
 *         element = context._target._handleSaxStart(
 *             tag, attrib, EMPTY_READ_ONLY_DICT)
 *         if element is not None and c_ctxt.input is not NULL:             # <<<<<<<<<<<<<< 
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line
 */
    __pyx_1 = (__pyx_v_c_ctxt->input != NULL);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1179
 *             tag, attrib, EMPTY_READ_ONLY_DICT)
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:             # <<<<<<<<<<<<<< 
 *                 element._c_node.line = <short>c_ctxt.input.line
 *             else:
 */
    __pyx_1 = (__pyx_v_c_ctxt->input->line < 65535);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1180
 *         if element is not None and c_ctxt.input is not NULL:
 *             if c_ctxt.input.line < 65535:
 *                 element._c_node.line = <short>c_ctxt.input.line             # <<<<<<<<<<<<<< 
 *             else:
 *                 element._c_node.line = 65535
 */
      __pyx_v_element->_c_node->line = ((short)__pyx_v_c_ctxt->input->line);
      goto __pyx_L11;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1182
 *                 element._c_node.line = <short>c_ctxt.input.line
 *             else:
 *                 element._c_node.line = 65535             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
      __pyx_v_element->_c_node->line = 65535;
    }
    __pyx_L11:;
    goto __pyx_L10;
  }
  __pyx_L10:;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1183
 *             else:
 *                 element._c_node.line = 65535
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxStartNoNs");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1183; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1184
 *                 element._c_node.line = 65535
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxEnd(void* ctxt, char* c_localname, char* c_prefix,
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("lxml.etree._handleSaxStartNoNs");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1186
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxEnd(void* ctxt, char* c_localname, char* c_prefix,             # <<<<<<<<<<<<<< 
 *                         char* c_namespace) with gil:
 *     cdef _SaxParserContext context
 */

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) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
PyObject *__pyx_v_tag;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_tag = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1190
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1191
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1192
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEnd is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1193
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxEnd is not NULL:
 *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1194
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEnd is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxEnd != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1195
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEnd is not NULL:
 *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)             # <<<<<<<<<<<<<< 
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 */
  __pyx_v_context->_origSaxEnd(__pyx_v_c_ctxt,__pyx_v_c_localname,__pyx_v_c_prefix,__pyx_v_c_namespace);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1196
 *     if context._origSaxEnd is not NULL:
 *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
 *     try:             # <<<<<<<<<<<<<< 
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 *         context._target._handleSaxEnd(tag)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1197
 *         context._origSaxEnd(c_ctxt, c_localname, c_prefix, c_namespace)
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxEnd(tag)
 *     except:
 */
  __pyx_2 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_c_namespace,__pyx_v_c_localname); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1197; goto __pyx_L4;}
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1198
 *     try:
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 *         context._target._handleSaxEnd(tag)             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target,__pyx_v_tag); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1198; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1199
 *         tag = _namespacedNameFromNsName(c_namespace, c_localname)
 *         context._target._handleSaxEnd(tag)
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxEnd");
  if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1199; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1200
 *         context._target._handleSaxEnd(tag)
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxEndNoNs(void* ctxt, char* c_name) with gil:
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._handleSaxEnd");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_tag);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1202
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxEndNoNs(void* ctxt, char* c_name) with gil:             # <<<<<<<<<<<<<< 
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__handleSaxEndNoNs(void *__pyx_v_ctxt,char *__pyx_v_c_name) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1205
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1206
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1207
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEndNoNs is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1208
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxEndNoNs is not NULL:
 *         context._origSaxEndNoNs(c_ctxt, c_name)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1209
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEndNoNs is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxEndNoNs(c_ctxt, c_name)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxEndNoNs != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1210
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxEndNoNs is not NULL:
 *         context._origSaxEndNoNs(c_ctxt, c_name)             # <<<<<<<<<<<<<< 
 *     try:
 *         context._target._handleSaxEnd(funicode(c_name))
 */
  __pyx_v_context->_origSaxEndNoNs(__pyx_v_c_ctxt,__pyx_v_c_name);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1211
 *     if context._origSaxEndNoNs is not NULL:
 *         context._origSaxEndNoNs(c_ctxt, c_name)
 *     try:             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxEnd(funicode(c_name))
 *     except:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1212
 *         context._origSaxEndNoNs(c_ctxt, c_name)
 *     try:
 *         context._target._handleSaxEnd(funicode(c_name))             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; goto __pyx_L4;}
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxEnd(__pyx_v_context->_target,__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1212; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1213
 *     try:
 *         context._target._handleSaxEnd(funicode(c_name))
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxEndNoNs");
  if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1213; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1214
 *         context._target._handleSaxEnd(funicode(c_name))
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxData(void* ctxt, char* c_data, int data_len) with gil:
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._handleSaxEndNoNs");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1216
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxData(void* ctxt, char* c_data, int data_len) with gil:             # <<<<<<<<<<<<<< 
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__handleSaxData(void *__pyx_v_ctxt,char *__pyx_v_c_data,int __pyx_v_data_len) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1219
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1220
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1221
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxData is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1222
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxData is not NULL:
 *         context._origSaxData(c_ctxt, c_data, data_len)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1223
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxData is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxData(c_ctxt, c_data, data_len)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxData != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1224
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxData is not NULL:
 *         context._origSaxData(c_ctxt, c_data, data_len)             # <<<<<<<<<<<<<< 
 *     try:
 *         context._target._handleSaxData(
 */
  __pyx_v_context->_origSaxData(__pyx_v_c_ctxt,__pyx_v_c_data,__pyx_v_data_len);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1225
 *     if context._origSaxData is not NULL:
 *         context._origSaxData(c_ctxt, c_data, data_len)
 *     try:             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxData(
 *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1227
 *     try:
 *         context._target._handleSaxData(
 *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = PyUnicode_DecodeUTF8(__pyx_v_c_data,__pyx_v_data_len,NULL); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1227; goto __pyx_L4;}
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxData(__pyx_v_context->_target,__pyx_2); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1226; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1228
 *         context._target._handleSaxData(
 *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxData");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1228; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1229
 *             python.PyUnicode_DecodeUTF8(c_data, data_len, NULL))
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxDoctype(void* ctxt, char* c_name, char* c_public,
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("lxml.etree._handleSaxData");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1231
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxDoctype(void* ctxt, char* c_name, char* c_public,             # <<<<<<<<<<<<<< 
 *                             char* c_system) with gil:
 *     cdef _SaxParserContext context
 */

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) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
PyObject *__pyx_v_public_id;
PyObject *__pyx_v_system_id;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_public_id = Py_None; Py_INCREF(Py_None);
__pyx_v_system_id = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1235
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1236
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1237
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxDoctype is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1238
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxDoctype is not NULL:
 *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1239
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxDoctype is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxDoctype != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1240
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxDoctype is not NULL:
 *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)             # <<<<<<<<<<<<<< 
 *     try:
 *         if c_public is not NULL:
 */
  __pyx_v_context->_origSaxDoctype(__pyx_v_c_ctxt,__pyx_v_c_name,__pyx_v_c_public,__pyx_v_c_system);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1241
 *     if context._origSaxDoctype is not NULL:
 *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
 *     try:             # <<<<<<<<<<<<<< 
 *         if c_public is not NULL:
 *             public_id = funicode(c_public)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1242
 *         context._origSaxDoctype(c_ctxt, c_name, c_public, c_system)
 *     try:
 *         if c_public is not NULL:             # <<<<<<<<<<<<<< 
 *             public_id = funicode(c_public)
 *         if c_system is not NULL:
 */
  __pyx_1 = (__pyx_v_c_public != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1243
 *     try:
 *         if c_public is not NULL:
 *             public_id = funicode(c_public)             # <<<<<<<<<<<<<< 
 *         if c_system is not NULL:
 *             system_id = funicode(c_system)
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_public); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1243; goto __pyx_L4;}
    Py_DECREF(__pyx_v_public_id);
    __pyx_v_public_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1244
 *         if c_public is not NULL:
 *             public_id = funicode(c_public)
 *         if c_system is not NULL:             # <<<<<<<<<<<<<< 
 *             system_id = funicode(c_system)
 *         context._target._handleSaxDoctype(
 */
  __pyx_1 = (__pyx_v_c_system != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1245
 *             public_id = funicode(c_public)
 *         if c_system is not NULL:
 *             system_id = funicode(c_system)             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxDoctype(
 *             funicode(c_name), public_id, system_id)
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_system); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1245; goto __pyx_L4;}
    Py_DECREF(__pyx_v_system_id);
    __pyx_v_system_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1247
 *             system_id = funicode(c_system)
 *         context._target._handleSaxDoctype(
 *             funicode(c_name), public_id, system_id)             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1247; goto __pyx_L4;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1247
 *             system_id = funicode(c_system)
 *         context._target._handleSaxDoctype(
 *             funicode(c_name), public_id, system_id)             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxDoctype(__pyx_v_context->_target,__pyx_2,__pyx_v_public_id,__pyx_v_system_id); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1246; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1248
 *         context._target._handleSaxDoctype(
 *             funicode(c_name), public_id, system_id)
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxDoctype");
  if (__Pyx_GetException(&__pyx_2, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1248; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1249
 *             funicode(c_name), public_id, system_id)
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxPI(void* ctxt, char* c_target, char* c_data) with gil:
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("lxml.etree._handleSaxDoctype");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_id);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1251
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxPI(void* ctxt, char* c_target, char* c_data) with gil:             # <<<<<<<<<<<<<< 
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__handleSaxPI(void *__pyx_v_ctxt,char *__pyx_v_c_target,char *__pyx_v_c_data) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
PyObject *__pyx_v_data;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_data = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1254
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1255
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1256
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxPi is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1257
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxPi is not NULL:
 *         context._origSaxPi(c_ctxt, c_target, c_data)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1258
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxPi is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxPi(c_ctxt, c_target, c_data)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxPi != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1259
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxPi is not NULL:
 *         context._origSaxPi(c_ctxt, c_target, c_data)             # <<<<<<<<<<<<<< 
 *     try:
 *         if c_data is not NULL:
 */
  __pyx_v_context->_origSaxPi(__pyx_v_c_ctxt,__pyx_v_c_target,__pyx_v_c_data);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1260
 *     if context._origSaxPi is not NULL:
 *         context._origSaxPi(c_ctxt, c_target, c_data)
 *     try:             # <<<<<<<<<<<<<< 
 *         if c_data is not NULL:
 *             data = funicode(c_data)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1261
 *         context._origSaxPi(c_ctxt, c_target, c_data)
 *     try:
 *         if c_data is not NULL:             # <<<<<<<<<<<<<< 
 *             data = funicode(c_data)
 *         context._target._handleSaxPi(funicode(c_target), data)
 */
  __pyx_1 = (__pyx_v_c_data != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1262
 *     try:
 *         if c_data is not NULL:
 *             data = funicode(c_data)             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxPi(funicode(c_target), data)
 *     except:
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_data); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1262; goto __pyx_L4;}
    Py_DECREF(__pyx_v_data);
    __pyx_v_data = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1263
 *         if c_data is not NULL:
 *             data = funicode(c_data)
 *         context._target._handleSaxPi(funicode(c_target), data)             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_target); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1263; goto __pyx_L4;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1263
 *         if c_data is not NULL:
 *             data = funicode(c_data)
 *         context._target._handleSaxPi(funicode(c_target), data)             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxPi(__pyx_v_context->_target,__pyx_2,__pyx_v_data); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1263; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1264
 *             data = funicode(c_data)
 *         context._target._handleSaxPi(funicode(c_target), data)
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxPI");
  if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1264; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1265
 *         context._target._handleSaxPi(funicode(c_target), data)
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _handleSaxComment(void* ctxt, char* c_data) with gil:
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._handleSaxPI");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_data);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1267
 *         context._handleSaxException(c_ctxt)
 * 
 * cdef void _handleSaxComment(void* ctxt, char* c_data) with gil:             # <<<<<<<<<<<<<< 
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__handleSaxComment(void *__pyx_v_ctxt,char *__pyx_v_c_data) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_c_ctxt;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1270
 *     cdef _SaxParserContext context
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     if c_ctxt._private is NULL:
 *         return
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1271
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 */
__pyx_1 = (__pyx_v_c_ctxt->_private == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1272
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     if c_ctxt._private is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxComment is not NULL:
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1273
 *     if c_ctxt._private is NULL:
 *         return
 *     context = <_SaxParserContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     if context._origSaxComment is not NULL:
 *         context._origSaxComment(c_ctxt, c_data)
 */
__pyx_2 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_2);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1274
 *         return
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxComment is not NULL:             # <<<<<<<<<<<<<< 
 *         context._origSaxComment(c_ctxt, c_data)
 *     try:
 */
__pyx_1 = (__pyx_v_context->_origSaxComment != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1275
 *     context = <_SaxParserContext>c_ctxt._private
 *     if context._origSaxComment is not NULL:
 *         context._origSaxComment(c_ctxt, c_data)             # <<<<<<<<<<<<<< 
 *     try:
 *         context._target._handleSaxComment(funicode(c_data))
 */
  __pyx_v_context->_origSaxComment(__pyx_v_c_ctxt,__pyx_v_c_data);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1276
 *     if context._origSaxComment is not NULL:
 *         context._origSaxComment(c_ctxt, c_data)
 *     try:             # <<<<<<<<<<<<<< 
 *         context._target._handleSaxComment(funicode(c_data))
 *     except:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1277
 *         context._origSaxComment(c_ctxt, c_data)
 *     try:
 *         context._target._handleSaxComment(funicode(c_data))             # <<<<<<<<<<<<<< 
 *     except:
 *         context._handleSaxException(c_ctxt)
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_data); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1277; goto __pyx_L4;}
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget *)__pyx_v_context->_target->__pyx_vtab)->_handleSaxComment(__pyx_v_context->_target,__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1277; goto __pyx_L4;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1278
 *     try:
 *         context._target._handleSaxComment(funicode(c_data))
 *     except:             # <<<<<<<<<<<<<< 
 *         context._handleSaxException(c_ctxt)
 * 
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._handleSaxComment");
  if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1278; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1279
 *         context._target._handleSaxComment(funicode(c_data))
 *     except:
 *         context._handleSaxException(c_ctxt)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  ((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);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._handleSaxComment");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1299
 *     cdef bint _in_tail
 * 
 *     def __init__(self, *, element_factory=None, parser=None):             # <<<<<<<<<<<<<< 
 *         self._sax_event_filter = \
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 */

static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_11TreeBuilder___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_factory = 0;
PyObject *__pyx_v_parser = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"element_factory","parser",0};
__pyx_v_element_factory = __pyx_k173;
__pyx_v_parser = __pyx_k174;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_element_factory, &__pyx_v_parser))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_element_factory);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1300
 * 
 *     def __init__(self, *, element_factory=None, parser=None):
 *         self._sax_event_filter = \             # <<<<<<<<<<<<<< 
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 *             SAX_EVENT_PI | SAX_EVENT_COMMENT
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1303
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 *             SAX_EVENT_PI | SAX_EVENT_COMMENT
 *         self._data = [] # data collector             # <<<<<<<<<<<<<< 
 *         self._element_stack = [] # element stack
 *         self._element_stack_pop = self._element_stack.pop
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1303; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1303
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 *             SAX_EVENT_PI | SAX_EVENT_COMMENT
 *         self._data = [] # data collector             # <<<<<<<<<<<<<< 
 *         self._element_stack = [] # element stack
 *         self._element_stack_pop = self._element_stack.pop
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_data);
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_data = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1304
 *             SAX_EVENT_PI | SAX_EVENT_COMMENT
 *         self._data = [] # data collector
 *         self._element_stack = [] # element stack             # <<<<<<<<<<<<<< 
 *         self._element_stack_pop = self._element_stack.pop
 *         self._last = None # last element
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1304; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1304
 *             SAX_EVENT_PI | SAX_EVENT_COMMENT
 *         self._data = [] # data collector
 *         self._element_stack = [] # element stack             # <<<<<<<<<<<<<< 
 *         self._element_stack_pop = self._element_stack.pop
 *         self._last = None # last element
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack);
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1305
 *         self._data = [] # data collector
 *         self._element_stack = [] # element stack
 *         self._element_stack_pop = self._element_stack.pop             # <<<<<<<<<<<<<< 
 *         self._last = None # last element
 *         self._in_tail = 0 # true if we're after an end tag
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack, __pyx_n_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1305; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1305
 *         self._data = [] # data collector
 *         self._element_stack = [] # element stack
 *         self._element_stack_pop = self._element_stack.pop             # <<<<<<<<<<<<<< 
 *         self._last = None # last element
 *         self._in_tail = 0 # true if we're after an end tag
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack_pop);
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack_pop = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1306
 *         self._element_stack = [] # element stack
 *         self._element_stack_pop = self._element_stack.pop
 *         self._last = None # last element             # <<<<<<<<<<<<<< 
 *         self._in_tail = 0 # true if we're after an end tag
 *         self._factory = element_factory
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last));
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last = ((struct LxmlElement *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1307
 *         self._element_stack_pop = self._element_stack.pop
 *         self._last = None # last element
 *         self._in_tail = 0 # true if we're after an end tag             # <<<<<<<<<<<<<< 
 *         self._factory = element_factory
 *         self._parser = parser
 */
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_in_tail = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1308
 *         self._last = None # last element
 *         self._in_tail = 0 # true if we're after an end tag
 *         self._factory = element_factory             # <<<<<<<<<<<<<< 
 *         self._parser = parser
 * 
 */
Py_INCREF(__pyx_v_element_factory);
Py_DECREF(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_factory);
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_factory = __pyx_v_element_factory;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1309
 *         self._in_tail = 0 # true if we're after an end tag
 *         self._factory = element_factory
 *         self._parser = parser             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _flush(self) except -1:
 */
if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1309; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1309
 *         self._in_tail = 0 # true if we're after an end tag
 *         self._factory = element_factory
 *         self._parser = parser             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _flush(self) except -1:
 */
Py_INCREF(__pyx_v_parser);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_parser));
((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.TreeBuilder.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_element_factory);
Py_DECREF(__pyx_v_parser);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1311
 *         self._parser = parser
 * 
 *     cdef int _flush(self) except -1:             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._data) > 0:
 *             if self._last is not None:
 */

static PyObject *__pyx_k524p;
static PyObject *__pyx_k525p;
static PyObject *__pyx_k526p;

static char __pyx_k524[] = "";
static char __pyx_k525[] = "internal error (tail)";
static char __pyx_k526[] = "internal error (text)";

static  int __pyx_f_4lxml_5etree_11TreeBuilder__flush(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self) {
PyObject *__pyx_v_text;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1312
 * 
 *     cdef int _flush(self) except -1:
 *         if python.PyList_GET_SIZE(self._data) > 0:             # <<<<<<<<<<<<<< 
 *             if self._last is not None:
 *                 text = "".join(self._data)
 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_self->_data) > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1313
 *     cdef int _flush(self) except -1:
 *         if python.PyList_GET_SIZE(self._data) > 0:
 *             if self._last is not None:             # <<<<<<<<<<<<<< 
 *                 text = "".join(self._data)
 *                 if self._in_tail:
 */
  __pyx_1 = (((PyObject *)__pyx_v_self->_last) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1314
 *         if python.PyList_GET_SIZE(self._data) > 0:
 *             if self._last is not None:
 *                 text = "".join(self._data)             # <<<<<<<<<<<<<< 
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"
 */
    __pyx_2 = PyObject_GetAttr(__pyx_k524p, __pyx_n_join); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1314; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1314
 *         if python.PyList_GET_SIZE(self._data) > 0:
 *             if self._last is not None:
 *                 text = "".join(self._data)             # <<<<<<<<<<<<<< 
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1314; goto __pyx_L1;}
    Py_INCREF(__pyx_v_self->_data);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self->_data);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1314; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_text);
    __pyx_v_text = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1315
 *             if self._last is not None:
 *                 text = "".join(self._data)
 *                 if self._in_tail:             # <<<<<<<<<<<<<< 
 *                     assert self._last.tail is None, "internal error (tail)"
 *                     self._last.tail = text
 */
    __pyx_1 = __pyx_v_self->_in_tail;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1316
 *                 text = "".join(self._data)
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"             # <<<<<<<<<<<<<< 
 *                     self._last.tail = text
 *                 else:
 */
      #ifndef PYREX_WITHOUT_ASSERTIONS

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1316
 *                 text = "".join(self._data)
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"             # <<<<<<<<<<<<<< 
 *                     self._last.tail = text
 *                 else:
 */
      __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_last), __pyx_n_tail); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1316; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1316
 *                 text = "".join(self._data)
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"             # <<<<<<<<<<<<<< 
 *                     self._last.tail = text
 *                 else:
 */
      __pyx_1 = (__pyx_2 == Py_None);
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      if (unlikely(!__pyx_1)) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1316
 *                 text = "".join(self._data)
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"             # <<<<<<<<<<<<<< 
 *                     self._last.tail = text
 *                 else:
 */
        PyErr_SetObject(PyExc_AssertionError, __pyx_k525p);
        {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1316; goto __pyx_L1;}
      }
      #endif

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1317
 *                 if self._in_tail:
 *                     assert self._last.tail is None, "internal error (tail)"
 *                     self._last.tail = text             # <<<<<<<<<<<<<< 
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"
 */
      if (PyObject_SetAttr(((PyObject *)__pyx_v_self->_last), __pyx_n_tail, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1317; goto __pyx_L1;}
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1319
 *                     self._last.tail = text
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"             # <<<<<<<<<<<<<< 
 *                     self._last.text = text
 *             del self._data[:]
 */
      #ifndef PYREX_WITHOUT_ASSERTIONS

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1319
 *                     self._last.tail = text
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"             # <<<<<<<<<<<<<< 
 *                     self._last.text = text
 *             del self._data[:]
 */
      __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_last), __pyx_n_text); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1319; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1319
 *                     self._last.tail = text
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"             # <<<<<<<<<<<<<< 
 *                     self._last.text = text
 *             del self._data[:]
 */
      __pyx_1 = (__pyx_3 == Py_None);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      if (unlikely(!__pyx_1)) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1319
 *                     self._last.tail = text
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"             # <<<<<<<<<<<<<< 
 *                     self._last.text = text
 *             del self._data[:]
 */
        PyErr_SetObject(PyExc_AssertionError, __pyx_k526p);
        {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1319; goto __pyx_L1;}
      }
      #endif

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1320
 *                 else:
 *                     assert self._last.text is None, "internal error (text)"
 *                     self._last.text = text             # <<<<<<<<<<<<<< 
 *             del self._data[:]
 *         return 0
 */
      if (PyObject_SetAttr(((PyObject *)__pyx_v_self->_last), __pyx_n_text, __pyx_v_text) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1320; goto __pyx_L1;}
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1321
 *                     assert self._last.text is None, "internal error (text)"
 *                     self._last.text = text
 *             del self._data[:]             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
  if (PySequence_DelSlice(__pyx_v_self->_data, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1321; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1322
 *                     self._last.text = text
 *             del self._data[:]
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     # Python level event handlers
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.TreeBuilder._flush");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1326
 *     # Python level event handlers
 * 
 *     def close(self):             # <<<<<<<<<<<<<< 
 *         """Flushes the builder buffers, and returns the toplevel document
 *         element.
 */

static PyObject *__pyx_k527p;
static PyObject *__pyx_k528p;

static char __pyx_k527[] = "missing end tags";
static char __pyx_k528[] = "missing toplevel element";

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_11TreeBuilder_close[] = "Flushes the builder buffers, and returns the toplevel document\n        element.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_close(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1330
 *         element.
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"             # <<<<<<<<<<<<<< 
 *         assert self._last is not None, "missing toplevel element"
 *         return self._last
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1330
 *         element.
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"             # <<<<<<<<<<<<<< 
 *         assert self._last is not None, "missing toplevel element"
 *         return self._last
 */
if (unlikely(!(PyList_GET_SIZE(((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_element_stack) == 0))) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1330
 *         element.
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"             # <<<<<<<<<<<<<< 
 *         assert self._last is not None, "missing toplevel element"
 *         return self._last
 */
  PyErr_SetObject(PyExc_AssertionError, __pyx_k527p);
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1330; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1331
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"
 *         assert self._last is not None, "missing toplevel element"             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1331
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"
 *         assert self._last is not None, "missing toplevel element"             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last) != Py_None);
if (unlikely(!__pyx_1)) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1331
 *         """
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"
 *         assert self._last is not None, "missing toplevel element"             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
  PyErr_SetObject(PyExc_AssertionError, __pyx_k528p);
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1331; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1332
 *         assert python.PyList_GET_SIZE(self._element_stack) == 0, "missing end tags"
 *         assert self._last is not None, "missing toplevel element"
 *         return self._last             # <<<<<<<<<<<<<< 
 * 
 *     def data(self, data):
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last));
__pyx_r = ((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.TreeBuilder.close");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1334
 *         return self._last
 * 
 *     def data(self, data):             # <<<<<<<<<<<<<< 
 *         """Adds text to the current element.  The value should be either an
 *         8-bit string containing ASCII text, or a Unicode string.
 */

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data); /*proto*/
static char __pyx_doc_4lxml_5etree_11TreeBuilder_data[] = "Adds text to the current element.  The value should be either an\n        8-bit string containing ASCII text, or a Unicode string.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_data(PyObject *__pyx_v_self, PyObject *__pyx_v_data) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1338
 *         8-bit string containing ASCII text, or a Unicode string.
 *         """
 *         self._handleSaxData(data)             # <<<<<<<<<<<<<< 
 * 
 *     def start(self, tag, attrs, nsmap=None):
 */
__pyx_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_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1338; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.TreeBuilder.data");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1340
 *         self._handleSaxData(data)
 * 
 *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<< 
 *         "Opens a new element."
 *         if nsmap is None:
 */

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_11TreeBuilder_start[] = "Opens a new element.";
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_start(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_attrs = 0;
PyObject *__pyx_v_nsmap = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"tag","attrs","nsmap",0};
__pyx_v_nsmap = __pyx_k175;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_tag, &__pyx_v_attrs, &__pyx_v_nsmap))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_attrs);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1342
 *     def start(self, tag, attrs, nsmap=None):
 *         "Opens a new element."
 *         if nsmap is None:             # <<<<<<<<<<<<<< 
 *             nsmap = EMPTY_READ_ONLY_DICT
 *         return self._handleSaxStart(tag, attrs, nsmap)
 */
__pyx_1 = (__pyx_v_nsmap == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1343
 *         "Opens a new element."
 *         if nsmap is None:
 *             nsmap = EMPTY_READ_ONLY_DICT             # <<<<<<<<<<<<<< 
 *         return self._handleSaxStart(tag, attrs, nsmap)
 * 
 */
  Py_INCREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
  Py_DECREF(__pyx_v_nsmap);
  __pyx_v_nsmap = __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1344
 *         if nsmap is None:
 *             nsmap = EMPTY_READ_ONLY_DICT
 *         return self._handleSaxStart(tag, attrs, nsmap)             # <<<<<<<<<<<<<< 
 * 
 *     def end(self, tag):
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1344; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.TreeBuilder.start");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrs);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1346
 *         return self._handleSaxStart(tag, attrs, nsmap)
 * 
 *     def end(self, tag):             # <<<<<<<<<<<<<< 
 *         "Closes the current element."
 *         element = self._handleSaxEnd(tag)
 */

static PyObject *__pyx_k529p;

static char __pyx_k529[] = "end tag mismatch (expected %s, got %s)";

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_end(PyObject *__pyx_v_self, PyObject *__pyx_v_tag); /*proto*/
static char __pyx_doc_4lxml_5etree_11TreeBuilder_end[] = "Closes the current element.";
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_end(PyObject *__pyx_v_self, PyObject *__pyx_v_tag) {
PyObject *__pyx_v_element;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1348
 *     def end(self, tag):
 *         "Closes the current element."
 *         element = self._handleSaxEnd(tag)             # <<<<<<<<<<<<<< 
 *         assert self._last.tag == tag,\
 *                "end tag mismatch (expected %s, got %s)" % (
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1348; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1349
 *         "Closes the current element."
 *         element = self._handleSaxEnd(tag)
 *         assert self._last.tag == tag,\             # <<<<<<<<<<<<<< 
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)
 */
#ifndef PYREX_WITHOUT_ASSERTIONS

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1349
 *         "Closes the current element."
 *         element = self._handleSaxEnd(tag)
 *         assert self._last.tag == tag,\             # <<<<<<<<<<<<<< 
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last), __pyx_n_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1349; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1349
 *         "Closes the current element."
 *         element = self._handleSaxEnd(tag)
 *         assert self._last.tag == tag,\             # <<<<<<<<<<<<<< 
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)
 */
__pyx_2 = PyObject_RichCompare(__pyx_1, __pyx_v_tag, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1349; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1349; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (unlikely(!__pyx_3)) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1351
 *         assert self._last.tag == tag,\
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)             # <<<<<<<<<<<<<< 
 *         return element
 * 
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_TreeBuilder *)__pyx_v_self)->_last), __pyx_n_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1351; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1351
 *         assert self._last.tag == tag,\
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)             # <<<<<<<<<<<<<< 
 *         return element
 * 
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1351; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_tag);
  __pyx_1 = 0;
  __pyx_1 = PyNumber_Remainder(__pyx_k529p, __pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1350; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  PyErr_SetObject(PyExc_AssertionError, __pyx_1);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1349; goto __pyx_L1;}
}
#endif

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1352
 *                "end tag mismatch (expected %s, got %s)" % (
 *                    self._last.tag, tag)
 *         return element             # <<<<<<<<<<<<<< 
 * 
 *     def pi(self, target, data):
 */
Py_INCREF(__pyx_v_element);
__pyx_r = __pyx_v_element;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.TreeBuilder.end");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1354
 *         return element
 * 
 *     def pi(self, target, data):             # <<<<<<<<<<<<<< 
 *         return self._handleSaxPi(target, data)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_pi(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_data = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"target","data",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_target, &__pyx_v_data))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1355
 * 
 *     def pi(self, target, data):
 *         return self._handleSaxPi(target, data)             # <<<<<<<<<<<<<< 
 * 
 *     def comment(self, comment):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1355; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.TreeBuilder.pi");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1357
 *         return self._handleSaxPi(target, data)
 * 
 *     def comment(self, comment):             # <<<<<<<<<<<<<< 
 *         return self._handleSaxComment(comment)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_comment(PyObject *__pyx_v_self, PyObject *__pyx_v_comment); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_11TreeBuilder_comment(PyObject *__pyx_v_self, PyObject *__pyx_v_comment) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_comment);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1358
 * 
 *     def comment(self, comment):
 *         return self._handleSaxComment(comment)             # <<<<<<<<<<<<<< 
 * 
 *     # internal SAX event handlers
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1358; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.TreeBuilder.comment");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_comment);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1362
 *     # internal SAX event handlers
 * 
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<< 
 *         self._flush()
 *         if self._factory is not None:
 */

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) {
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1363
 * 
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         self._flush()             # <<<<<<<<<<<<<< 
 *         if self._factory is not None:
 *             self._last = self._factory(tag, attrib)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1363; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1364
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         self._flush()
 *         if self._factory is not None:             # <<<<<<<<<<<<<< 
 *             self._last = self._factory(tag, attrib)
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 */
__pyx_2 = (__pyx_v_self->_factory != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1365
 *         self._flush()
 *         if self._factory is not None:
 *             self._last = self._factory(tag, attrib)             # <<<<<<<<<<<<<< 
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 *                 _appendChild(self._element_stack[-1], self._last)
 */
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1365; goto __pyx_L1;}
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_tag);
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_attrib);
  __pyx_4 = PyObject_CallObject(__pyx_v_self->_factory, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1365; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1365; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1365
 *         self._flush()
 *         if self._factory is not None:
 *             self._last = self._factory(tag, attrib)             # <<<<<<<<<<<<<< 
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 *                 _appendChild(self._element_stack[-1], self._last)
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_last));
  __pyx_v_self->_last = ((struct LxmlElement *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1366
 *         if self._factory is not None:
 *             self._last = self._factory(tag, attrib)
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<< 
 *                 _appendChild(self._element_stack[-1], self._last)
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 */
  __pyx_2 = (PyList_GET_SIZE(__pyx_v_self->_element_stack) > 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1367
 *             self._last = self._factory(tag, attrib)
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 *             self._last = _makeSubElement(
 */
    if (PyList_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyList_GET_SIZE(__pyx_v_self->_element_stack)) {
      __pyx_4 = PyList_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_4);
      } else if (PyTuple_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyTuple_GET_SIZE(__pyx_v_self->_element_stack)) {
      __pyx_4 = PyTuple_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_4);
      } else {
      __pyx_3 = PyInt_FromLong(-1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1367; goto __pyx_L1;}
      __pyx_4 = PyObject_GetItem(__pyx_v_self->_element_stack, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1367; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
    }
    if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1367; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1367
 *             self._last = self._factory(tag, attrib)
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 *                 _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 *             self._last = _makeSubElement(
 */
    __pyx_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_4),__pyx_v_self->_last); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1367; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1368
 *             if python.PyList_GET_SIZE(self._element_stack) > 0:
 *                 _appendChild(self._element_stack[-1], self._last)
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<< 
 *             self._last = _makeSubElement(
 *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
 */
__pyx_2 = (PyList_GET_SIZE(__pyx_v_self->_element_stack) > 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1370
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 *             self._last = _makeSubElement(
 *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 *         else:
 *             self._last = _makeElement(
 */
  if (PyList_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyList_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_4 = PyList_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_4);
    } else if (PyTuple_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyTuple_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_4 = PyTuple_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_4);
    } else {
    __pyx_3 = PyInt_FromLong(-1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1370; goto __pyx_L1;}
    __pyx_4 = PyObject_GetItem(__pyx_v_self->_element_stack, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1370; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1370; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1370
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 *             self._last = _makeSubElement(
 *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 *         else:
 *             self._last = _makeElement(
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__makeSubElement(((struct LxmlElement *)__pyx_4),__pyx_v_tag,Py_None,Py_None,__pyx_v_attrib,__pyx_v_nsmap,Py_None)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1369; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1369
 *                 _appendChild(self._element_stack[-1], self._last)
 *         elif python.PyList_GET_SIZE(self._element_stack) > 0:
 *             self._last = _makeSubElement(             # <<<<<<<<<<<<<< 
 *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
 *         else:
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_last));
  __pyx_v_self->_last = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1373
 *         else:
 *             self._last = _makeElement(
 *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._element_stack, self._last)
 *         self._in_tail = 0
 */
  __pyx_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_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1372; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1372
 *                 self._element_stack[-1], tag, None, None, attrib, nsmap, None)
 *         else:
 *             self._last = _makeElement(             # <<<<<<<<<<<<<< 
 *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
 *         python.PyList_Append(self._element_stack, self._last)
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_last));
  __pyx_v_self->_last = ((struct LxmlElement *)__pyx_4);
  __pyx_4 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1374
 *             self._last = _makeElement(
 *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
 *         python.PyList_Append(self._element_stack, self._last)             # <<<<<<<<<<<<<< 
 *         self._in_tail = 0
 *         return self._last
 */
__pyx_1 = PyList_Append(__pyx_v_self->_element_stack,((PyObject *)__pyx_v_self->_last)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1374; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1375
 *                 tag, NULL, None, self._parser, None, None, attrib, nsmap, None)
 *         python.PyList_Append(self._element_stack, self._last)
 *         self._in_tail = 0             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
__pyx_v_self->_in_tail = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1376
 *         python.PyList_Append(self._element_stack, self._last)
 *         self._in_tail = 0
 *         return self._last             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxEnd(self, tag):
 */
Py_INCREF(((PyObject *)__pyx_v_self->_last));
__pyx_r = ((PyObject *)__pyx_v_self->_last);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxStart");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1378
 *         return self._last
 * 
 *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<< 
 *         self._flush()
 *         self._last = self._element_stack_pop()
 */

static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1379
 * 
 *     cdef _handleSaxEnd(self, tag):
 *         self._flush()             # <<<<<<<<<<<<<< 
 *         self._last = self._element_stack_pop()
 *         self._in_tail = 1
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1379; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1380
 *     cdef _handleSaxEnd(self, tag):
 *         self._flush()
 *         self._last = self._element_stack_pop()             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
__pyx_2 = PyObject_CallObject(__pyx_v_self->_element_stack_pop, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1380; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1380; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1380
 *     cdef _handleSaxEnd(self, tag):
 *         self._flush()
 *         self._last = self._element_stack_pop()             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
Py_DECREF(((PyObject *)__pyx_v_self->_last));
__pyx_v_self->_last = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1381
 *         self._flush()
 *         self._last = self._element_stack_pop()
 *         self._in_tail = 1             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
__pyx_v_self->_in_tail = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1382
 *         self._last = self._element_stack_pop()
 *         self._in_tail = 1
 *         return self._last             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _handleSaxData(self, data) except -1:
 */
Py_INCREF(((PyObject *)__pyx_v_self->_last));
__pyx_r = ((PyObject *)__pyx_v_self->_last);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxEnd");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1384
 *         return self._last
 * 
 *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._data, data)
 * 
 */

static  int __pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self,PyObject *__pyx_v_data) {
int __pyx_r;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1385
 * 
 *     cdef int _handleSaxData(self, data) except -1:
 *         python.PyList_Append(self._data, data)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxPi(self, target, data):
 */
__pyx_1 = PyList_Append(__pyx_v_self->_data,__pyx_v_data); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1385; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxData");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1387
 *         python.PyList_Append(self._data, data)
 * 
 *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<< 
 *         self._flush()
 *         self._last = ProcessingInstruction(target, data)
 */

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) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1388
 * 
 *     cdef _handleSaxPi(self, target, data):
 *         self._flush()             # <<<<<<<<<<<<<< 
 *         self._last = ProcessingInstruction(target, data)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1388; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1389
 *     cdef _handleSaxPi(self, target, data):
 *         self._flush()
 *         self._last = ProcessingInstruction(target, data)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ProcessingInstruction); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1389; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1389
 *     cdef _handleSaxPi(self, target, data):
 *         self._flush()
 *         self._last = ProcessingInstruction(target, data)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1389; goto __pyx_L1;}
Py_INCREF(__pyx_v_target);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_target);
Py_INCREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_data);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1389; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1389; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1389
 *     cdef _handleSaxPi(self, target, data):
 *         self._flush()
 *         self._last = ProcessingInstruction(target, data)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
Py_DECREF(((PyObject *)__pyx_v_self->_last));
__pyx_v_self->_last = ((struct LxmlElement *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1390
 *         self._flush()
 *         self._last = ProcessingInstruction(target, data)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<< 
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1
 */
__pyx_5 = (PyList_GET_SIZE(__pyx_v_self->_element_stack) > 0);
if (__pyx_5) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1391
 *         self._last = ProcessingInstruction(target, data)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
  if (PyList_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyList_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_3 = PyList_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_3);
    } else if (PyTuple_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyTuple_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_3);
    } else {
    __pyx_2 = PyInt_FromLong(-1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1391; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_self->_element_stack, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1391; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1391; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1391
 *         self._last = ProcessingInstruction(target, data)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
  __pyx_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_3),__pyx_v_self->_last); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1391; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1392
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
__pyx_v_self->_in_tail = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1393
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1
 *         return self._last             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxComment(self, comment):
 */
Py_INCREF(((PyObject *)__pyx_v_self->_last));
__pyx_r = ((PyObject *)__pyx_v_self->_last);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxPi");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1395
 *         return self._last
 * 
 *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<< 
 *         self._flush()
 *         self._last = Comment(comment)
 */

static  PyObject *__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment(struct __pyx_obj_4lxml_5etree_TreeBuilder *__pyx_v_self,PyObject *__pyx_v_comment) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_comment);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1396
 * 
 *     cdef _handleSaxComment(self, comment):
 *         self._flush()             # <<<<<<<<<<<<<< 
 *         self._last = Comment(comment)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder *)__pyx_v_self->__pyx_base.__pyx_vtab)->_flush(__pyx_v_self); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1396; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1397
 *     cdef _handleSaxComment(self, comment):
 *         self._flush()
 *         self._last = Comment(comment)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_Comment); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1397; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1397
 *     cdef _handleSaxComment(self, comment):
 *         self._flush()
 *         self._last = Comment(comment)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1397; goto __pyx_L1;}
Py_INCREF(__pyx_v_comment);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_comment);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1397; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1397; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1397
 *     cdef _handleSaxComment(self, comment):
 *         self._flush()
 *         self._last = Comment(comment)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 */
Py_DECREF(((PyObject *)__pyx_v_self->_last));
__pyx_v_self->_last = ((struct LxmlElement *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1398
 *         self._flush()
 *         self._last = Comment(comment)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:             # <<<<<<<<<<<<<< 
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1
 */
__pyx_5 = (PyList_GET_SIZE(__pyx_v_self->_element_stack) > 0);
if (__pyx_5) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1399
 *         self._last = Comment(comment)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
  if (PyList_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyList_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_3 = PyList_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_3);
    } else if (PyTuple_CheckExact(__pyx_v_self->_element_stack) && 0 <= -1 && -1 < PyTuple_GET_SIZE(__pyx_v_self->_element_stack)) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_element_stack, -1); Py_INCREF(__pyx_3);
    } else {
    __pyx_2 = PyInt_FromLong(-1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1399; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_self->_element_stack, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1399; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1399; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1399
 *         self._last = Comment(comment)
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)             # <<<<<<<<<<<<<< 
 *         self._in_tail = 1
 *         return self._last
 */
  __pyx_1 = __pyx_f_4lxml_5etree__appendChild(((struct LxmlElement *)__pyx_3),__pyx_v_self->_last); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1399; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1400
 *         if python.PyList_GET_SIZE(self._element_stack) > 0:
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1             # <<<<<<<<<<<<<< 
 *         return self._last
 * 
 */
__pyx_v_self->_in_tail = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1401
 *             _appendChild(self._element_stack[-1], self._last)
 *         self._in_tail = 1
 *         return self._last             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
Py_INCREF(((PyObject *)__pyx_v_self->_last));
__pyx_r = ((PyObject *)__pyx_v_self->_last);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.TreeBuilder._handleSaxComment");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_comment);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1447
 *     apply to the default parser.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */

static int __pyx_pf_4lxml_5etree_9XMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_9XMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_attribute_defaults = 0;
PyObject *__pyx_v_dtd_validation = 0;
PyObject *__pyx_v_load_dtd = 0;
PyObject *__pyx_v_no_network = 0;
PyObject *__pyx_v_ns_clean = 0;
PyObject *__pyx_v_recover = 0;
PyObject *__pyx_v_remove_blank_text = 0;
PyObject *__pyx_v_compact = 0;
PyObject *__pyx_v_resolve_entities = 0;
PyObject *__pyx_v_remove_comments = 0;
PyObject *__pyx_v_remove_pis = 0;
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_encoding = 0;
int __pyx_v_parse_options;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"attribute_defaults","dtd_validation","load_dtd","no_network","ns_clean","recover","remove_blank_text","compact","resolve_entities","remove_comments","remove_pis","target","encoding",0};
__pyx_v_attribute_defaults = __pyx_k176;
__pyx_v_dtd_validation = __pyx_k177;
__pyx_v_load_dtd = __pyx_k178;
__pyx_v_no_network = __pyx_k179;
__pyx_v_ns_clean = __pyx_k180;
__pyx_v_recover = __pyx_k181;
__pyx_v_remove_blank_text = __pyx_k182;
__pyx_v_compact = __pyx_k183;
__pyx_v_resolve_entities = __pyx_k184;
__pyx_v_remove_comments = __pyx_k185;
__pyx_v_remove_pis = __pyx_k186;
__pyx_v_target = __pyx_k187;
__pyx_v_encoding = __pyx_k188;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOOOOOOO", __pyx_argnames, &__pyx_v_attribute_defaults, &__pyx_v_dtd_validation, &__pyx_v_load_dtd, &__pyx_v_no_network, &__pyx_v_ns_clean, &__pyx_v_recover, &__pyx_v_remove_blank_text, &__pyx_v_compact, &__pyx_v_resolve_entities, &__pyx_v_remove_comments, &__pyx_v_remove_pis, &__pyx_v_target, &__pyx_v_encoding))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_attribute_defaults);
Py_INCREF(__pyx_v_dtd_validation);
Py_INCREF(__pyx_v_load_dtd);
Py_INCREF(__pyx_v_no_network);
Py_INCREF(__pyx_v_ns_clean);
Py_INCREF(__pyx_v_recover);
Py_INCREF(__pyx_v_remove_blank_text);
Py_INCREF(__pyx_v_compact);
Py_INCREF(__pyx_v_resolve_entities);
Py_INCREF(__pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1453
 *                  remove_pis=False, target=None, encoding=None):
 *         cdef int parse_options
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<< 
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_v_parse_options = __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1454
 *         cdef int parse_options
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 *         if load_dtd:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 *         if dtd_validation:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_load_dtd); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1454; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1455
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if dtd_validation:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1456
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 *         if dtd_validation:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_dtd_validation); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1456; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1458
 *         if dtd_validation:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if attribute_defaults:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1459
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if attribute_defaults:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1459; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1461
 *         if attribute_defaults:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if ns_clean:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDATTR) | XML_PARSE_DTDLOAD);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1462
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if ns_clean:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
 *         if recover:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_ns_clean); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1462; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1463
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if ns_clean:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN             # <<<<<<<<<<<<<< 
 *         if recover:
 *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NSCLEAN);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1464
 *         if ns_clean:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
 *         if recover:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
 *         if remove_blank_text:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_recover); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1464; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1465
 *             parse_options = parse_options | xmlparser.XML_PARSE_NSCLEAN
 *         if recover:
 *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER             # <<<<<<<<<<<<<< 
 *         if remove_blank_text:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_RECOVER);
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1466
 *         if recover:
 *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
 *         if remove_blank_text:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 *         if not no_network:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1466; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1467
 *             parse_options = parse_options | xmlparser.XML_PARSE_RECOVER
 *         if remove_blank_text:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS             # <<<<<<<<<<<<<< 
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1468
 *         if remove_blank_text:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 *         if not no_network:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if not compact:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1468; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1469
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET             # <<<<<<<<<<<<<< 
 *         if not compact:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NONET);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1470
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if not compact:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
 *         if not resolve_entities:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_compact); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1470; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1471
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if not compact:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT             # <<<<<<<<<<<<<< 
 *         if not resolve_entities:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_COMPACT);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1472
 *         if not compact:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
 *         if not resolve_entities:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_resolve_entities); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1472; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1473
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_COMPACT
 *         if not resolve_entities:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT             # <<<<<<<<<<<<<< 
 * 
 *         _BaseParser.__init__(self, parse_options, 0,
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NOENT);
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1475
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
 * 
 *         _BaseParser.__init__(self, parse_options, 0,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)
 */
__pyx_3 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser), __pyx_n___init__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1475; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1475
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NOENT
 * 
 *         _BaseParser.__init__(self, parse_options, 0,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)
 */
__pyx_4 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1475; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1477
 *         _BaseParser.__init__(self, parse_options, 0,
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)             # <<<<<<<<<<<<<< 
 * 
 * cdef class ETCompatXMLParser(XMLParser):
 */
__pyx_5 = PyTuple_New(8); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1475; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
Py_INCREF(__pyx_num_0);
PyTuple_SET_ITEM(__pyx_5, 2, __pyx_num_0);
Py_INCREF(__pyx_v_remove_comments);
PyTuple_SET_ITEM(__pyx_5, 3, __pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
PyTuple_SET_ITEM(__pyx_5, 4, __pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
PyTuple_SET_ITEM(__pyx_5, 5, __pyx_v_target);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_5, 6, Py_None);
Py_INCREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_5, 7, __pyx_v_encoding);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1475; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.XMLParser.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_attribute_defaults);
Py_DECREF(__pyx_v_dtd_validation);
Py_DECREF(__pyx_v_load_dtd);
Py_DECREF(__pyx_v_no_network);
Py_DECREF(__pyx_v_ns_clean);
Py_DECREF(__pyx_v_recover);
Py_DECREF(__pyx_v_remove_blank_text);
Py_DECREF(__pyx_v_compact);
Py_DECREF(__pyx_v_resolve_entities);
Py_DECREF(__pyx_v_remove_comments);
Py_DECREF(__pyx_v_remove_pis);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_encoding);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1486
 *     and thus ignores comments and processing instructions.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */

static PyObject *__pyx_n_attribute_defaults;
static PyObject *__pyx_n_dtd_validation;
static PyObject *__pyx_n_load_dtd;
static PyObject *__pyx_n_no_network;
static PyObject *__pyx_n_ns_clean;
static PyObject *__pyx_n_recover;
static PyObject *__pyx_n_remove_blank_text;
static PyObject *__pyx_n_compact;
static PyObject *__pyx_n_resolve_entities;
static PyObject *__pyx_n_remove_comments;
static PyObject *__pyx_n_remove_pis;
static PyObject *__pyx_n_encoding;


static int __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_attribute_defaults = 0;
PyObject *__pyx_v_dtd_validation = 0;
PyObject *__pyx_v_load_dtd = 0;
PyObject *__pyx_v_no_network = 0;
PyObject *__pyx_v_ns_clean = 0;
PyObject *__pyx_v_recover = 0;
PyObject *__pyx_v_remove_blank_text = 0;
PyObject *__pyx_v_compact = 0;
PyObject *__pyx_v_resolve_entities = 0;
PyObject *__pyx_v_remove_comments = 0;
PyObject *__pyx_v_remove_pis = 0;
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_encoding = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"attribute_defaults","dtd_validation","load_dtd","no_network","ns_clean","recover","remove_blank_text","compact","resolve_entities","remove_comments","remove_pis","target","encoding",0};
__pyx_v_attribute_defaults = __pyx_k189;
__pyx_v_dtd_validation = __pyx_k190;
__pyx_v_load_dtd = __pyx_k191;
__pyx_v_no_network = __pyx_k192;
__pyx_v_ns_clean = __pyx_k193;
__pyx_v_recover = __pyx_k194;
__pyx_v_remove_blank_text = __pyx_k195;
__pyx_v_compact = __pyx_k196;
__pyx_v_resolve_entities = __pyx_k197;
__pyx_v_remove_comments = __pyx_k198;
__pyx_v_remove_pis = __pyx_k199;
__pyx_v_target = __pyx_k200;
__pyx_v_encoding = __pyx_k201;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOOOOOOO", __pyx_argnames, &__pyx_v_attribute_defaults, &__pyx_v_dtd_validation, &__pyx_v_load_dtd, &__pyx_v_no_network, &__pyx_v_ns_clean, &__pyx_v_recover, &__pyx_v_remove_blank_text, &__pyx_v_compact, &__pyx_v_resolve_entities, &__pyx_v_remove_comments, &__pyx_v_remove_pis, &__pyx_v_target, &__pyx_v_encoding))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_attribute_defaults);
Py_INCREF(__pyx_v_dtd_validation);
Py_INCREF(__pyx_v_load_dtd);
Py_INCREF(__pyx_v_no_network);
Py_INCREF(__pyx_v_ns_clean);
Py_INCREF(__pyx_v_recover);
Py_INCREF(__pyx_v_remove_blank_text);
Py_INCREF(__pyx_v_compact);
Py_INCREF(__pyx_v_resolve_entities);
Py_INCREF(__pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1491
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):
 *         XMLParser.__init__(self,             # <<<<<<<<<<<<<< 
 *                            attribute_defaults=attribute_defaults,
 *                            dtd_validation=dtd_validation,
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1491
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):
 *         XMLParser.__init__(self,             # <<<<<<<<<<<<<< 
 *                            attribute_defaults=attribute_defaults,
 *                            dtd_validation=dtd_validation,
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1492
 *                  remove_pis=True, target=None, encoding=None):
 *         XMLParser.__init__(self,
 *                            attribute_defaults=attribute_defaults,             # <<<<<<<<<<<<<< 
 *                            dtd_validation=dtd_validation,
 *                            load_dtd=load_dtd,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_attribute_defaults, __pyx_v_attribute_defaults) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1493
 *         XMLParser.__init__(self,
 *                            attribute_defaults=attribute_defaults,
 *                            dtd_validation=dtd_validation,             # <<<<<<<<<<<<<< 
 *                            load_dtd=load_dtd,
 *                            no_network=no_network,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_dtd_validation, __pyx_v_dtd_validation) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1494
 *                            attribute_defaults=attribute_defaults,
 *                            dtd_validation=dtd_validation,
 *                            load_dtd=load_dtd,             # <<<<<<<<<<<<<< 
 *                            no_network=no_network,
 *                            ns_clean=ns_clean,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_load_dtd, __pyx_v_load_dtd) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1495
 *                            dtd_validation=dtd_validation,
 *                            load_dtd=load_dtd,
 *                            no_network=no_network,             # <<<<<<<<<<<<<< 
 *                            ns_clean=ns_clean,
 *                            recover=recover,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_no_network, __pyx_v_no_network) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1496
 *                            load_dtd=load_dtd,
 *                            no_network=no_network,
 *                            ns_clean=ns_clean,             # <<<<<<<<<<<<<< 
 *                            recover=recover,
 *                            remove_blank_text=remove_blank_text,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_ns_clean, __pyx_v_ns_clean) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1497
 *                            no_network=no_network,
 *                            ns_clean=ns_clean,
 *                            recover=recover,             # <<<<<<<<<<<<<< 
 *                            remove_blank_text=remove_blank_text,
 *                            compact=compact,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_recover, __pyx_v_recover) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1498
 *                            ns_clean=ns_clean,
 *                            recover=recover,
 *                            remove_blank_text=remove_blank_text,             # <<<<<<<<<<<<<< 
 *                            compact=compact,
 *                            resolve_entities=resolve_entities,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_remove_blank_text, __pyx_v_remove_blank_text) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1499
 *                            recover=recover,
 *                            remove_blank_text=remove_blank_text,
 *                            compact=compact,             # <<<<<<<<<<<<<< 
 *                            resolve_entities=resolve_entities,
 *                            remove_comments=remove_comments,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_compact, __pyx_v_compact) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1500
 *                            remove_blank_text=remove_blank_text,
 *                            compact=compact,
 *                            resolve_entities=resolve_entities,             # <<<<<<<<<<<<<< 
 *                            remove_comments=remove_comments,
 *                            remove_pis=remove_pis,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_resolve_entities, __pyx_v_resolve_entities) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1501
 *                            compact=compact,
 *                            resolve_entities=resolve_entities,
 *                            remove_comments=remove_comments,             # <<<<<<<<<<<<<< 
 *                            remove_pis=remove_pis,
 *                            target=target,
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_remove_comments, __pyx_v_remove_comments) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1502
 *                            resolve_entities=resolve_entities,
 *                            remove_comments=remove_comments,
 *                            remove_pis=remove_pis,             # <<<<<<<<<<<<<< 
 *                            target=target,
 *                            encoding=encoding)
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_remove_pis, __pyx_v_remove_pis) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1503
 *                            remove_comments=remove_comments,
 *                            remove_pis=remove_pis,
 *                            target=target,             # <<<<<<<<<<<<<< 
 *                            encoding=encoding)
 * 
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_target, __pyx_v_target) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1504
 *                            remove_pis=remove_pis,
 *                            target=target,
 *                            encoding=encoding)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_encoding, __pyx_v_encoding) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1491; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.ETCompatXMLParser.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_attribute_defaults);
Py_DECREF(__pyx_v_dtd_validation);
Py_DECREF(__pyx_v_load_dtd);
Py_DECREF(__pyx_v_no_network);
Py_DECREF(__pyx_v_ns_clean);
Py_DECREF(__pyx_v_recover);
Py_DECREF(__pyx_v_remove_blank_text);
Py_DECREF(__pyx_v_compact);
Py_DECREF(__pyx_v_resolve_entities);
Py_DECREF(__pyx_v_remove_comments);
Py_DECREF(__pyx_v_remove_pis);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_encoding);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1512
 * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
 * 
 * def setDefaultParser(parser=None):             # <<<<<<<<<<<<<< 
 *     "Deprecated, please use set_default_parser instead."
 *     set_default_parser(parser)
 */

static PyObject *__pyx_n_set_default_parser;

static PyObject *__pyx_pf_4lxml_5etree_setDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_setDefaultParser[] = "Deprecated, please use set_default_parser instead.";
static PyObject *__pyx_pf_4lxml_5etree_setDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_parser = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"parser",0};
__pyx_v_parser = __pyx_k202;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1514
 * def setDefaultParser(parser=None):
 *     "Deprecated, please use set_default_parser instead."
 *     set_default_parser(parser)             # <<<<<<<<<<<<<< 
 * 
 * def getDefaultParser():
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_set_default_parser); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1514; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1514
 * def setDefaultParser(parser=None):
 *     "Deprecated, please use set_default_parser instead."
 *     set_default_parser(parser)             # <<<<<<<<<<<<<< 
 * 
 * def getDefaultParser():
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1514; goto __pyx_L1;}
Py_INCREF(__pyx_v_parser);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_parser);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1514; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.setDefaultParser");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1516
 *     set_default_parser(parser)
 * 
 * def getDefaultParser():             # <<<<<<<<<<<<<< 
 *     "Deprecated, please use get_default_parser instead."
 *     return get_default_parser()
 */

static PyObject *__pyx_n_get_default_parser;

static PyObject *__pyx_pf_4lxml_5etree_getDefaultParser(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_4lxml_5etree_getDefaultParser[] = "Deprecated, please use get_default_parser instead.";
static PyObject *__pyx_pf_4lxml_5etree_getDefaultParser(PyObject *__pyx_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1518
 * def getDefaultParser():
 *     "Deprecated, please use get_default_parser instead."
 *     return get_default_parser()             # <<<<<<<<<<<<<< 
 * 
 * def set_default_parser(_BaseParser parser=None):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_get_default_parser); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1518; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1518; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.getDefaultParser");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1520
 *     return get_default_parser()
 * 
 * def set_default_parser(_BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Set a default parser for the current thread.  This parser is used
 *     globally whenever no parser is supplied to the various parse functions of
 */

static PyObject *__pyx_pf_4lxml_5etree_set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_set_default_parser[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"parser",0};
__pyx_v_parser = __pyx_k203;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_parser);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_4lxml_5etree__BaseParser, 1, "parser"))) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1520; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1530
 *     parser for each thread explicitly or use a parser pool.
 *     """
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __DEFAULT_XML_PARSER
 *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1531
 *     """
 *     if parser is None:
 *         parser = __DEFAULT_XML_PARSER             # <<<<<<<<<<<<<< 
 *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
 * 
 */
  Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1532
 *     if parser is None:
 *         parser = __DEFAULT_XML_PARSER
 *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)             # <<<<<<<<<<<<<< 
 * 
 * def get_default_parser():
 */
((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);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.set_default_parser");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1534
 *     __GLOBAL_PARSER_CONTEXT.setDefaultParser(parser)
 * 
 * def get_default_parser():             # <<<<<<<<<<<<<< 
 *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_get_default_parser(PyObject *__pyx_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_get_default_parser(PyObject *__pyx_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1535
 * 
 * def get_default_parser():
 *     return __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1535; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.get_default_parser");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1568
 *     reasons.
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,             # <<<<<<<<<<<<<< 
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):
 */

static int __pyx_pf_4lxml_5etree_10HTMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_10HTMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_recover = 0;
PyObject *__pyx_v_no_network = 0;
PyObject *__pyx_v_remove_blank_text = 0;
PyObject *__pyx_v_compact = 0;
PyObject *__pyx_v_remove_comments = 0;
PyObject *__pyx_v_remove_pis = 0;
PyObject *__pyx_v_target = 0;
PyObject *__pyx_v_encoding = 0;
int __pyx_v_parse_options;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"recover","no_network","remove_blank_text","compact","remove_comments","remove_pis","target","encoding",0};
__pyx_v_recover = __pyx_k204;
__pyx_v_no_network = __pyx_k205;
__pyx_v_remove_blank_text = __pyx_k206;
__pyx_v_compact = __pyx_k207;
__pyx_v_remove_comments = __pyx_k208;
__pyx_v_remove_pis = __pyx_k209;
__pyx_v_target = __pyx_k210;
__pyx_v_encoding = __pyx_k211;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOO", __pyx_argnames, &__pyx_v_recover, &__pyx_v_no_network, &__pyx_v_remove_blank_text, &__pyx_v_compact, &__pyx_v_remove_comments, &__pyx_v_remove_pis, &__pyx_v_target, &__pyx_v_encoding))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_recover);
Py_INCREF(__pyx_v_no_network);
Py_INCREF(__pyx_v_remove_blank_text);
Py_INCREF(__pyx_v_compact);
Py_INCREF(__pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1572
 *                  target=None, encoding=None):
 *         cdef int parse_options
 *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<< 
 *         if remove_blank_text:
 *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
 */
__pyx_v_parse_options = __pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1573
 *         cdef int parse_options
 *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
 *         if remove_blank_text:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
 *         if not recover:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1573; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1574
 *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
 *         if remove_blank_text:
 *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS             # <<<<<<<<<<<<<< 
 *         if not recover:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | HTML_PARSE_NOBLANKS);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1575
 *         if remove_blank_text:
 *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
 *         if not recover:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
 *         if not no_network:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_recover); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1575; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1576
 *             parse_options = parse_options | htmlparser.HTML_PARSE_NOBLANKS
 *         if not recover:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER             # <<<<<<<<<<<<<< 
 *         if not no_network:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_RECOVER);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1577
 *         if not recover:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
 *         if not no_network:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
 *         if not compact:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1577; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1578
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_RECOVER
 *         if not no_network:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET             # <<<<<<<<<<<<<< 
 *         if not compact:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_NONET);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1579
 *         if not no_network:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
 *         if not compact:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_compact); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1579; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1580
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_NONET
 *         if not compact:
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT             # <<<<<<<<<<<<<< 
 * 
 *         _BaseParser.__init__(self, parse_options, 1,
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_COMPACT);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1582
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
 * 
 *         _BaseParser.__init__(self, parse_options, 1,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)
 */
__pyx_3 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser), __pyx_n___init__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1582; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1582
 *             parse_options = parse_options ^ htmlparser.HTML_PARSE_COMPACT
 * 
 *         _BaseParser.__init__(self, parse_options, 1,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)
 */
__pyx_4 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1582; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1584
 *         _BaseParser.__init__(self, parse_options, 1,
 *                              remove_comments, remove_pis,
 *                              target, None, encoding)             # <<<<<<<<<<<<<< 
 * 
 * cdef HTMLParser __DEFAULT_HTML_PARSER
 */
__pyx_5 = PyTuple_New(8); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1582; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
Py_INCREF(__pyx_num_1);
PyTuple_SET_ITEM(__pyx_5, 2, __pyx_num_1);
Py_INCREF(__pyx_v_remove_comments);
PyTuple_SET_ITEM(__pyx_5, 3, __pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
PyTuple_SET_ITEM(__pyx_5, 4, __pyx_v_remove_pis);
Py_INCREF(__pyx_v_target);
PyTuple_SET_ITEM(__pyx_5, 5, __pyx_v_target);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_5, 6, Py_None);
Py_INCREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_5, 7, __pyx_v_encoding);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1582; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.HTMLParser.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_recover);
Py_DECREF(__pyx_v_no_network);
Py_DECREF(__pyx_v_remove_blank_text);
Py_DECREF(__pyx_v_compact);
Py_DECREF(__pyx_v_remove_comments);
Py_DECREF(__pyx_v_remove_pis);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1593
 * ############################################################
 * 
 * cdef xmlDoc* _parseDoc(text, filename, _BaseParser parser) except NULL:             # <<<<<<<<<<<<<< 
 *     cdef char* c_filename
 *     cdef char* c_text
 */

static  xmlDoc *__pyx_f_4lxml_5etree__parseDoc(PyObject *__pyx_v_text,PyObject *__pyx_v_filename,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
char *__pyx_v_c_filename;
char *__pyx_v_c_text;
Py_ssize_t __pyx_v_c_len;
PyObject *__pyx_v_filename_utf;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
xmlDoc *__pyx_5;
xmlDoc *__pyx_6;
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_filename);
Py_INCREF(__pyx_v_parser);
__pyx_v_filename_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1597
 *     cdef char* c_text
 *     cdef Py_ssize_t c_len
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     if not filename:
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1598
 *     cdef Py_ssize_t c_len
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *     if not filename:
 *         c_filename = NULL
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1598; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1599
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     if not filename:             # <<<<<<<<<<<<<< 
 *         c_filename = NULL
 *     else:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_filename); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1599; goto __pyx_L1;}
__pyx_3 = (!__pyx_1);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1600
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     if not filename:
 *         c_filename = NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         filename_utf = _encodeFilenameUTF8(filename)
 */
  __pyx_v_c_filename = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1602
 *         c_filename = NULL
 *     else:
 *         filename_utf = _encodeFilenameUTF8(filename)             # <<<<<<<<<<<<<< 
 *         c_filename = _cstr(filename_utf)
 *     if python.PyUnicode_Check(text):
 */
  __pyx_2 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_filename); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1602; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename_utf);
  __pyx_v_filename_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1603
 *     else:
 *         filename_utf = _encodeFilenameUTF8(filename)
 *         c_filename = _cstr(filename_utf)             # <<<<<<<<<<<<<< 
 *     if python.PyUnicode_Check(text):
 *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
 */
  __pyx_v_c_filename = _cstr(__pyx_v_filename_utf);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1604
 *         filename_utf = _encodeFilenameUTF8(filename)
 *         c_filename = _cstr(filename_utf)
 *     if python.PyUnicode_Check(text):             # <<<<<<<<<<<<<< 
 *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
 *     else:
 */
__pyx_4 = PyUnicode_Check(__pyx_v_text);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1605
 *         c_filename = _cstr(filename_utf)
 *     if python.PyUnicode_Check(text):
 *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)             # <<<<<<<<<<<<<< 
 *     else:
 *         c_text = _cstr(text)
 */
  __pyx_5 = ((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_5 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1605; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  goto __pyx_L0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1607
 *         return (<_BaseParser>parser)._parseUnicodeDoc(text, c_filename)
 *     else:
 *         c_text = _cstr(text)             # <<<<<<<<<<<<<< 
 *         c_len  = python.PyString_GET_SIZE(text)
 *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
 */
  __pyx_v_c_text = _cstr(__pyx_v_text);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1608
 *     else:
 *         c_text = _cstr(text)
 *         c_len  = python.PyString_GET_SIZE(text)             # <<<<<<<<<<<<<< 
 *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
 * 
 */
  __pyx_v_c_len = PyString_GET_SIZE(__pyx_v_text);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1609
 *         c_text = _cstr(text)
 *         c_len  = python.PyString_GET_SIZE(text)
 *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
 */
  __pyx_6 = ((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_6 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1609; goto __pyx_L1;}
  __pyx_r = __pyx_6;
  goto __pyx_L0;
}
__pyx_L4:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_filename_utf);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_filename);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1611
 *         return (<_BaseParser>parser)._parseDoc(c_text, c_len, c_filename)
 * 
 * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:             # <<<<<<<<<<<<<< 
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 */

static  xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFile(PyObject *__pyx_v_filename8,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
Py_INCREF(__pyx_v_filename8);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1612
 * 
 * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1613
 * cdef xmlDoc* _parseDocFromFile(filename8, _BaseParser parser) except NULL:
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1613; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1614
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _parseDocFromFilelike(source, filename,
 */
__pyx_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),_cstr(__pyx_v_filename8)); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1614; goto __pyx_L1;}
__pyx_r = __pyx_3;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseDocFromFile");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_filename8);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1616
 *     return (<_BaseParser>parser)._parseDocFromFile(_cstr(filename8))
 * 
 * cdef xmlDoc* _parseDocFromFilelike(source, filename,             # <<<<<<<<<<<<<< 
 *                                    _BaseParser parser) except NULL:
 *     if parser is None:
 */

static  xmlDoc *__pyx_f_4lxml_5etree__parseDocFromFilelike(PyObject *__pyx_v_source,PyObject *__pyx_v_filename,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_filename);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1618
 * cdef xmlDoc* _parseDocFromFilelike(source, filename,
 *                                    _BaseParser parser) except NULL:
 *     if parser is None:             # <<<<<<<<<<<<<< 
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
 */
__pyx_1 = (((PyObject *)__pyx_v_parser) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1619
 *                                    _BaseParser parser) except NULL:
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()             # <<<<<<<<<<<<<< 
 *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1619; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1620
 *     if parser is None:
 *         parser = __GLOBAL_PARSER_CONTEXT.getDefaultParser()
 *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _newDoc() except NULL:
 */
__pyx_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_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1620; goto __pyx_L1;}
__pyx_r = __pyx_3;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseDocFromFilelike");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_filename);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1622
 *     return (<_BaseParser>parser)._parseDocFromFilelike(source, filename)
 * 
 * cdef xmlDoc* _newDoc() except NULL:             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* result
 *     result = tree.xmlNewDoc("1.0")
 */

static char __pyx_k543[] = "1.0";

static  xmlDoc *__pyx_f_4lxml_5etree__newDoc(void) {
xmlDoc *__pyx_v_result;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1624
 * cdef xmlDoc* _newDoc() except NULL:
 *     cdef xmlDoc* result
 *     result = tree.xmlNewDoc("1.0")             # <<<<<<<<<<<<<< 
 *     if result is NULL:
 *         python.PyErr_NoMemory()
 */
__pyx_v_result = xmlNewDoc(__pyx_k543);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1625
 *     cdef xmlDoc* result
 *     result = tree.xmlNewDoc("1.0")
 *     if result is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 */
__pyx_1 = (__pyx_v_result == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1626
 *     result = tree.xmlNewDoc("1.0")
 *     if result is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     return result
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1626; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1627
 *     if result is NULL:
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1628
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._newDoc");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1630
 *     return result
 * 
 * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* result
 *     if recursive:
 */

static  xmlDoc *__pyx_f_4lxml_5etree__copyDoc(xmlDoc *__pyx_v_c_doc,int __pyx_v_recursive) {
xmlDoc *__pyx_v_result;
xmlDoc *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1632
 * cdef xmlDoc* _copyDoc(xmlDoc* c_doc, int recursive) except NULL:
 *     cdef xmlDoc* result
 *     if recursive:             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             result = tree.xmlCopyDoc(c_doc, recursive)
 */
__pyx_1 = __pyx_v_recursive;
if (__pyx_1) {
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1634
 *     if recursive:
 *         with nogil:
 *             result = tree.xmlCopyDoc(c_doc, recursive)             # <<<<<<<<<<<<<< 
 *     else:
 *         result = tree.xmlCopyDoc(c_doc, 0)
 */
      __pyx_v_result = xmlCopyDoc(__pyx_v_c_doc,__pyx_v_recursive);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1636
 *             result = tree.xmlCopyDoc(c_doc, recursive)
 *     else:
 *         result = tree.xmlCopyDoc(c_doc, 0)             # <<<<<<<<<<<<<< 
 *     if result is NULL:
 *         python.PyErr_NoMemory()
 */
  __pyx_v_result = xmlCopyDoc(__pyx_v_c_doc,0);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1637
 *     else:
 *         result = tree.xmlCopyDoc(c_doc, 0)
 *     if result is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 */
__pyx_2 = (__pyx_v_result == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1638
 *         result = tree.xmlCopyDoc(c_doc, 0)
 *     if result is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     return result
 */
  __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1638; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1639
 *     if result is NULL:
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1640
 *         python.PyErr_NoMemory()
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _copyDocRoot(xmlDoc* c_doc, xmlNode* c_new_root) except NULL:
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._copyDoc");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1642
 *     return result
 * 
 * cdef xmlDoc* _copyDocRoot(xmlDoc* c_doc, xmlNode* c_new_root) except NULL:             # <<<<<<<<<<<<<< 
 *     "Recursively copy the document and make c_new_root the new root node."
 *     cdef xmlDoc* result
 */

static  xmlDoc *__pyx_f_4lxml_5etree__copyDocRoot(xmlDoc *__pyx_v_c_doc,xmlNode *__pyx_v_c_new_root) {
xmlDoc *__pyx_v_result;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1646
 *     cdef xmlDoc* result
 *     cdef xmlNode* c_node
 *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive             # <<<<<<<<<<<<<< 
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     with nogil:
 */
__pyx_v_result = xmlCopyDoc(__pyx_v_c_doc,0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1647
 *     cdef xmlNode* c_node
 *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)             # <<<<<<<<<<<<<< 
 *     with nogil:
 *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1648
 *     result = tree.xmlCopyDoc(c_doc, 0) # non recursive
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     with nogil:             # <<<<<<<<<<<<<< 
 *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
 *     if c_node is NULL:
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1649
 *     __GLOBAL_PARSER_CONTEXT.initDocDict(result)
 *     with nogil:
 *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()
 */
    __pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_new_root,__pyx_v_result,1);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1650
 *     with nogil:
 *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     tree.xmlDocSetRootElement(result, c_node)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1651
 *         c_node = tree.xmlDocCopyNode(c_new_root, result, 1) # recursive
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     tree.xmlDocSetRootElement(result, c_node)
 *     _copyTail(c_new_root.next, c_node)
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1651; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1652
 *     if c_node is NULL:
 *         python.PyErr_NoMemory()
 *     tree.xmlDocSetRootElement(result, c_node)             # <<<<<<<<<<<<<< 
 *     _copyTail(c_new_root.next, c_node)
 *     return result
 */
xmlDocSetRootElement(__pyx_v_result,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1653
 *         python.PyErr_NoMemory()
 *     tree.xmlDocSetRootElement(result, c_node)
 *     _copyTail(c_new_root.next, c_node)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
__pyx_f_4lxml_5etree__copyTail(__pyx_v_c_new_root->next,__pyx_v_c_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1654
 *     tree.xmlDocSetRootElement(result, c_node)
 *     _copyTail(c_new_root.next, c_node)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlNode* _copyNodeToDoc(xmlNode* c_node, xmlDoc* c_doc) except NULL:
 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._copyDocRoot");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1656
 *     return result
 * 
 * cdef xmlNode* _copyNodeToDoc(xmlNode* c_node, xmlDoc* c_doc) except NULL:             # <<<<<<<<<<<<<< 
 *     "Recursively copy the element into the document. c_doc is not modified."
 *     cdef xmlNode* c_root
 */

static  xmlNode *__pyx_f_4lxml_5etree__copyNodeToDoc(xmlNode *__pyx_v_c_node,xmlDoc *__pyx_v_c_doc) {
xmlNode *__pyx_v_c_root;
xmlNode *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1659
 *     "Recursively copy the element into the document. c_doc is not modified."
 *     cdef xmlNode* c_root
 *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive             # <<<<<<<<<<<<<< 
 *     if c_root is NULL:
 *         python.PyErr_NoMemory()
 */
__pyx_v_c_root = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_c_doc,1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1660
 *     cdef xmlNode* c_root
 *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive
 *     if c_root is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     _copyTail(c_node.next, c_root)
 */
__pyx_1 = (__pyx_v_c_root == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1661
 *     c_root = tree.xmlDocCopyNode(c_node, c_doc, 1) # recursive
 *     if c_root is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     _copyTail(c_node.next, c_root)
 *     return c_root
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1661; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1662
 *     if c_root is NULL:
 *         python.PyErr_NoMemory()
 *     _copyTail(c_node.next, c_root)             # <<<<<<<<<<<<<< 
 *     return c_root
 * 
 */
__pyx_f_4lxml_5etree__copyTail(__pyx_v_c_node->next,__pyx_v_c_root);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1663
 *         python.PyErr_NoMemory()
 *     _copyTail(c_node.next, c_root)
 *     return c_root             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_r = __pyx_v_c_root;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._copyNodeToDoc");
__pyx_r = NULL;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1671
 * ############################################################
 * 
 * cdef _Document _parseDocument(source, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *     filename = _getFilenameForFile(source)
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):
 */

static PyObject *__pyx_n_getvalue;
static PyObject *__pyx_n_tell;


static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocument(PyObject *__pyx_v_source,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
PyObject *__pyx_v_filename;
struct LxmlDocument *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1672
 * 
 * cdef _Document _parseDocument(source, _BaseParser parser):
 *     filename = _getFilenameForFile(source)             # <<<<<<<<<<<<<< 
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):
 *         # StringIO - reading from start?
 */
__pyx_1 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_source); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1672; goto __pyx_L1;}
Py_DECREF(__pyx_v_filename);
__pyx_v_filename = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1673
 * cdef _Document _parseDocument(source, _BaseParser parser):
 *     filename = _getFilenameForFile(source)
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):             # <<<<<<<<<<<<<< 
 *         # StringIO - reading from start?
 *         if source.tell() == 0:
 */
__pyx_2 = PyObject_HasAttr(__pyx_v_source,__pyx_n_getvalue); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1673; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1673
 * cdef _Document _parseDocument(source, _BaseParser parser):
 *     filename = _getFilenameForFile(source)
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):             # <<<<<<<<<<<<<< 
 *         # StringIO - reading from start?
 *         if source.tell() == 0:
 */
  __pyx_2 = PyObject_HasAttr(__pyx_v_source,__pyx_n_tell); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1673; goto __pyx_L1;}
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1675
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):
 *         # StringIO - reading from start?
 *         if source.tell() == 0:             # <<<<<<<<<<<<<< 
 *             return _parseMemoryDocument(
 *                 source.getvalue(), _encodeFilenameUTF8(filename), parser)
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_source, __pyx_n_tell); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1675; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1675; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1675
 *     if hasattr(source, 'getvalue') and hasattr(source, 'tell'):
 *         # StringIO - reading from start?
 *         if source.tell() == 0:             # <<<<<<<<<<<<<< 
 *             return _parseMemoryDocument(
 *                 source.getvalue(), _encodeFilenameUTF8(filename), parser)
 */
  __pyx_1 = PyObject_RichCompare(__pyx_3, __pyx_num_0, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1675; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1675; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1677
 *         if source.tell() == 0:
 *             return _parseMemoryDocument(
 *                 source.getvalue(), _encodeFilenameUTF8(filename), parser)             # <<<<<<<<<<<<<< 
 * 
 *     # Support for file-like objects (urlgrabber.urlopen, ...)
 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_source, __pyx_n_getvalue); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1677; goto __pyx_L1;}
    __pyx_1 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1677; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1677
 *         if source.tell() == 0:
 *             return _parseMemoryDocument(
 *                 source.getvalue(), _encodeFilenameUTF8(filename), parser)             # <<<<<<<<<<<<<< 
 * 
 *     # Support for file-like objects (urlgrabber.urlopen, ...)
 */
    __pyx_3 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_filename); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1677; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1677
 *         if source.tell() == 0:
 *             return _parseMemoryDocument(
 *                 source.getvalue(), _encodeFilenameUTF8(filename), parser)             # <<<<<<<<<<<<<< 
 * 
 *     # Support for file-like objects (urlgrabber.urlopen, ...)
 */
    __pyx_4 = ((PyObject *)__pyx_f_4lxml_5etree__parseMemoryDocument(__pyx_1,__pyx_3,__pyx_v_parser)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1676; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = ((struct LxmlDocument *)__pyx_4);
    __pyx_4 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1680
 * 
 *     # Support for file-like objects (urlgrabber.urlopen, ...)
 *     if hasattr(source, 'read'):             # <<<<<<<<<<<<<< 
 *         return _parseFilelikeDocument(
 *             source, _encodeFilenameUTF8(filename), parser)
 */
__pyx_2 = PyObject_HasAttr(__pyx_v_source,__pyx_n_read); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1680; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1682
 *     if hasattr(source, 'read'):
 *         return _parseFilelikeDocument(
 *             source, _encodeFilenameUTF8(filename), parser)             # <<<<<<<<<<<<<< 
 * 
 *     # Otherwise parse the file directly from the filesystem
 */
  __pyx_1 = __pyx_f_4lxml_5etree__encodeFilenameUTF8(__pyx_v_filename); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1682; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1682
 *     if hasattr(source, 'read'):
 *         return _parseFilelikeDocument(
 *             source, _encodeFilenameUTF8(filename), parser)             # <<<<<<<<<<<<<< 
 * 
 *     # Otherwise parse the file directly from the filesystem
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__parseFilelikeDocument(__pyx_v_source,__pyx_1,__pyx_v_parser)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1681; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_r = ((struct LxmlDocument *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1685
 * 
 *     # Otherwise parse the file directly from the filesystem
 *     if filename is None:             # <<<<<<<<<<<<<< 
 *         filename = _encodeFilename(source)
 *     # open filename
 */
__pyx_2 = (__pyx_v_filename == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1686
 *     # Otherwise parse the file directly from the filesystem
 *     if filename is None:
 *         filename = _encodeFilename(source)             # <<<<<<<<<<<<<< 
 *     # open filename
 *     return _parseDocumentFromURL(filename, parser)
 */
  __pyx_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_source); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1686; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1688
 *         filename = _encodeFilename(source)
 *     # open filename
 *     return _parseDocumentFromURL(filename, parser)             # <<<<<<<<<<<<<< 
 * 
 * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocumentFromURL(__pyx_v_filename,__pyx_v_parser)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1688; goto __pyx_L1;}
__pyx_r = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._parseDocument");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_filename);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1690
 *     return _parseDocumentFromURL(filename, parser)
 * 
 * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* c_doc
 *     c_doc = _parseDocFromFile(url, parser)
 */

static  struct LxmlDocument *__pyx_f_4lxml_5etree__parseDocumentFromURL(PyObject *__pyx_v_url,struct __pyx_obj_4lxml_5etree__BaseParser *__pyx_v_parser) {
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_r;
xmlDoc *__pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_url);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1692
 * cdef _Document _parseDocumentFromURL(url, _BaseParser parser):
 *     cdef xmlDoc* c_doc
 *     c_doc = _parseDocFromFile(url, parser)             # <<<<<<<<<<<<<< 
 *     return _documentFactory(c_doc, parser)
 * 
 */
__pyx_1 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_url,__pyx_v_parser); if (unlikely(__pyx_1 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1692; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1693
 *     cdef xmlDoc* c_doc
 *     c_doc = _parseDocFromFile(url, parser)
 *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 * 
 * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1693; goto __pyx_L1;}
__pyx_r = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseDocumentFromURL");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1695
 *     return _documentFactory(c_doc, parser)
 * 
 * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(text):
 */

static PyObject *__pyx_k547p;
static PyObject *__pyx_k548p;

static char __pyx_k547[] = "Unicode strings with encoding declaration are not supported.";
static char __pyx_k548[] = "can only parse strings";

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) {
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
xmlDoc *__pyx_4;
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_url);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1697
 * cdef _Document _parseMemoryDocument(text, url, _BaseParser parser):
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(text):             # <<<<<<<<<<<<<< 
 *         if _hasEncodingDeclaration(text):
 *             raise ValueError, \
 */
__pyx_1 = PyUnicode_Check(__pyx_v_text);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1698
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(text):
 *         if _hasEncodingDeclaration(text):             # <<<<<<<<<<<<<< 
 *             raise ValueError, \
 *                   "Unicode strings with encoding declaration are not supported."
 */
  __pyx_1 = __pyx_f_4lxml_5etree__hasEncodingDeclaration(__pyx_v_text);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1700
 *         if _hasEncodingDeclaration(text):
 *             raise ValueError, \
 *                   "Unicode strings with encoding declaration are not supported."             # <<<<<<<<<<<<<< 
 *         # pass native unicode only if libxml2 can handle it
 *         if _UNICODE_ENCODING is NULL:
 */
    __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k547p, 0);
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1699; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1702
 *                   "Unicode strings with encoding declaration are not supported."
 *         # pass native unicode only if libxml2 can handle it
 *         if _UNICODE_ENCODING is NULL:             # <<<<<<<<<<<<<< 
 *             text = python.PyUnicode_AsUTF8String(text)
 *     elif not python.PyString_Check(text):
 */
  __pyx_2 = (__pyx_v_4lxml_5etree__UNICODE_ENCODING == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1703
 *         # pass native unicode only if libxml2 can handle it
 *         if _UNICODE_ENCODING is NULL:
 *             text = python.PyUnicode_AsUTF8String(text)             # <<<<<<<<<<<<<< 
 *     elif not python.PyString_Check(text):
 *         raise ValueError, "can only parse strings"
 */
    __pyx_3 = PyUnicode_AsUTF8String(__pyx_v_text); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1703; goto __pyx_L1;}
    Py_DECREF(__pyx_v_text);
    __pyx_v_text = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1704
 *         if _UNICODE_ENCODING is NULL:
 *             text = python.PyUnicode_AsUTF8String(text)
 *     elif not python.PyString_Check(text):             # <<<<<<<<<<<<<< 
 *         raise ValueError, "can only parse strings"
 *     if python.PyUnicode_Check(url):
 */
__pyx_2 = (!PyString_Check(__pyx_v_text));
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1705
 *             text = python.PyUnicode_AsUTF8String(text)
 *     elif not python.PyString_Check(text):
 *         raise ValueError, "can only parse strings"             # <<<<<<<<<<<<<< 
 *     if python.PyUnicode_Check(url):
 *         url = python.PyUnicode_AsUTF8String(url)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k548p, 0);
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1705; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1706
 *     elif not python.PyString_Check(text):
 *         raise ValueError, "can only parse strings"
 *     if python.PyUnicode_Check(url):             # <<<<<<<<<<<<<< 
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDoc(text, url, parser)
 */
__pyx_1 = PyUnicode_Check(__pyx_v_url);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1707
 *         raise ValueError, "can only parse strings"
 *     if python.PyUnicode_Check(url):
 *         url = python.PyUnicode_AsUTF8String(url)             # <<<<<<<<<<<<<< 
 *     c_doc = _parseDoc(text, url, parser)
 *     return _documentFactory(c_doc, parser)
 */
  __pyx_3 = PyUnicode_AsUTF8String(__pyx_v_url); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1707; goto __pyx_L1;}
  Py_DECREF(__pyx_v_url);
  __pyx_v_url = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1708
 *     if python.PyUnicode_Check(url):
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDoc(text, url, parser)             # <<<<<<<<<<<<<< 
 *     return _documentFactory(c_doc, parser)
 * 
 */
__pyx_4 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_text,__pyx_v_url,__pyx_v_parser); if (unlikely(__pyx_4 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1708; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_4;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1709
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDoc(text, url, parser)
 *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 * 
 * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):
 */
__pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1709; goto __pyx_L1;}
__pyx_r = ((struct LxmlDocument *)__pyx_3);
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._parseMemoryDocument");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1711
 *     return _documentFactory(c_doc, parser)
 * 
 * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):             # <<<<<<<<<<<<<< 
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(url):
 */

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) {
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_url);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1713
 * cdef _Document _parseFilelikeDocument(source, url, _BaseParser parser):
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(url):             # <<<<<<<<<<<<<< 
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDocFromFilelike(source, url, parser)
 */
__pyx_1 = PyUnicode_Check(__pyx_v_url);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1714
 *     cdef xmlDoc* c_doc
 *     if python.PyUnicode_Check(url):
 *         url = python.PyUnicode_AsUTF8String(url)             # <<<<<<<<<<<<<< 
 *     c_doc = _parseDocFromFilelike(source, url, parser)
 *     return _documentFactory(c_doc, parser)
 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_url); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1714; goto __pyx_L1;}
  Py_DECREF(__pyx_v_url);
  __pyx_v_url = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1715
 *     if python.PyUnicode_Check(url):
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDocFromFilelike(source, url, parser)             # <<<<<<<<<<<<<< 
 *     return _documentFactory(c_doc, parser)
 */
__pyx_3 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_source,__pyx_v_url,__pyx_v_parser); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1715; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1716
 *         url = python.PyUnicode_AsUTF8String(url)
 *     c_doc = _parseDocFromFilelike(source, url, parser)
 *     return _documentFactory(c_doc, parser)             # <<<<<<<<<<<<<< 
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1716; goto __pyx_L1;}
__pyx_r = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseFilelikeDocument");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":10
 *     # to push the Python level parser result through the parser
 *     # machinery towards the API level functions
 *     def __init__(self, result):             # <<<<<<<<<<<<<< 
 *         self.result = result
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_19_TargetParserResult___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_4lxml_5etree_19_TargetParserResult___init__ = {"__init__", (PyCFunction)__pyx_pf_4lxml_5etree_19_TargetParserResult___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pf_4lxml_5etree_19_TargetParserResult___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_self = 0;
PyObject *__pyx_v_result = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"self","result",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_self, &__pyx_v_result))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_result);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":11
 *     # machinery towards the API level functions
 *     def __init__(self, result):
 *         self.result = result             # <<<<<<<<<<<<<< 
 * 
 * cdef class _PythonSaxParserTarget(_SaxParserTarget):
 */
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_result, __pyx_v_result) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 11; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._TargetParserResult.__init__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":22
 *     cdef bint _start_takes_nsmap
 * 
 *     def __init__(self, target):             # <<<<<<<<<<<<<< 
 *         cdef int event_filter
 *         event_filter = 0
 */

static PyObject *__pyx_n_doctype;

static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_target = 0;
int __pyx_v_event_filter;
PyObject *__pyx_v_arguments;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
static char *__pyx_argnames[] = {"target",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_target))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);
__pyx_v_arguments = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":24
 *     def __init__(self, target):
 *         cdef int event_filter
 *         event_filter = 0             # <<<<<<<<<<<<<< 
 *         self._start_takes_nsmap = 0
 *         try:
 */
__pyx_v_event_filter = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":25
 *         cdef int event_filter
 *         event_filter = 0
 *         self._start_takes_nsmap = 0             # <<<<<<<<<<<<<< 
 *         try:
 *             self._target_start = target.start
 */
((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_start_takes_nsmap = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":26
 *         event_filter = 0
 *         self._start_takes_nsmap = 0
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_start = target.start
 *             if self._target_start is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":27
 *         self._start_takes_nsmap = 0
 *         try:
 *             self._target_start = target.start             # <<<<<<<<<<<<<< 
 *             if self._target_start is not None:
 *                 event_filter = event_filter | SAX_EVENT_START
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_target, __pyx_n_start); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 27; goto __pyx_L2;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":27
 *         self._start_takes_nsmap = 0
 *         try:
 *             self._target_start = target.start             # <<<<<<<<<<<<<< 
 *             if self._target_start is not None:
 *                 event_filter = event_filter | SAX_EVENT_START
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":28
 *         try:
 *             self._target_start = target.start
 *             if self._target_start is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_START
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":29
 *             self._target_start = target.start
 *             if self._target_start is not None:
 *                 event_filter = event_filter | SAX_EVENT_START             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_START);
    goto __pyx_L4;
  }
  __pyx_L4:;
}
/*else:*/ {
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":34
 *         else:
 *             try:
 *                 arguments = inspect_getargspec(self._target_start)             # <<<<<<<<<<<<<< 
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:
 *                     self._start_takes_nsmap = 1
 */
    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 34; goto __pyx_L5;}
    Py_INCREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
    PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_start);
    __pyx_4 = PyObject_CallObject(__pyx_v_4lxml_5etree_inspect_getargspec, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 34; goto __pyx_L5;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_arguments);
    __pyx_v_arguments = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":35
 *             try:
 *                 arguments = inspect_getargspec(self._target_start)
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:             # <<<<<<<<<<<<<< 
 *                     self._start_takes_nsmap = 1
 *             except TypeError:
 */
    if (PyList_CheckExact(__pyx_v_arguments) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_arguments)) {
      __pyx_1 = PyList_GET_ITEM(__pyx_v_arguments, 0); Py_INCREF(__pyx_1);
      } else if (PyTuple_CheckExact(__pyx_v_arguments) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_arguments)) {
      __pyx_1 = PyTuple_GET_ITEM(__pyx_v_arguments, 0); Py_INCREF(__pyx_1);
      } else {
      __pyx_5 = PyInt_FromLong(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; goto __pyx_L5;}
      __pyx_1 = PyObject_GetItem(__pyx_v_arguments, __pyx_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; goto __pyx_L5;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }
    __pyx_6 = PyObject_Length(__pyx_1); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; goto __pyx_L5;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":35
 *             try:
 *                 arguments = inspect_getargspec(self._target_start)
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:             # <<<<<<<<<<<<<< 
 *                     self._start_takes_nsmap = 1
 *             except TypeError:
 */
    __pyx_2 = (__pyx_6 > 3);
    if (!__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":35
 *             try:
 *                 arguments = inspect_getargspec(self._target_start)
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:             # <<<<<<<<<<<<<< 
 *                     self._start_takes_nsmap = 1
 *             except TypeError:
 */
      if (PyList_CheckExact(__pyx_v_arguments) && 0 <= 1 && 1 < PyList_GET_SIZE(__pyx_v_arguments)) {
        __pyx_5 = PyList_GET_ITEM(__pyx_v_arguments, 1); Py_INCREF(__pyx_5);
        } else if (PyTuple_CheckExact(__pyx_v_arguments) && 0 <= 1 && 1 < PyTuple_GET_SIZE(__pyx_v_arguments)) {
        __pyx_5 = PyTuple_GET_ITEM(__pyx_v_arguments, 1); Py_INCREF(__pyx_5);
        } else {
        __pyx_4 = PyInt_FromLong(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; goto __pyx_L5;}
        __pyx_5 = PyObject_GetItem(__pyx_v_arguments, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 35; goto __pyx_L5;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":35
 *             try:
 *                 arguments = inspect_getargspec(self._target_start)
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:             # <<<<<<<<<<<<<< 
 *                     self._start_takes_nsmap = 1
 *             except TypeError:
 */
      __pyx_2 = (__pyx_5 != Py_None);
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":36
 *                 arguments = inspect_getargspec(self._target_start)
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:
 *                     self._start_takes_nsmap = 1             # <<<<<<<<<<<<<< 
 *             except TypeError:
 *                 pass
 */
      ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_start_takes_nsmap = 1;
      goto __pyx_L7;
    }
    __pyx_L7:;
  }
  goto __pyx_L6;
  __pyx_L5:;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;
  Py_XDECREF(__pyx_4); __pyx_4 = 0;
  Py_XDECREF(__pyx_5); __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":37
 *                 if len(arguments[0]) > 3 or arguments[1] is not None:
 *                     self._start_takes_nsmap = 1
 *             except TypeError:             # <<<<<<<<<<<<<< 
 *                 pass
 *         try:
 */
  __pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
  if (__pyx_3) {
    __Pyx_AddTraceback("lxml.etree.__init__");
    if (__Pyx_GetException(&__pyx_1, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 37; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    goto __pyx_L6;
  }
  goto __pyx_L1;
  __pyx_L6:;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":30
 *             if self._target_start is not None:
 *                 event_filter = event_filter | SAX_EVENT_START
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         else:
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_1, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 30; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L3;
}
goto __pyx_L1;
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":39
 *             except TypeError:
 *                 pass
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_end = target.end
 *             if self._target_end is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":40
 *                 pass
 *         try:
 *             self._target_end = target.end             # <<<<<<<<<<<<<< 
 *             if self._target_end is not None:
 *                 event_filter = event_filter | SAX_EVENT_END
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_target, __pyx_n_end); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 40; goto __pyx_L8;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":40
 *                 pass
 *         try:
 *             self._target_end = target.end             # <<<<<<<<<<<<<< 
 *             if self._target_end is not None:
 *                 event_filter = event_filter | SAX_EVENT_END
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":41
 *         try:
 *             self._target_end = target.end
 *             if self._target_end is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_END
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_end != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":42
 *             self._target_end = target.end
 *             if self._target_end is not None:
 *                 event_filter = event_filter | SAX_EVENT_END             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_END);
    goto __pyx_L10;
  }
  __pyx_L10:;
}
goto __pyx_L9;
__pyx_L8:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":43
 *             if self._target_end is not None:
 *                 event_filter = event_filter | SAX_EVENT_END
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         try:
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_4, &__pyx_5, &__pyx_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L9;
}
goto __pyx_L1;
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":45
 *         except AttributeError:
 *             pass
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_data = target.data
 *             if self._target_data is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":46
 *             pass
 *         try:
 *             self._target_data = target.data             # <<<<<<<<<<<<<< 
 *             if self._target_data is not None:
 *                 event_filter = event_filter | SAX_EVENT_DATA
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_target, __pyx_n_data); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 46; goto __pyx_L11;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":46
 *             pass
 *         try:
 *             self._target_data = target.data             # <<<<<<<<<<<<<< 
 *             if self._target_data is not None:
 *                 event_filter = event_filter | SAX_EVENT_DATA
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":47
 *         try:
 *             self._target_data = target.data
 *             if self._target_data is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_DATA
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_data != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":48
 *             self._target_data = target.data
 *             if self._target_data is not None:
 *                 event_filter = event_filter | SAX_EVENT_DATA             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_DATA);
    goto __pyx_L13;
  }
  __pyx_L13:;
}
goto __pyx_L12;
__pyx_L11:;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":49
 *             if self._target_data is not None:
 *                 event_filter = event_filter | SAX_EVENT_DATA
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         try:
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_5, &__pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L12;
}
goto __pyx_L1;
__pyx_L12:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":51
 *         except AttributeError:
 *             pass
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_doctype = target.doctype
 *             if self._target_doctype is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":52
 *             pass
 *         try:
 *             self._target_doctype = target.doctype             # <<<<<<<<<<<<<< 
 *             if self._target_doctype is not None:
 *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
 */
  __pyx_5 = PyObject_GetAttr(__pyx_v_target, __pyx_n_doctype); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 52; goto __pyx_L14;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":52
 *             pass
 *         try:
 *             self._target_doctype = target.doctype             # <<<<<<<<<<<<<< 
 *             if self._target_doctype is not None:
 *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":53
 *         try:
 *             self._target_doctype = target.doctype
 *             if self._target_doctype is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_doctype != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":54
 *             self._target_doctype = target.doctype
 *             if self._target_doctype is not None:
 *                 event_filter = event_filter | SAX_EVENT_DOCTYPE             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_DOCTYPE);
    goto __pyx_L16;
  }
  __pyx_L16:;
}
goto __pyx_L15;
__pyx_L14:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":55
 *             if self._target_doctype is not None:
 *                 event_filter = event_filter | SAX_EVENT_DOCTYPE
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         try:
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_1, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L15;
}
goto __pyx_L1;
__pyx_L15:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":57
 *         except AttributeError:
 *             pass
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_pi = target.pi
 *             if self._target_pi is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":58
 *             pass
 *         try:
 *             self._target_pi = target.pi             # <<<<<<<<<<<<<< 
 *             if self._target_pi is not None:
 *                 event_filter = event_filter | SAX_EVENT_PI
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_target, __pyx_n_pi); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 58; goto __pyx_L17;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":58
 *             pass
 *         try:
 *             self._target_pi = target.pi             # <<<<<<<<<<<<<< 
 *             if self._target_pi is not None:
 *                 event_filter = event_filter | SAX_EVENT_PI
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":59
 *         try:
 *             self._target_pi = target.pi
 *             if self._target_pi is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_PI
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_pi != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":60
 *             self._target_pi = target.pi
 *             if self._target_pi is not None:
 *                 event_filter = event_filter | SAX_EVENT_PI             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_PI);
    goto __pyx_L19;
  }
  __pyx_L19:;
}
goto __pyx_L18;
__pyx_L17:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":61
 *             if self._target_pi is not None:
 *                 event_filter = event_filter | SAX_EVENT_PI
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         try:
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_4, &__pyx_5, &__pyx_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L18;
}
goto __pyx_L1;
__pyx_L18:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":63
 *         except AttributeError:
 *             pass
 *         try:             # <<<<<<<<<<<<<< 
 *             self._target_comment = target.comment
 *             if self._target_comment is not None:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":64
 *             pass
 *         try:
 *             self._target_comment = target.comment             # <<<<<<<<<<<<<< 
 *             if self._target_comment is not None:
 *                 event_filter = event_filter | SAX_EVENT_COMMENT
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_target, __pyx_n_comment); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 64; goto __pyx_L20;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":64
 *             pass
 *         try:
 *             self._target_comment = target.comment             # <<<<<<<<<<<<<< 
 *             if self._target_comment is not None:
 *                 event_filter = event_filter | SAX_EVENT_COMMENT
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment);
  ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":65
 *         try:
 *             self._target_comment = target.comment
 *             if self._target_comment is not None:             # <<<<<<<<<<<<<< 
 *                 event_filter = event_filter | SAX_EVENT_COMMENT
 *         except AttributeError:
 */
  __pyx_2 = (((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->_target_comment != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":66
 *             self._target_comment = target.comment
 *             if self._target_comment is not None:
 *                 event_filter = event_filter | SAX_EVENT_COMMENT             # <<<<<<<<<<<<<< 
 *         except AttributeError:
 *             pass
 */
    __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_SAX_EVENT_COMMENT);
    goto __pyx_L22;
  }
  __pyx_L22:;
}
goto __pyx_L21;
__pyx_L20:;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":67
 *             if self._target_comment is not None:
 *                 event_filter = event_filter | SAX_EVENT_COMMENT
 *         except AttributeError:             # <<<<<<<<<<<<<< 
 *             pass
 *         self._sax_event_filter = event_filter
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree.__init__");
  if (__Pyx_GetException(&__pyx_5, &__pyx_1, &__pyx_4) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 67; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L21;
}
goto __pyx_L1;
__pyx_L21:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":69
 *         except AttributeError:
 *             pass
 *         self._sax_event_filter = event_filter             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 */
((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)__pyx_v_self)->__pyx_base._sax_event_filter = __pyx_v_event_filter;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_arguments);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":71
 *         self._sax_event_filter = event_filter
 * 
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):             # <<<<<<<<<<<<<< 
 *         if self._start_takes_nsmap:
 *             return self._target_start(tag, attrib, nsmap)
 */

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) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":72
 * 
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         if self._start_takes_nsmap:             # <<<<<<<<<<<<<< 
 *             return self._target_start(tag, attrib, nsmap)
 *         else:
 */
__pyx_1 = __pyx_v_self->_start_takes_nsmap;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":73
 *     cdef _handleSaxStart(self, tag, attrib, nsmap):
 *         if self._start_takes_nsmap:
 *             return self._target_start(tag, attrib, nsmap)             # <<<<<<<<<<<<<< 
 *         else:
 *             return self._target_start(tag, attrib)
 */
  __pyx_2 = PyTuple_New(3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; goto __pyx_L1;}
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_tag);
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_attrib);
  Py_INCREF(__pyx_v_nsmap);
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_nsmap);
  __pyx_3 = PyObject_CallObject(__pyx_v_self->_target_start, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 73; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":75
 *             return self._target_start(tag, attrib, nsmap)
 *         else:
 *             return self._target_start(tag, attrib)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxEnd(self, tag):
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_INCREF(__pyx_v_tag);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_tag);
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_attrib);
  __pyx_3 = PyObject_CallObject(__pyx_v_self->_target_start, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxStart");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":77
 *             return self._target_start(tag, attrib)
 * 
 *     cdef _handleSaxEnd(self, tag):             # <<<<<<<<<<<<<< 
 *         return self._target_end(tag)
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxEnd(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":78
 * 
 *     cdef _handleSaxEnd(self, tag):
 *         return self._target_end(tag)             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _handleSaxData(self, data) except -1:
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; goto __pyx_L1;}
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(__pyx_v_self->_target_end, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 78; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxEnd");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":80
 *         return self._target_end(tag)
 * 
 *     cdef int _handleSaxData(self, data) except -1:             # <<<<<<<<<<<<<< 
 *         self._target_data(data)
 * 
 */

static  int __pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxData(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self,PyObject *__pyx_v_data) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":81
 * 
 *     cdef int _handleSaxData(self, data) except -1:
 *         self._target_data(data)             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 81; goto __pyx_L1;}
Py_INCREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_data);
__pyx_2 = PyObject_CallObject(__pyx_v_self->_target_data, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 81; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxData");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":83
 *         self._target_data(data)
 * 
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:             # <<<<<<<<<<<<<< 
 *         self._target_doctype(root_tag, public_id, system_id)
 * 
 */

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) {
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_root_tag);
Py_INCREF(__pyx_v_public_id);
Py_INCREF(__pyx_v_system_id);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":84
 * 
 *     cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
 *         self._target_doctype(root_tag, public_id, system_id)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxPi(self, target, data):
 */
__pyx_1 = PyTuple_New(3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; goto __pyx_L1;}
Py_INCREF(__pyx_v_root_tag);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_root_tag);
Py_INCREF(__pyx_v_public_id);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_public_id);
Py_INCREF(__pyx_v_system_id);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_system_id);
__pyx_2 = PyObject_CallObject(__pyx_v_self->_target_doctype, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 84; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxDoctype");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_root_tag);
Py_DECREF(__pyx_v_public_id);
Py_DECREF(__pyx_v_system_id);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":86
 *         self._target_doctype(root_tag, public_id, system_id)
 * 
 *     cdef _handleSaxPi(self, target, data):             # <<<<<<<<<<<<<< 
 *         return self._target_pi(target, data)
 * 
 */

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) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_data);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":87
 * 
 *     cdef _handleSaxPi(self, target, data):
 *         return self._target_pi(target, data)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _handleSaxComment(self, comment):
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; goto __pyx_L1;}
Py_INCREF(__pyx_v_target);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_target);
Py_INCREF(__pyx_v_data);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_data);
__pyx_2 = PyObject_CallObject(__pyx_v_self->_target_pi, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 87; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxPi");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":89
 *         return self._target_pi(target, data)
 * 
 *     cdef _handleSaxComment(self, comment):             # <<<<<<<<<<<<<< 
 *         return self._target_comment(comment)
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxComment(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *__pyx_v_self,PyObject *__pyx_v_comment) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_comment);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":90
 * 
 *     cdef _handleSaxComment(self, comment):
 *         return self._target_comment(comment)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 90; goto __pyx_L1;}
Py_INCREF(__pyx_v_comment);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_comment);
__pyx_2 = PyObject_CallObject(__pyx_v_self->_target_comment, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._PythonSaxParserTarget._handleSaxComment");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_comment);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":97
 *     """
 *     cdef object _python_target
 *     cdef int _setTarget(self, target) except -1:             # <<<<<<<<<<<<<< 
 *         self._python_target = target
 *         if not isinstance(target, _SaxParserTarget) or \
 */

static PyObject *__pyx_n___dict__;


static  int __pyx_f_4lxml_5etree_20_TargetParserContext__setTarget(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self,PyObject *__pyx_v_target) {
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":98
 *     cdef object _python_target
 *     cdef int _setTarget(self, target) except -1:
 *         self._python_target = target             # <<<<<<<<<<<<<< 
 *         if not isinstance(target, _SaxParserTarget) or \
 *                 hasattr(target, '__dict__'):
 */
Py_INCREF(__pyx_v_target);
Py_DECREF(__pyx_v_self->_python_target);
__pyx_v_self->_python_target = __pyx_v_target;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":99
 *     cdef int _setTarget(self, target) except -1:
 *         self._python_target = target
 *         if not isinstance(target, _SaxParserTarget) or \             # <<<<<<<<<<<<<< 
 *                 hasattr(target, '__dict__'):
 *             target = _PythonSaxParserTarget(target)
 */
__pyx_2 = PyObject_IsInstance(__pyx_v_target,((PyObject*)__pyx_ptype_4lxml_5etree__SaxParserTarget)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 99; goto __pyx_L1;}
__pyx_1 = (!__pyx_2);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":100
 *         self._python_target = target
 *         if not isinstance(target, _SaxParserTarget) or \
 *                 hasattr(target, '__dict__'):             # <<<<<<<<<<<<<< 
 *             target = _PythonSaxParserTarget(target)
 *         self._setSaxParserTarget(target)
 */
  __pyx_1 = PyObject_HasAttr(__pyx_v_target,__pyx_n___dict__); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 100; goto __pyx_L1;}
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":101
 *         if not isinstance(target, _SaxParserTarget) or \
 *                 hasattr(target, '__dict__'):
 *             target = _PythonSaxParserTarget(target)             # <<<<<<<<<<<<<< 
 *         self._setSaxParserTarget(target)
 *         return 0
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_INCREF(__pyx_v_target);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_target);
  __pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__PythonSaxParserTarget), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_target);
  __pyx_v_target = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":102
 *                 hasattr(target, '__dict__'):
 *             target = _PythonSaxParserTarget(target)
 *         self._setSaxParserTarget(target)             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_target, __pyx_ptype_4lxml_5etree__SaxParserTarget)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 102; goto __pyx_L1;}
((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));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":103
 *             target = _PythonSaxParserTarget(target)
 *         self._setSaxParserTarget(target)
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _copy(self):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._TargetParserContext._setTarget");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":105
 *         return 0
 * 
 *     cdef _ParserContext _copy(self):             # <<<<<<<<<<<<<< 
 *         cdef _TargetParserContext context
 *         context = _ParserContext._copy(self)
 */

static  struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_f_4lxml_5etree_20_TargetParserContext__copy(struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__TargetParserContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":107
 *     cdef _ParserContext _copy(self):
 *         cdef _TargetParserContext context
 *         context = _ParserContext._copy(self)             # <<<<<<<<<<<<<< 
 *         context._setTarget(self._python_target)
 *         return context
 */
__pyx_1 = ((PyObject *)__pyx_vtabptr_4lxml_5etree__ParserContext->_copy(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__TargetParserContext)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 107; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":108
 *         cdef _TargetParserContext context
 *         context = _ParserContext._copy(self)
 *         context._setTarget(self._python_target)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_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_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 108; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":109
 *         context = _ParserContext._copy(self)
 *         context._setTarget(self._python_target)
 *         return context             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_context);
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._TargetParserContext._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":111
 *         return context
 * 
 *     cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,             # <<<<<<<<<<<<<< 
 *                                    filename):
 *         self._raise_if_stored()
 */

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) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":113
 *     cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,
 *                                    filename):
 *         self._raise_if_stored()             # <<<<<<<<<<<<<< 
 *         return self._python_target.close()
 * 
 */
__pyx_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._raise_if_stored(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_self)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 113; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":114
 *                                    filename):
 *         self._raise_if_stored()
 *         return self._python_target.close()             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self->_python_target, __pyx_n_close); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 114; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._TargetParserContext._handleParseResult");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":116
 *         return self._python_target.close()
 * 
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,             # <<<<<<<<<<<<<< 
 *                                        xmlDoc* result, filename) except NULL:
 *         if result is not NULL and result._private is NULL:
 */

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) {
xmlDoc *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_filename);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":118
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
 *                                        xmlDoc* result, filename) except NULL:
 *         if result is not NULL and result._private is NULL:             # <<<<<<<<<<<<<< 
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(result)
 */
__pyx_1 = (__pyx_v_result != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":118
 *     cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
 *                                        xmlDoc* result, filename) except NULL:
 *         if result is not NULL and result._private is NULL:             # <<<<<<<<<<<<<< 
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(result)
 */
  __pyx_1 = (__pyx_v_result->_private == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":120
 *         if result is not NULL and result._private is NULL:
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(result)             # <<<<<<<<<<<<<< 
 *         if self._c_ctxt.myDoc is not NULL and \
 *                 self._c_ctxt.myDoc is not result and \
 */
  xmlFreeDoc(__pyx_v_result);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":121
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(result)
 *         if self._c_ctxt.myDoc is not NULL and \             # <<<<<<<<<<<<<< 
 *                 self._c_ctxt.myDoc is not result and \
 *                 self._c_ctxt.myDoc._private is NULL:
 */
__pyx_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":122
 *             tree.xmlFreeDoc(result)
 *         if self._c_ctxt.myDoc is not NULL and \
 *                 self._c_ctxt.myDoc is not result and \             # <<<<<<<<<<<<<< 
 *                 self._c_ctxt.myDoc._private is NULL:
 *             # no _Document proxy => orphen
 */
  __pyx_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc != __pyx_v_result);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":123
 *         if self._c_ctxt.myDoc is not NULL and \
 *                 self._c_ctxt.myDoc is not result and \
 *                 self._c_ctxt.myDoc._private is NULL:             # <<<<<<<<<<<<<< 
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
 */
    __pyx_1 = (__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc->_private == NULL);
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":125
 *                 self._c_ctxt.myDoc._private is NULL:
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(self._c_ctxt.myDoc)             # <<<<<<<<<<<<<< 
 *             self._c_ctxt.myDoc = NULL
 *         self._raise_if_stored()
 */
  xmlFreeDoc(__pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":126
 *             # no _Document proxy => orphen
 *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
 *             self._c_ctxt.myDoc = NULL             # <<<<<<<<<<<<<< 
 *         self._raise_if_stored()
 *         raise _TargetParserResult(self._python_target.close())
 */
  __pyx_v_self->__pyx_base.__pyx_base._c_ctxt->myDoc = NULL;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":127
 *             tree.xmlFreeDoc(self._c_ctxt.myDoc)
 *             self._c_ctxt.myDoc = NULL
 *         self._raise_if_stored()             # <<<<<<<<<<<<<< 
 *         raise _TargetParserResult(self._python_target.close())
 */
__pyx_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_2 == -1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 127; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":128
 *             self._c_ctxt.myDoc = NULL
 *         self._raise_if_stored()
 *         raise _TargetParserResult(self._python_target.close())             # <<<<<<<<<<<<<< 
 */
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n__TargetParserResult); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":128
 *             self._c_ctxt.myDoc = NULL
 *         self._raise_if_stored()
 *         raise _TargetParserResult(self._python_target.close())             # <<<<<<<<<<<<<< 
 */
__pyx_4 = PyObject_GetAttr(__pyx_v_self->_python_target, __pyx_n_close); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}
__pyx_5 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
__pyx_5 = 0;
__pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__Pyx_Raise(__pyx_5, 0, 0);
Py_DECREF(__pyx_5); __pyx_5 = 0;
{__pyx_filename = __pyx_f[8]; __pyx_lineno = 128; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._TargetParserContext._handleParseResultDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":8
 *     OUTPUT_METHOD_TEXT
 * 
 * cdef int _findOutputMethod(method) except -1:             # <<<<<<<<<<<<<< 
 *     if method is None:
 *         return OUTPUT_METHOD_XML
 */

static PyObject *__pyx_n_lower;

static PyObject *__pyx_k553p;

static char __pyx_k553[] = "unknown output method %r";

static  int __pyx_f_4lxml_5etree__findOutputMethod(PyObject *__pyx_v_method) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_method);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":9
 * 
 * cdef int _findOutputMethod(method) except -1:
 *     if method is None:             # <<<<<<<<<<<<<< 
 *         return OUTPUT_METHOD_XML
 *     method = method.lower()
 */
__pyx_1 = (__pyx_v_method == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":10
 * cdef int _findOutputMethod(method) except -1:
 *     if method is None:
 *         return OUTPUT_METHOD_XML             # <<<<<<<<<<<<<< 
 *     method = method.lower()
 *     if method == "xml":
 */
  __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":11
 *     if method is None:
 *         return OUTPUT_METHOD_XML
 *     method = method.lower()             # <<<<<<<<<<<<<< 
 *     if method == "xml":
 *         return OUTPUT_METHOD_XML
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_method, __pyx_n_lower); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_method);
__pyx_v_method = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":12
 *         return OUTPUT_METHOD_XML
 *     method = method.lower()
 *     if method == "xml":             # <<<<<<<<<<<<<< 
 *         return OUTPUT_METHOD_XML
 *     if method == "html":
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_method, __pyx_n_xml, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 12; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 12; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":13
 *     method = method.lower()
 *     if method == "xml":
 *         return OUTPUT_METHOD_XML             # <<<<<<<<<<<<<< 
 *     if method == "html":
 *         return OUTPUT_METHOD_HTML
 */
  __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":14
 *     if method == "xml":
 *         return OUTPUT_METHOD_XML
 *     if method == "html":             # <<<<<<<<<<<<<< 
 *         return OUTPUT_METHOD_HTML
 *     if method == "text":
 */
__pyx_3 = PyObject_RichCompare(__pyx_v_method, __pyx_n_html, Py_EQ); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":15
 *         return OUTPUT_METHOD_XML
 *     if method == "html":
 *         return OUTPUT_METHOD_HTML             # <<<<<<<<<<<<<< 
 *     if method == "text":
 *         return OUTPUT_METHOD_TEXT
 */
  __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_HTML;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":16
 *     if method == "html":
 *         return OUTPUT_METHOD_HTML
 *     if method == "text":             # <<<<<<<<<<<<<< 
 *         return OUTPUT_METHOD_TEXT
 *     raise ValueError, "unknown output method %r" % method
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_method, __pyx_n_text, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":17
 *         return OUTPUT_METHOD_HTML
 *     if method == "text":
 *         return OUTPUT_METHOD_TEXT             # <<<<<<<<<<<<<< 
 *     raise ValueError, "unknown output method %r" % method
 * 
 */
  __pyx_r = __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":18
 *     if method == "text":
 *         return OUTPUT_METHOD_TEXT
 *     raise ValueError, "unknown output method %r" % method             # <<<<<<<<<<<<<< 
 * 
 * cdef _textToString(xmlNode* c_node, encoding):
 */
__pyx_3 = PyNumber_Remainder(__pyx_k553p, __pyx_v_method); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; goto __pyx_L1;}
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_3, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
{__pyx_filename = __pyx_f[9]; __pyx_lineno = 18; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._findOutputMethod");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_method);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":20
 *     raise ValueError, "unknown output method %r" % method
 * 
 * cdef _textToString(xmlNode* c_node, encoding):             # <<<<<<<<<<<<<< 
 *     cdef char* c_text
 *     with nogil:
 */

static PyObject *__pyx_k554p;

static char __pyx_k554[] = "UTF-8";
static char __pyx_k556[] = "utf-8";
static char __pyx_k557[] = "strict";
static char __pyx_k558[] = "strict";

static  PyObject *__pyx_f_4lxml_5etree__textToString(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_encoding) {
char *__pyx_v_c_text;
PyObject *__pyx_v_text;
PyObject *__pyx_v_tail;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
char *__pyx_5;
Py_INCREF(__pyx_v_encoding);
__pyx_v_text = Py_None; Py_INCREF(Py_None);
__pyx_v_tail = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":22
 * cdef _textToString(xmlNode* c_node, encoding):
 *     cdef char* c_text
 *     with nogil:             # <<<<<<<<<<<<<< 
 *         c_text = tree.xmlNodeGetContent(c_node)
 *     if c_text is NULL:
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":23
 *     cdef char* c_text
 *     with nogil:
 *         c_text = tree.xmlNodeGetContent(c_node)             # <<<<<<<<<<<<<< 
 *     if c_text is NULL:
 *         python.PyErr_NoMemory()
 */
    __pyx_v_c_text = xmlNodeGetContent(__pyx_v_c_node);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":24
 *     with nogil:
 *         c_text = tree.xmlNodeGetContent(c_node)
 *     if c_text is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 * 
 */
__pyx_1 = (__pyx_v_c_text == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":25
 *         c_text = tree.xmlNodeGetContent(c_node)
 *     if c_text is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 * 
 *     text = c_text
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 25; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":27
 *         python.PyErr_NoMemory()
 * 
 *     text = c_text             # <<<<<<<<<<<<<< 
 *     tree.xmlFree(c_text)
 * 
 */
__pyx_2 = PyString_FromString(__pyx_v_c_text); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 27; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":28
 * 
 *     text = c_text
 *     tree.xmlFree(c_text)             # <<<<<<<<<<<<<< 
 * 
 *     if _hasTail(c_node):
 */
xmlFree(__pyx_v_c_text);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":30
 *     tree.xmlFree(c_text)
 * 
 *     if _hasTail(c_node):             # <<<<<<<<<<<<<< 
 *         tail = _collectText(c_node.next)
 *         if tail:
 */
__pyx_3 = __pyx_f_4lxml_5etree__hasTail(__pyx_v_c_node);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":31
 * 
 *     if _hasTail(c_node):
 *         tail = _collectText(c_node.next)             # <<<<<<<<<<<<<< 
 *         if tail:
 *             text = text + tail
 */
  __pyx_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_node->next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_v_tail);
  __pyx_v_tail = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":32
 *     if _hasTail(c_node):
 *         tail = _collectText(c_node.next)
 *         if tail:             # <<<<<<<<<<<<<< 
 *             text = text + tail
 * 
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_tail); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 32; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":33
 *         tail = _collectText(c_node.next)
 *         if tail:
 *             text = text + tail             # <<<<<<<<<<<<<< 
 * 
 *     if encoding is None:
 */
    __pyx_2 = PyNumber_Add(__pyx_v_text, __pyx_v_tail); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 33; goto __pyx_L1;}
    Py_DECREF(__pyx_v_text);
    __pyx_v_text = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":35
 *             text = text + tail
 * 
 *     if encoding is None:             # <<<<<<<<<<<<<< 
 *         return text
 *     encoding = encoding.upper()
 */
__pyx_1 = (__pyx_v_encoding == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":36
 * 
 *     if encoding is None:
 *         return text             # <<<<<<<<<<<<<< 
 *     encoding = encoding.upper()
 *     if encoding == 'UTF-8' or encoding == 'ASCII':
 */
  Py_INCREF(__pyx_v_text);
  __pyx_r = __pyx_v_text;
  goto __pyx_L0;
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":37
 *     if encoding is None:
 *         return text
 *     encoding = encoding.upper()             # <<<<<<<<<<<<<< 
 *     if encoding == 'UTF-8' or encoding == 'ASCII':
 *         return text
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_upper); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 37; goto __pyx_L1;}
__pyx_4 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 37; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_encoding);
__pyx_v_encoding = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":38
 *         return text
 *     encoding = encoding.upper()
 *     if encoding == 'UTF-8' or encoding == 'ASCII':             # <<<<<<<<<<<<<< 
 *         return text
 * 
 */
__pyx_2 = PyObject_RichCompare(__pyx_v_encoding, __pyx_k554p, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 38; goto __pyx_L1;}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 38; goto __pyx_L1;}
if (!__pyx_1) {
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":38
 *         return text
 *     encoding = encoding.upper()
 *     if encoding == 'UTF-8' or encoding == 'ASCII':             # <<<<<<<<<<<<<< 
 *         return text
 * 
 */
  __pyx_2 = PyObject_RichCompare(__pyx_v_encoding, __pyx_n_ASCII, Py_EQ); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 38; goto __pyx_L1;}
}
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 38; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":39
 *     encoding = encoding.upper()
 *     if encoding == 'UTF-8' or encoding == 'ASCII':
 *         return text             # <<<<<<<<<<<<<< 
 * 
 *     text = python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 */
  Py_INCREF(__pyx_v_text);
  __pyx_r = __pyx_v_text;
  goto __pyx_L0;
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":41
 *         return text
 * 
 *     text = python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')             # <<<<<<<<<<<<<< 
 *     return python.PyUnicode_AsEncodedString(text, encoding, 'strict')
 * 
 */
__pyx_4 = PyUnicode_FromEncodedObject(__pyx_v_text,__pyx_k556,__pyx_k557); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 41; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":42
 * 
 *     text = python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 *     return python.PyUnicode_AsEncodedString(text, encoding, 'strict')             # <<<<<<<<<<<<<< 
 * 
 * cdef _tostring(_Element element, encoding, method,
 */
__pyx_5 = PyString_AsString(__pyx_v_encoding); if (unlikely((!__pyx_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 42; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":42
 * 
 *     text = python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 *     return python.PyUnicode_AsEncodedString(text, encoding, 'strict')             # <<<<<<<<<<<<<< 
 * 
 * cdef _tostring(_Element element, encoding, method,
 */
__pyx_2 = PyUnicode_AsEncodedString(__pyx_v_text,__pyx_5,__pyx_k558); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 42; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._textToString");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_tail);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":44
 *     return python.PyUnicode_AsEncodedString(text, encoding, 'strict')
 * 
 * cdef _tostring(_Element element, encoding, method,             # <<<<<<<<<<<<<< 
 *                bint write_xml_declaration, bint write_complete_document,
 *                bint pretty_print):
 */

static PyObject *__pyx_k560p;

static char __pyx_k559[] = "unknown encoding: '%s'";
static char __pyx_k560[] = "Failed to create output buffer";

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) {
xmlOutputBuffer *__pyx_v_c_buffer;
xmlBuffer *__pyx_v_c_result_buffer;
xmlCharEncodingHandler *__pyx_v_enchandler;
char *__pyx_v_c_enc;
int __pyx_v_c_method;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_method);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":56
 *     cdef char* c_version
 *     cdef int c_method
 *     if element is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     if encoding is None:
 */
__pyx_1 = (((PyObject *)__pyx_v_element) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":57
 *     cdef int c_method
 *     if element is None:
 *         return None             # <<<<<<<<<<<<<< 
 *     if encoding is None:
 *         c_enc = NULL
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":58
 *     if element is None:
 *         return None
 *     if encoding is None:             # <<<<<<<<<<<<<< 
 *         c_enc = NULL
 *     else:
 */
__pyx_1 = (__pyx_v_encoding == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":59
 *         return None
 *     if encoding is None:
 *         c_enc = NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         encoding = _utf8(encoding)
 */
  __pyx_v_c_enc = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":61
 *         c_enc = NULL
 *     else:
 *         encoding = _utf8(encoding)             # <<<<<<<<<<<<<< 
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":62
 *     else:
 *         encoding = _utf8(encoding)
 *         c_enc = _cstr(encoding)             # <<<<<<<<<<<<<< 
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 */
  __pyx_v_c_enc = _cstr(__pyx_v_encoding);
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":63
 *         encoding = _utf8(encoding)
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)             # <<<<<<<<<<<<<< 
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         return _textToString(element._c_node, encoding)
 */
__pyx_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 63; goto __pyx_L1;}
__pyx_v_c_method = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":64
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:             # <<<<<<<<<<<<<< 
 *         return _textToString(element._c_node, encoding)
 *     # it is necessary to *and* find the encoding handler *and* use
 */
__pyx_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":65
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         return _textToString(element._c_node, encoding)             # <<<<<<<<<<<<<< 
 *     # it is necessary to *and* find the encoding handler *and* use
 *     # encoding during output
 */
  __pyx_2 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node,__pyx_v_encoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 65; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":68
 *     # it is necessary to *and* find the encoding handler *and* use
 *     # encoding during output
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)             # <<<<<<<<<<<<<< 
 *     if enchandler is NULL:
 *         raise LookupError, python.PyString_FromFormat(
 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":69
 *     # encoding during output
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
 *     if enchandler is NULL:             # <<<<<<<<<<<<<< 
 *         raise LookupError, python.PyString_FromFormat(
 *             "unknown encoding: '%s'", c_enc)
 */
__pyx_1 = (__pyx_v_enchandler == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":71
 *     if enchandler is NULL:
 *         raise LookupError, python.PyString_FromFormat(
 *             "unknown encoding: '%s'", c_enc)             # <<<<<<<<<<<<<< 
 *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
 *     if c_buffer is NULL:
 */
  __pyx_2 = PyString_FromFormat(__pyx_k559,__pyx_v_c_enc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; goto __pyx_L1;}
  __Pyx_Raise(__pyx_builtin_LookupError, __pyx_2, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":72
 *         raise LookupError, python.PyString_FromFormat(
 *             "unknown encoding: '%s'", c_enc)
 *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)             # <<<<<<<<<<<<<< 
 *     if c_buffer is NULL:
 *         tree.xmlCharEncCloseFunc(enchandler)
 */
__pyx_v_c_buffer = xmlAllocOutputBuffer(__pyx_v_enchandler);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":73
 *             "unknown encoding: '%s'", c_enc)
 *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
 *     if c_buffer is NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlCharEncCloseFunc(enchandler)
 *         raise LxmlError, "Failed to create output buffer"
 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":74
 *     c_buffer = tree.xmlAllocOutputBuffer(enchandler)
 *     if c_buffer is NULL:
 *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<< 
 *         raise LxmlError, "Failed to create output buffer"
 * 
 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":75
 *     if c_buffer is NULL:
 *         tree.xmlCharEncCloseFunc(enchandler)
 *         raise LxmlError, "Failed to create output buffer"             # <<<<<<<<<<<<<< 
 * 
 *     with nogil:
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":75
 *     if c_buffer is NULL:
 *         tree.xmlCharEncCloseFunc(enchandler)
 *         raise LxmlError, "Failed to create output buffer"             # <<<<<<<<<<<<<< 
 * 
 *     with nogil:
 */
  __Pyx_Raise(__pyx_2, __pyx_k560p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 75; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":77
 *         raise LxmlError, "Failed to create output buffer"
 * 
 *     with nogil:             # <<<<<<<<<<<<<< 
 *         _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
 *                            write_xml_declaration, write_complete_document,
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":80
 *         _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
 *                            write_xml_declaration, write_complete_document,
 *                            pretty_print)             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:
 */
    __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);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":81
 *                            write_xml_declaration, write_complete_document,
 *                            pretty_print)
 *         tree.xmlOutputBufferFlush(c_buffer)             # <<<<<<<<<<<<<< 
 *         if c_buffer.conv is not NULL:
 *             c_result_buffer = c_buffer.conv
 */
    xmlOutputBufferFlush(__pyx_v_c_buffer);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":82
 *                            pretty_print)
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:             # <<<<<<<<<<<<<< 
 *             c_result_buffer = c_buffer.conv
 *         else:
 */
    __pyx_1 = (__pyx_v_c_buffer->conv != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":83
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:
 *             c_result_buffer = c_buffer.conv             # <<<<<<<<<<<<<< 
 *         else:
 *             c_result_buffer = c_buffer.buffer
 */
      __pyx_v_c_result_buffer = __pyx_v_c_buffer->conv;
      goto __pyx_L10;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":85
 *             c_result_buffer = c_buffer.conv
 *         else:
 *             c_result_buffer = c_buffer.buffer             # <<<<<<<<<<<<<< 
 * 
 *     try:
 */
      __pyx_v_c_result_buffer = __pyx_v_c_buffer->buffer;
    }
    __pyx_L10:;
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":87
 *             c_result_buffer = c_buffer.buffer
 * 
 *     try:             # <<<<<<<<<<<<<< 
 *         result = python.PyString_FromStringAndSize(
 *             tree.xmlBufferContent(c_result_buffer),
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":90
 *         result = python.PyString_FromStringAndSize(
 *             tree.xmlBufferContent(c_result_buffer),
 *             tree.xmlBufferLength(c_result_buffer))             # <<<<<<<<<<<<<< 
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)
 */
  __pyx_2 = PyString_FromStringAndSize(xmlBufferContent(__pyx_v_c_result_buffer),xmlBufferLength(__pyx_v_c_result_buffer)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 88; goto __pyx_L12;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L13;
  __pyx_L12: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L13;
  }
  __pyx_L13:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":92
 *             tree.xmlBufferLength(c_result_buffer))
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
  xmlOutputBufferClose(__pyx_v_c_buffer);
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":93
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef _tounicode(_Element element, method,
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._tostring");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_method);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":95
 *     return result
 * 
 * cdef _tounicode(_Element element, method,             # <<<<<<<<<<<<<< 
 *                 bint write_complete_document, bint pretty_print):
 *     """Serialize an element to the Python unicode representation of its XML
 */

static PyObject *__pyx_k563p;

static char __pyx_k561[] = "utf-8";
static char __pyx_k562[] = "strict";
static char __pyx_k563[] = "Failed to create output buffer";
static char __pyx_k564[] = "strict";

static  PyObject *__pyx_f_4lxml_5etree__tounicode(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_method,int __pyx_v_write_complete_document,int __pyx_v_pretty_print) {
xmlOutputBuffer *__pyx_v_c_buffer;
xmlBuffer *__pyx_v_c_result_buffer;
int __pyx_v_c_method;
PyObject *__pyx_v_text;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_method);
__pyx_v_text = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":103
 *     cdef tree.xmlBuffer* c_result_buffer
 *     cdef int c_method
 *     if element is None:             # <<<<<<<<<<<<<< 
 *         return None
 *     c_method = _findOutputMethod(method)
 */
__pyx_1 = (((PyObject *)__pyx_v_element) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":104
 *     cdef int c_method
 *     if element is None:
 *         return None             # <<<<<<<<<<<<<< 
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":105
 *     if element is None:
 *         return None
 *     c_method = _findOutputMethod(method)             # <<<<<<<<<<<<<< 
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         text = _textToString(element._c_node, None)
 */
__pyx_2 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 105; goto __pyx_L1;}
__pyx_v_c_method = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":106
 *         return None
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:             # <<<<<<<<<<<<<< 
 *         text = _textToString(element._c_node, None)
 *         return python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 */
__pyx_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":107
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         text = _textToString(element._c_node, None)             # <<<<<<<<<<<<<< 
 *         return python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)
 */
  __pyx_3 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node,Py_None); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 107; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":108
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         text = _textToString(element._c_node, None)
 *         return python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')             # <<<<<<<<<<<<<< 
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)
 *     if c_buffer is NULL:
 */
  __pyx_3 = PyUnicode_FromEncodedObject(__pyx_v_text,__pyx_k561,__pyx_k562); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":109
 *         text = _textToString(element._c_node, None)
 *         return python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)             # <<<<<<<<<<<<<< 
 *     if c_buffer is NULL:
 *         raise LxmlError, "Failed to create output buffer"
 */
__pyx_v_c_buffer = xmlAllocOutputBuffer(NULL);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":110
 *         return python.PyUnicode_FromEncodedObject(text, 'utf-8', 'strict')
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)
 *     if c_buffer is NULL:             # <<<<<<<<<<<<<< 
 *         raise LxmlError, "Failed to create output buffer"
 * 
 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":111
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)
 *     if c_buffer is NULL:
 *         raise LxmlError, "Failed to create output buffer"             # <<<<<<<<<<<<<< 
 * 
 *     with nogil:
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":111
 *     c_buffer = tree.xmlAllocOutputBuffer(NULL)
 *     if c_buffer is NULL:
 *         raise LxmlError, "Failed to create output buffer"             # <<<<<<<<<<<<<< 
 * 
 *     with nogil:
 */
  __Pyx_Raise(__pyx_3, __pyx_k563p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 111; goto __pyx_L1;}
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":113
 *         raise LxmlError, "Failed to create output buffer"
 * 
 *     with nogil:             # <<<<<<<<<<<<<< 
 *         _writeNodeToBuffer(c_buffer, element._c_node, NULL, c_method, 0,
 *                            write_complete_document, pretty_print)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":115
 *     with nogil:
 *         _writeNodeToBuffer(c_buffer, element._c_node, NULL, c_method, 0,
 *                            write_complete_document, pretty_print)             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:
 */
    __pyx_f_4lxml_5etree__writeNodeToBuffer(__pyx_v_c_buffer,__pyx_v_element->_c_node,NULL,__pyx_v_c_method,0,__pyx_v_write_complete_document,__pyx_v_pretty_print);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":116
 *         _writeNodeToBuffer(c_buffer, element._c_node, NULL, c_method, 0,
 *                            write_complete_document, pretty_print)
 *         tree.xmlOutputBufferFlush(c_buffer)             # <<<<<<<<<<<<<< 
 *         if c_buffer.conv is not NULL:
 *             c_result_buffer = c_buffer.conv
 */
    xmlOutputBufferFlush(__pyx_v_c_buffer);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":117
 *                            write_complete_document, pretty_print)
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:             # <<<<<<<<<<<<<< 
 *             c_result_buffer = c_buffer.conv
 *         else:
 */
    __pyx_1 = (__pyx_v_c_buffer->conv != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":118
 *         tree.xmlOutputBufferFlush(c_buffer)
 *         if c_buffer.conv is not NULL:
 *             c_result_buffer = c_buffer.conv             # <<<<<<<<<<<<<< 
 *         else:
 *             c_result_buffer = c_buffer.buffer
 */
      __pyx_v_c_result_buffer = __pyx_v_c_buffer->conv;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":120
 *             c_result_buffer = c_buffer.conv
 *         else:
 *             c_result_buffer = c_buffer.buffer             # <<<<<<<<<<<<<< 
 * 
 *     try:
 */
      __pyx_v_c_result_buffer = __pyx_v_c_buffer->buffer;
    }
    __pyx_L8:;
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":122
 *             c_result_buffer = c_buffer.buffer
 * 
 *     try:             # <<<<<<<<<<<<<< 
 *         result = python.PyUnicode_DecodeUTF8(
 *             tree.xmlBufferContent(c_result_buffer),
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":126
 *             tree.xmlBufferContent(c_result_buffer),
 *             tree.xmlBufferLength(c_result_buffer),
 *             'strict')             # <<<<<<<<<<<<<< 
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)
 */
  __pyx_3 = PyUnicode_DecodeUTF8(xmlBufferContent(__pyx_v_c_result_buffer),xmlBufferLength(__pyx_v_c_result_buffer),__pyx_k564); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 123; goto __pyx_L10;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_3;
  __pyx_3 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L11;
  __pyx_L10: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":128
 *             'strict')
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
  xmlOutputBufferClose(__pyx_v_c_buffer);
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":129
 *     finally:
 *         tree.xmlOutputBufferClose(c_buffer)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writeNodeToBuffer(tree.xmlOutputBuffer* c_buffer,
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._tounicode");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_method);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":131
 *     return result
 * 
 * cdef void _writeNodeToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<< 
 *                              xmlNode* c_node, char* encoding, int c_method,
 *                              bint write_xml_declaration,
 */

static char __pyx_k565[] = "\n";

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) {
xmlDoc *__pyx_v_c_doc;
xmlNode *__pyx_v_c_nsdecl_node;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":138
 *     cdef xmlDoc* c_doc
 *     cdef xmlNode* c_nsdecl_node
 *     c_doc = c_node.doc             # <<<<<<<<<<<<<< 
 *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:
 *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding)
 */
__pyx_v_c_doc = __pyx_v_c_node->doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":139
 *     cdef xmlNode* c_nsdecl_node
 *     c_doc = c_node.doc
 *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<< 
 *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding)
 * 
 */
__pyx_1 = __pyx_v_write_xml_declaration;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":139
 *     cdef xmlNode* c_nsdecl_node
 *     c_doc = c_node.doc
 *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<< 
 *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding)
 * 
 */
  __pyx_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":140
 *     c_doc = c_node.doc
 *     if write_xml_declaration and c_method == OUTPUT_METHOD_XML:
 *         _writeDeclarationToBuffer(c_buffer, c_doc.version, encoding)             # <<<<<<<<<<<<<< 
 * 
 *     # write internal DTD subset, preceding PIs/comments, etc.
 */
  __pyx_f_4lxml_5etree__writeDeclarationToBuffer(__pyx_v_c_buffer,__pyx_v_c_doc->version,__pyx_v_encoding);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":143
 * 
 *     # write internal DTD subset, preceding PIs/comments, etc.
 *     if write_complete_document:             # <<<<<<<<<<<<<< 
 *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)
 *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
 */
__pyx_1 = __pyx_v_write_complete_document;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":144
 *     # write internal DTD subset, preceding PIs/comments, etc.
 *     if write_complete_document:
 *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)             # <<<<<<<<<<<<<< 
 *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
 * 
 */
  __pyx_f_4lxml_5etree__writeDtdToBuffer(__pyx_v_c_buffer,__pyx_v_c_doc,__pyx_v_c_node->name,__pyx_v_encoding);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":145
 *     if write_complete_document:
 *         _writeDtdToBuffer(c_buffer, c_doc, c_node.name, encoding)
 *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<< 
 * 
 *     c_nsdecl_node = c_node
 */
  __pyx_f_4lxml_5etree__writePrevSiblings(__pyx_v_c_buffer,__pyx_v_c_node,__pyx_v_encoding,__pyx_v_pretty_print);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":147
 *         _writePrevSiblings(c_buffer, c_node, encoding, pretty_print)
 * 
 *     c_nsdecl_node = c_node             # <<<<<<<<<<<<<< 
 *     if c_node.parent is NULL or c_node.parent.type != tree.XML_DOCUMENT_NODE:
 *         # copy the node and add namespaces from parents
 */
__pyx_v_c_nsdecl_node = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":148
 * 
 *     c_nsdecl_node = c_node
 *     if c_node.parent is NULL or c_node.parent.type != tree.XML_DOCUMENT_NODE:             # <<<<<<<<<<<<<< 
 *         # copy the node and add namespaces from parents
 *         # this is required to make libxml write them
 */
__pyx_1 = (__pyx_v_c_node->parent == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":148
 * 
 *     c_nsdecl_node = c_node
 *     if c_node.parent is NULL or c_node.parent.type != tree.XML_DOCUMENT_NODE:             # <<<<<<<<<<<<<< 
 *         # copy the node and add namespaces from parents
 *         # this is required to make libxml write them
 */
  __pyx_1 = (__pyx_v_c_node->parent->type != XML_DOCUMENT_NODE);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":151
 *         # copy the node and add namespaces from parents
 *         # this is required to make libxml write them
 *         c_nsdecl_node = tree.xmlCopyNode(c_node, 2)             # <<<<<<<<<<<<<< 
 *         _copyParentNamespaces(c_node, c_nsdecl_node)
 * 
 */
  __pyx_v_c_nsdecl_node = xmlCopyNode(__pyx_v_c_node,2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":152
 *         # this is required to make libxml write them
 *         c_nsdecl_node = tree.xmlCopyNode(c_node, 2)
 *         _copyParentNamespaces(c_node, c_nsdecl_node)             # <<<<<<<<<<<<<< 
 * 
 *         c_nsdecl_node.parent = c_node.parent
 */
  __pyx_f_4lxml_5etree__copyParentNamespaces(__pyx_v_c_node,__pyx_v_c_nsdecl_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":154
 *         _copyParentNamespaces(c_node, c_nsdecl_node)
 * 
 *         c_nsdecl_node.parent = c_node.parent             # <<<<<<<<<<<<<< 
 *         c_nsdecl_node.children = c_node.children
 *         c_nsdecl_node.last = c_node.last
 */
  __pyx_v_c_nsdecl_node->parent = __pyx_v_c_node->parent;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":155
 * 
 *         c_nsdecl_node.parent = c_node.parent
 *         c_nsdecl_node.children = c_node.children             # <<<<<<<<<<<<<< 
 *         c_nsdecl_node.last = c_node.last
 * 
 */
  __pyx_v_c_nsdecl_node->children = __pyx_v_c_node->children;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":156
 *         c_nsdecl_node.parent = c_node.parent
 *         c_nsdecl_node.children = c_node.children
 *         c_nsdecl_node.last = c_node.last             # <<<<<<<<<<<<<< 
 * 
 *     # write node
 */
  __pyx_v_c_nsdecl_node->last = __pyx_v_c_node->last;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":159
 * 
 *     # write node
 *     if c_method == OUTPUT_METHOD_XML:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(
 *             c_buffer, c_doc, c_nsdecl_node, 0, pretty_print, encoding)
 */
__pyx_1 = (__pyx_v_c_method == __pyx_e_4lxml_5etree_OUTPUT_METHOD_XML);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":161
 *     if c_method == OUTPUT_METHOD_XML:
 *         tree.xmlNodeDumpOutput(
 *             c_buffer, c_doc, c_nsdecl_node, 0, pretty_print, encoding)             # <<<<<<<<<<<<<< 
 *     else:
 *         tree.htmlNodeDumpFormatOutput(
 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_doc,__pyx_v_c_nsdecl_node,0,__pyx_v_pretty_print,__pyx_v_encoding);
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":164
 *     else:
 *         tree.htmlNodeDumpFormatOutput(
 *             c_buffer, c_doc, c_nsdecl_node, encoding, pretty_print)             # <<<<<<<<<<<<<< 
 * 
 *     if c_nsdecl_node is not c_node:
 */
  htmlNodeDumpFormatOutput(__pyx_v_c_buffer,__pyx_v_c_doc,__pyx_v_c_nsdecl_node,__pyx_v_encoding,__pyx_v_pretty_print);
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":166
 *             c_buffer, c_doc, c_nsdecl_node, encoding, pretty_print)
 * 
 *     if c_nsdecl_node is not c_node:             # <<<<<<<<<<<<<< 
 *         # clean up
 *         c_nsdecl_node.children = c_nsdecl_node.last = NULL
 */
__pyx_1 = (__pyx_v_c_nsdecl_node != __pyx_v_c_node);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":168
 *     if c_nsdecl_node is not c_node:
 *         # clean up
 *         c_nsdecl_node.children = c_nsdecl_node.last = NULL             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeNode(c_nsdecl_node)
 * 
 */
  __pyx_v_c_nsdecl_node->children = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":168
 *     if c_nsdecl_node is not c_node:
 *         # clean up
 *         c_nsdecl_node.children = c_nsdecl_node.last = NULL             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeNode(c_nsdecl_node)
 * 
 */
  __pyx_v_c_nsdecl_node->last = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":169
 *         # clean up
 *         c_nsdecl_node.children = c_nsdecl_node.last = NULL
 *         tree.xmlFreeNode(c_nsdecl_node)             # <<<<<<<<<<<<<< 
 * 
 *     # write tail, trailing comments, etc.
 */
  xmlFreeNode(__pyx_v_c_nsdecl_node);
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":172
 * 
 *     # write tail, trailing comments, etc.
 *     _writeTail(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<< 
 *     if write_complete_document:
 *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
 */
__pyx_f_4lxml_5etree__writeTail(__pyx_v_c_buffer,__pyx_v_c_node,__pyx_v_encoding,__pyx_v_pretty_print);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":173
 *     # write tail, trailing comments, etc.
 *     _writeTail(c_buffer, c_node, encoding, pretty_print)
 *     if write_complete_document:             # <<<<<<<<<<<<<< 
 *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
 *     if pretty_print:
 */
__pyx_1 = __pyx_v_write_complete_document;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":174
 *     _writeTail(c_buffer, c_node, encoding, pretty_print)
 *     if write_complete_document:
 *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)             # <<<<<<<<<<<<<< 
 *     if pretty_print:
 *         tree.xmlOutputBufferWriteString(c_buffer, "\n")
 */
  __pyx_f_4lxml_5etree__writeNextSiblings(__pyx_v_c_buffer,__pyx_v_c_node,__pyx_v_encoding,__pyx_v_pretty_print);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":175
 *     if write_complete_document:
 *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
 *     if pretty_print:             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferWriteString(c_buffer, "\n")
 * 
 */
__pyx_1 = __pyx_v_pretty_print;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":176
 *         _writeNextSiblings(c_buffer, c_node, encoding, pretty_print)
 *     if pretty_print:
 *         tree.xmlOutputBufferWriteString(c_buffer, "\n")             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writeDeclarationToBuffer(tree.xmlOutputBuffer* c_buffer,
 */
  xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k565);
  goto __pyx_L8;
}
__pyx_L8:;

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":178
 *         tree.xmlOutputBufferWriteString(c_buffer, "\n")
 * 
 * cdef void _writeDeclarationToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<< 
 *                                     char* version, char* encoding) nogil:
 *     if version is NULL:
 */

static char __pyx_k566[] = "1.0";
static char __pyx_k567[] = "<?xml version='";
static char __pyx_k568[] = "' encoding='";
static char __pyx_k569[] = "'?>\n";

static  void __pyx_f_4lxml_5etree__writeDeclarationToBuffer(xmlOutputBuffer *__pyx_v_c_buffer,char *__pyx_v_version,char *__pyx_v_encoding) {
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":180
 * cdef void _writeDeclarationToBuffer(tree.xmlOutputBuffer* c_buffer,
 *                                     char* version, char* encoding) nogil:
 *     if version is NULL:             # <<<<<<<<<<<<<< 
 *         version = "1.0"
 *     tree.xmlOutputBufferWriteString(c_buffer, "<?xml version='")
 */
__pyx_1 = (__pyx_v_version == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":181
 *                                     char* version, char* encoding) nogil:
 *     if version is NULL:
 *         version = "1.0"             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, "<?xml version='")
 *     tree.xmlOutputBufferWriteString(c_buffer, version)
 */
  __pyx_v_version = __pyx_k566;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":182
 *     if version is NULL:
 *         version = "1.0"
 *     tree.xmlOutputBufferWriteString(c_buffer, "<?xml version='")             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, version)
 *     tree.xmlOutputBufferWriteString(c_buffer, "' encoding='")
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k567);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":183
 *         version = "1.0"
 *     tree.xmlOutputBufferWriteString(c_buffer, "<?xml version='")
 *     tree.xmlOutputBufferWriteString(c_buffer, version)             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, "' encoding='")
 *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_version);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":184
 *     tree.xmlOutputBufferWriteString(c_buffer, "<?xml version='")
 *     tree.xmlOutputBufferWriteString(c_buffer, version)
 *     tree.xmlOutputBufferWriteString(c_buffer, "' encoding='")             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
 *     tree.xmlOutputBufferWriteString(c_buffer, "'?>\n")
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k568);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":185
 *     tree.xmlOutputBufferWriteString(c_buffer, version)
 *     tree.xmlOutputBufferWriteString(c_buffer, "' encoding='")
 *     tree.xmlOutputBufferWriteString(c_buffer, encoding)             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, "'?>\n")
 * 
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_encoding);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":186
 *     tree.xmlOutputBufferWriteString(c_buffer, "' encoding='")
 *     tree.xmlOutputBufferWriteString(c_buffer, encoding)
 *     tree.xmlOutputBufferWriteString(c_buffer, "'?>\n")             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writeDtdToBuffer(tree.xmlOutputBuffer* c_buffer,
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k569);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":188
 *     tree.xmlOutputBufferWriteString(c_buffer, "'?>\n")
 * 
 * cdef void _writeDtdToBuffer(tree.xmlOutputBuffer* c_buffer,             # <<<<<<<<<<<<<< 
 *                             xmlDoc* c_doc, char* c_root_name,
 *                             char* encoding) nogil:
 */

static char __pyx_k570[] = "<!DOCTYPE ";
static char __pyx_k571[] = " PUBLIC \"";
static char __pyx_k572[] = "\" \"";
static char __pyx_k573[] = " SYSTEM \"";
static char __pyx_k574[] = "\">\n";
static char __pyx_k575[] = "\" [\n";
static char __pyx_k576[] = "]>\n";

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) {
xmlDtd *__pyx_v_c_dtd;
xmlNode *__pyx_v_c_node;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":193
 *     cdef tree.xmlDtd* c_dtd
 *     cdef xmlNode* c_node
 *     c_dtd = c_doc.intSubset             # <<<<<<<<<<<<<< 
 *     if c_dtd == NULL or c_dtd.name == NULL:
 *         return
 */
__pyx_v_c_dtd = __pyx_v_c_doc->intSubset;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":194
 *     cdef xmlNode* c_node
 *     c_dtd = c_doc.intSubset
 *     if c_dtd == NULL or c_dtd.name == NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:
 */
__pyx_1 = (__pyx_v_c_dtd == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":194
 *     cdef xmlNode* c_node
 *     c_dtd = c_doc.intSubset
 *     if c_dtd == NULL or c_dtd.name == NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:
 */
  __pyx_1 = (__pyx_v_c_dtd->name == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":195
 *     c_dtd = c_doc.intSubset
 *     if c_dtd == NULL or c_dtd.name == NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:
 *         return
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":196
 *     if c_dtd == NULL or c_dtd.name == NULL:
 *         return
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
 */
__pyx_1 = (__pyx_v_c_dtd->ExternalID == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":196
 *     if c_dtd == NULL or c_dtd.name == NULL:
 *         return
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
 */
  __pyx_1 = (__pyx_v_c_dtd->SystemID == NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":197
 *         return
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
 *         return
 */
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":198
 *     if c_dtd.ExternalID == NULL and c_dtd.SystemID == NULL:
 *         return
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:             # <<<<<<<<<<<<<< 
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
 */
__pyx_1 = (strcmp(__pyx_v_c_root_name,__pyx_v_c_dtd->name) != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":199
 *         return
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
 *         return             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
 */
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":200
 *     if cstd.strcmp(c_root_name, c_dtd.name) != 0:
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
 *     if c_dtd.ExternalID != NULL:
 */
xmlOutputBufferWrite(__pyx_v_c_buffer,10,__pyx_k570);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":201
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)             # <<<<<<<<<<<<<< 
 *     if c_dtd.ExternalID != NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_c_dtd->name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":202
 *     tree.xmlOutputBufferWrite(c_buffer, 10, "<!DOCTYPE ")
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
 *     if c_dtd.ExternalID != NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
 *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
 */
__pyx_1 = (__pyx_v_c_dtd->ExternalID != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":203
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.name)
 *     if c_dtd.ExternalID != NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
 */
  xmlOutputBufferWrite(__pyx_v_c_buffer,9,__pyx_k571);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":204
 *     if c_dtd.ExternalID != NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
 *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
 *     else:
 */
  xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_c_dtd->ExternalID);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":205
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' PUBLIC "')
 *         tree.xmlOutputBufferWriteString(c_buffer, c_dtd.ExternalID)
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '" "')             # <<<<<<<<<<<<<< 
 *     else:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
 */
  xmlOutputBufferWrite(__pyx_v_c_buffer,3,__pyx_k572);
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":207
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '" "')
 *     else:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
 */
  xmlOutputBufferWrite(__pyx_v_c_buffer,9,__pyx_k573);
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":208
 *     else:
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)             # <<<<<<<<<<<<<< 
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_c_dtd->SystemID);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":209
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \             # <<<<<<<<<<<<<< 
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
 *            c_dtd.pentities == NULL:
 */
__pyx_1 = (__pyx_v_c_dtd->entities == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":209
 *         tree.xmlOutputBufferWrite(c_buffer, 9, ' SYSTEM "')
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \             # <<<<<<<<<<<<<< 
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
 *            c_dtd.pentities == NULL:
 */
  __pyx_1 = (__pyx_v_c_dtd->elements == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":210
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \             # <<<<<<<<<<<<<< 
 *            c_dtd.pentities == NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')
 */
    __pyx_1 = (__pyx_v_c_dtd->attributes == NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":210
 *     tree.xmlOutputBufferWriteString(c_buffer, c_dtd.SystemID)
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \             # <<<<<<<<<<<<<< 
 *            c_dtd.pentities == NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')
 */
      __pyx_1 = (__pyx_v_c_dtd->notations == NULL);
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":211
 *     if c_dtd.entities == NULL and c_dtd.elements == NULL and \
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
 *            c_dtd.pentities == NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')
 *         return
 */
        __pyx_1 = (__pyx_v_c_dtd->pentities == NULL);
      }
    }
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":212
 *            c_dtd.attributes == NULL and c_dtd.notations == NULL and \
 *            c_dtd.pentities == NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')             # <<<<<<<<<<<<<< 
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 4, '" [\n')
 */
  xmlOutputBufferWrite(__pyx_v_c_buffer,3,__pyx_k574);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":213
 *            c_dtd.pentities == NULL:
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')
 *         return             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWrite(c_buffer, 4, '" [\n')
 *     if c_dtd.notations != NULL:
 */
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":214
 *         tree.xmlOutputBufferWrite(c_buffer, 3, '">\n')
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 4, '" [\n')             # <<<<<<<<<<<<<< 
 *     if c_dtd.notations != NULL:
 *         tree.xmlDumpNotationTable(c_buffer.buffer,
 */
xmlOutputBufferWrite(__pyx_v_c_buffer,4,__pyx_k575);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":215
 *         return
 *     tree.xmlOutputBufferWrite(c_buffer, 4, '" [\n')
 *     if c_dtd.notations != NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlDumpNotationTable(c_buffer.buffer,
 *                                   <tree.xmlNotationTable*>c_dtd.notations)
 */
__pyx_1 = (__pyx_v_c_dtd->notations != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":217
 *     if c_dtd.notations != NULL:
 *         tree.xmlDumpNotationTable(c_buffer.buffer,
 *                                   <tree.xmlNotationTable*>c_dtd.notations)             # <<<<<<<<<<<<<< 
 *     c_node = c_dtd.children
 *     while c_node is not NULL:
 */
  xmlDumpNotationTable(__pyx_v_c_buffer->buffer,((xmlNotationTable *)__pyx_v_c_dtd->notations));
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":218
 *         tree.xmlDumpNotationTable(c_buffer.buffer,
 *                                   <tree.xmlNotationTable*>c_dtd.notations)
 *     c_node = c_dtd.children             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
 */
__pyx_v_c_node = __pyx_v_c_dtd->children;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":219
 *                                   <tree.xmlNotationTable*>c_dtd.notations)
 *     c_node = c_dtd.children
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
 *         c_node = c_node.next
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":219
 *                                   <tree.xmlNotationTable*>c_dtd.notations)
 *     c_node = c_dtd.children
 *     while c_node is not NULL:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
 *         c_node = c_node.next
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":220
 *     c_node = c_dtd.children
 *     while c_node is not NULL:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)             # <<<<<<<<<<<<<< 
 *         c_node = c_node.next
 *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_node,0,0,__pyx_v_encoding);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":221
 *     while c_node is not NULL:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
 *         c_node = c_node.next             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
 * 
 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":222
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, 0, encoding)
 *         c_node = c_node.next
 *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writeTail(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
 */
xmlOutputBufferWrite(__pyx_v_c_buffer,3,__pyx_k576);

__pyx_L0:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":224
 *     tree.xmlOutputBufferWrite(c_buffer, 3, "]>\n")
 * 
 * cdef void _writeTail(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                      char* encoding, bint pretty_print) nogil:
 *     "Write the element tail."
 */

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) {
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":227
 *                      char* encoding, bint pretty_print) nogil:
 *     "Write the element tail."
 *     c_node = c_node.next             # <<<<<<<<<<<<<< 
 *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 */
__pyx_v_c_node = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":228
 *     "Write the element tail."
 *     c_node = c_node.next
 *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 *                                pretty_print, encoding)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":228
 *     "Write the element tail."
 *     c_node = c_node.next
 *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 *                                pretty_print, encoding)
 */
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":228
 *     "Write the element tail."
 *     c_node = c_node.next
 *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 *                                pretty_print, encoding)
 */
    __pyx_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":230
 *     while c_node is not NULL and c_node.type == tree.XML_TEXT_NODE:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 *                                pretty_print, encoding)             # <<<<<<<<<<<<<< 
 *         c_node = c_node.next
 * 
 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_node,0,__pyx_v_pretty_print,__pyx_v_encoding);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":231
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0,
 *                                pretty_print, encoding)
 *         c_node = c_node.next             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writePrevSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":233
 *         c_node = c_node.next
 * 
 * cdef void _writePrevSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 */

static char __pyx_k577[] = "\n";

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) {
xmlNode *__pyx_v_c_sibling;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":236
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<< 
 *         return
 *     # we are at a root node, so add PI and comment siblings
 */
__pyx_1 = (__pyx_v_c_node->parent != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":236
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<< 
 *         return
 *     # we are at a root node, so add PI and comment siblings
 */
  __pyx_1 = _isElement(__pyx_v_c_node->parent);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":237
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):
 *         return             # <<<<<<<<<<<<<< 
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":239
 *         return
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node             # <<<<<<<<<<<<<< 
 *     while c_sibling.prev != NULL and \
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \
 */
__pyx_v_c_sibling = __pyx_v_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":240
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node
 *     while c_sibling.prev != NULL and \             # <<<<<<<<<<<<<< 
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":240
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node
 *     while c_sibling.prev != NULL and \             # <<<<<<<<<<<<<< 
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 */
  __pyx_1 = (__pyx_v_c_sibling->prev != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":241
 *     c_sibling = c_node
 *     while c_sibling.prev != NULL and \
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<< 
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 *         c_sibling = c_sibling.prev
 */
    __pyx_1 = (__pyx_v_c_sibling->prev->type == XML_PI_NODE);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":242
 *     while c_sibling.prev != NULL and \
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<< 
 *         c_sibling = c_sibling.prev
 *     while c_sibling != c_node:
 */
      __pyx_1 = (__pyx_v_c_sibling->prev->type == XML_COMMENT_NODE);
    }
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":243
 *             (c_sibling.prev.type == tree.XML_PI_NODE or \
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 *         c_sibling = c_sibling.prev             # <<<<<<<<<<<<<< 
 *     while c_sibling != c_node:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 */
  __pyx_v_c_sibling = __pyx_v_c_sibling->prev;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":244
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 *         c_sibling = c_sibling.prev
 *     while c_sibling != c_node:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":244
 *                  c_sibling.prev.type == tree.XML_COMMENT_NODE):
 *         c_sibling = c_sibling.prev
 *     while c_sibling != c_node:             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)
 */
  __pyx_1 = (__pyx_v_c_sibling != __pyx_v_c_node);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":246
 *     while c_sibling != c_node:
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)             # <<<<<<<<<<<<<< 
 *         if pretty_print:
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_sibling,0,__pyx_v_pretty_print,__pyx_v_encoding);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":247
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)
 *         if pretty_print:             # <<<<<<<<<<<<<< 
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 *         c_sibling = c_sibling.next
 */
  __pyx_1 = __pyx_v_pretty_print;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":248
 *                                pretty_print, encoding)
 *         if pretty_print:
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")             # <<<<<<<<<<<<<< 
 *         c_sibling = c_sibling.next
 * 
 */
    xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k577);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":249
 *         if pretty_print:
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<< 
 * 
 * cdef void _writeNextSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,
 */
  __pyx_v_c_sibling = __pyx_v_c_sibling->next;
}

__pyx_L0:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":251
 *         c_sibling = c_sibling.next
 * 
 * cdef void _writeNextSiblings(tree.xmlOutputBuffer* c_buffer, xmlNode* c_node,             # <<<<<<<<<<<<<< 
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 */

static char __pyx_k578[] = "\n";

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) {
xmlNode *__pyx_v_c_sibling;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":254
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<< 
 *         return
 *     # we are at a root node, so add PI and comment siblings
 */
__pyx_1 = (__pyx_v_c_node->parent != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":254
 *                              char* encoding, bint pretty_print) nogil:
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):             # <<<<<<<<<<<<<< 
 *         return
 *     # we are at a root node, so add PI and comment siblings
 */
  __pyx_1 = _isElement(__pyx_v_c_node->parent);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":255
 *     cdef xmlNode* c_sibling
 *     if c_node.parent is not NULL and _isElement(c_node.parent):
 *         return             # <<<<<<<<<<<<<< 
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node.next
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":257
 *         return
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node.next             # <<<<<<<<<<<<<< 
 *     while c_sibling != NULL and \
 *             (c_sibling.type == tree.XML_PI_NODE or \
 */
__pyx_v_c_sibling = __pyx_v_c_node->next;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":258
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node.next
 *     while c_sibling != NULL and \             # <<<<<<<<<<<<<< 
 *             (c_sibling.type == tree.XML_PI_NODE or \
 *                  c_sibling.type == tree.XML_COMMENT_NODE):
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":258
 *     # we are at a root node, so add PI and comment siblings
 *     c_sibling = c_node.next
 *     while c_sibling != NULL and \             # <<<<<<<<<<<<<< 
 *             (c_sibling.type == tree.XML_PI_NODE or \
 *                  c_sibling.type == tree.XML_COMMENT_NODE):
 */
  __pyx_1 = (__pyx_v_c_sibling != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":259
 *     c_sibling = c_node.next
 *     while c_sibling != NULL and \
 *             (c_sibling.type == tree.XML_PI_NODE or \             # <<<<<<<<<<<<<< 
 *                  c_sibling.type == tree.XML_COMMENT_NODE):
 *         if pretty_print:
 */
    __pyx_1 = (__pyx_v_c_sibling->type == XML_PI_NODE);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":260
 *     while c_sibling != NULL and \
 *             (c_sibling.type == tree.XML_PI_NODE or \
 *                  c_sibling.type == tree.XML_COMMENT_NODE):             # <<<<<<<<<<<<<< 
 *         if pretty_print:
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 */
      __pyx_1 = (__pyx_v_c_sibling->type == XML_COMMENT_NODE);
    }
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":261
 *             (c_sibling.type == tree.XML_PI_NODE or \
 *                  c_sibling.type == tree.XML_COMMENT_NODE):
 *         if pretty_print:             # <<<<<<<<<<<<<< 
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 */
  __pyx_1 = __pyx_v_pretty_print;
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":262
 *                  c_sibling.type == tree.XML_COMMENT_NODE):
 *         if pretty_print:
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")             # <<<<<<<<<<<<<< 
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)
 */
    xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k578);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":264
 *             tree.xmlOutputBufferWriteString(c_buffer, "\n")
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)             # <<<<<<<<<<<<<< 
 *         c_sibling = c_sibling.next
 * 
 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_sibling,0,__pyx_v_pretty_print,__pyx_v_encoding);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":265
 *         tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_sibling, 0,
 *                                pretty_print, encoding)
 *         c_sibling = c_sibling.next             # <<<<<<<<<<<<<< 
 * 
 * # output to file-like objects
 */
  __pyx_v_c_sibling = __pyx_v_c_sibling->next;
}

__pyx_L0:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":273
 *     cdef _ExceptionContext _exc_context
 *     cdef _ErrorLog error_log
 *     def __init__(self, filelike, exc_context=None):             # <<<<<<<<<<<<<< 
 *         self._filelike = filelike
 *         if exc_context is None:
 */

static int __pyx_pf_4lxml_5etree_15_FilelikeWriter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_15_FilelikeWriter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_filelike = 0;
PyObject *__pyx_v_exc_context = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"filelike","exc_context",0};
__pyx_v_exc_context = __pyx_k215;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_filelike, &__pyx_v_exc_context))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filelike);
Py_INCREF(__pyx_v_exc_context);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":274
 *     cdef _ErrorLog error_log
 *     def __init__(self, filelike, exc_context=None):
 *         self._filelike = filelike             # <<<<<<<<<<<<<< 
 *         if exc_context is None:
 *             self._exc_context = _ExceptionContext()
 */
Py_INCREF(__pyx_v_filelike);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_filelike);
((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_filelike = __pyx_v_filelike;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":275
 *     def __init__(self, filelike, exc_context=None):
 *         self._filelike = filelike
 *         if exc_context is None:             # <<<<<<<<<<<<<< 
 *             self._exc_context = _ExceptionContext()
 *         else:
 */
__pyx_1 = (__pyx_v_exc_context == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":276
 *         self._filelike = filelike
 *         if exc_context is None:
 *             self._exc_context = _ExceptionContext()             # <<<<<<<<<<<<<< 
 *         else:
 *             self._exc_context = exc_context
 */
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 276; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 276; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":276
 *         self._filelike = filelike
 *         if exc_context is None:
 *             self._exc_context = _ExceptionContext()             # <<<<<<<<<<<<<< 
 *         else:
 *             self._exc_context = exc_context
 */
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
  ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":278
 *             self._exc_context = _ExceptionContext()
 *         else:
 *             self._exc_context = exc_context             # <<<<<<<<<<<<<< 
 *         self.error_log = _ErrorLog()
 * 
 */
  if (!__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_4lxml_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 278; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":278
 *             self._exc_context = _ExceptionContext()
 *         else:
 *             self._exc_context = exc_context             # <<<<<<<<<<<<<< 
 *         self.error_log = _ErrorLog()
 * 
 */
  Py_INCREF(__pyx_v_exc_context);
  Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
  ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":279
 *         else:
 *             self._exc_context = exc_context
 *         self.error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 *     cdef tree.xmlOutputBuffer* _createOutputBuffer(
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 279; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 279; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":279
 *         else:
 *             self._exc_context = exc_context
 *         self.error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 *     cdef tree.xmlOutputBuffer* _createOutputBuffer(
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->error_log));
((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_v_self)->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_2);
__pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._FilelikeWriter.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_filelike);
Py_DECREF(__pyx_v_exc_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":281
 *         self.error_log = _ErrorLog()
 * 
 *     cdef tree.xmlOutputBuffer* _createOutputBuffer(             # <<<<<<<<<<<<<< 
 *         self, tree.xmlCharEncodingHandler* enchandler) except NULL:
 *         cdef tree.xmlOutputBuffer* c_buffer
 */

static PyObject *__pyx_k579p;

static char __pyx_k579[] = "Could not create I/O writer context.";

static  xmlOutputBuffer *__pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer(struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_self,xmlCharEncodingHandler *__pyx_v_enchandler) {
xmlOutputBuffer *__pyx_v_c_buffer;
xmlOutputBuffer *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":286
 *         c_buffer = tree.xmlOutputBufferCreateIO(
 *             _writeFilelikeWriter, _closeFilelikeWriter,
 *             <python.PyObject*>self, enchandler)             # <<<<<<<<<<<<<< 
 *         if c_buffer is NULL:
 *             raise IOError, "Could not create I/O writer context."
 */
__pyx_v_c_buffer = xmlOutputBufferCreateIO(__pyx_f_4lxml_5etree__writeFilelikeWriter,__pyx_f_4lxml_5etree__closeFilelikeWriter,((PyObject *)__pyx_v_self),__pyx_v_enchandler);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":287
 *             _writeFilelikeWriter, _closeFilelikeWriter,
 *             <python.PyObject*>self, enchandler)
 *         if c_buffer is NULL:             # <<<<<<<<<<<<<< 
 *             raise IOError, "Could not create I/O writer context."
 *         return c_buffer
 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":288
 *             <python.PyObject*>self, enchandler)
 *         if c_buffer is NULL:
 *             raise IOError, "Could not create I/O writer context."             # <<<<<<<<<<<<<< 
 *         return c_buffer
 * 
 */
  __Pyx_Raise(__pyx_builtin_IOError, __pyx_k579p, 0);
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 288; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":289
 *         if c_buffer is NULL:
 *             raise IOError, "Could not create I/O writer context."
 *         return c_buffer             # <<<<<<<<<<<<<< 
 * 
 *     cdef int write(self, char* c_buffer, int size):
 */
__pyx_r = __pyx_v_c_buffer;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._FilelikeWriter._createOutputBuffer");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":291
 *         return c_buffer
 * 
 *     cdef int write(self, char* c_buffer, int size):             # <<<<<<<<<<<<<< 
 *         try:
 *             if self._filelike is None:
 */

static PyObject *__pyx_k580p;

static char __pyx_k580[] = "File is already closed";

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) {
PyObject *__pyx_v_py_buffer;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_py_buffer = Py_None; Py_INCREF(Py_None);
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":293
 *     cdef int write(self, char* c_buffer, int size):
 *         try:
 *             if self._filelike is None:             # <<<<<<<<<<<<<< 
 *                 raise IOError, "File is already closed"
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
 */
  __pyx_1 = (__pyx_v_self->_filelike == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":294
 *         try:
 *             if self._filelike is None:
 *                 raise IOError, "File is already closed"             # <<<<<<<<<<<<<< 
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
 *             self._filelike.write(py_buffer)
 */
    __Pyx_Raise(__pyx_builtin_IOError, __pyx_k580p, 0);
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 294; goto __pyx_L2;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":295
 *             if self._filelike is None:
 *                 raise IOError, "File is already closed"
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)             # <<<<<<<<<<<<<< 
 *             self._filelike.write(py_buffer)
 *             return size
 */
  __pyx_2 = PyString_FromStringAndSize(__pyx_v_c_buffer,__pyx_v_size); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 295; goto __pyx_L2;}
  Py_DECREF(__pyx_v_py_buffer);
  __pyx_v_py_buffer = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":296
 *                 raise IOError, "File is already closed"
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
 *             self._filelike.write(py_buffer)             # <<<<<<<<<<<<<< 
 *             return size
 *         except:
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_n_write); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 296; goto __pyx_L2;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":296
 *                 raise IOError, "File is already closed"
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
 *             self._filelike.write(py_buffer)             # <<<<<<<<<<<<<< 
 *             return size
 *         except:
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 296; goto __pyx_L2;}
  Py_INCREF(__pyx_v_py_buffer);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_py_buffer);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 296; goto __pyx_L2;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":297
 *             py_buffer = python.PyString_FromStringAndSize(c_buffer, size)
 *             self._filelike.write(py_buffer)
 *             return size             # <<<<<<<<<<<<<< 
 *         except:
 *             self._exc_context._store_raised()
 */
  __pyx_r = __pyx_v_size;
  goto __pyx_L0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":298
 *             self._filelike.write(py_buffer)
 *             return size
 *         except:             # <<<<<<<<<<<<<< 
 *             self._exc_context._store_raised()
 *             return -1
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree.write");
  if (__Pyx_GetException(&__pyx_2, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 298; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":299
 *             return size
 *         except:
 *             self._exc_context._store_raised()             # <<<<<<<<<<<<<< 
 *             return -1
 * 
 */
  ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":300
 *         except:
 *             self._exc_context._store_raised()
 *             return -1             # <<<<<<<<<<<<<< 
 * 
 *     cdef int close(self):
 */
  __pyx_r = -1;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._FilelikeWriter.write");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_py_buffer);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":302
 *             return -1
 * 
 *     cdef int close(self):             # <<<<<<<<<<<<<< 
 *         # we should not close the file here as we didn't open it
 *         self._filelike = None
 */

static  int __pyx_f_4lxml_5etree_15_FilelikeWriter_close(struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_self) {
int __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":304
 *     cdef int close(self):
 *         # we should not close the file here as we didn't open it
 *         self._filelike = None             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_filelike);
__pyx_v_self->_filelike = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":305
 *         # we should not close the file here as we didn't open it
 *         self._filelike = None
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":307
 *         return 0
 * 
 * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):             # <<<<<<<<<<<<<< 
 *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)
 * 
 */

static  int __pyx_f_4lxml_5etree__writeFilelikeWriter(void *__pyx_v_ctxt,char *__pyx_v_c_buffer,int __pyx_v_len) {
int __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":308
 * 
 * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):
 *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _closeFilelikeWriter(void* ctxt):
 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":308
 * 
 * cdef int _writeFilelikeWriter(void* ctxt, char* c_buffer, int len):
 *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _closeFilelikeWriter(void* ctxt):
 */
__pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_1)->__pyx_vtab)->write(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_1),__pyx_v_c_buffer,__pyx_v_len);
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":310
 *     return (<_FilelikeWriter>ctxt).write(c_buffer, len)
 * 
 * cdef int _closeFilelikeWriter(void* ctxt):             # <<<<<<<<<<<<<< 
 *     return (<_FilelikeWriter>ctxt).close()
 * 
 */

static  int __pyx_f_4lxml_5etree__closeFilelikeWriter(void *__pyx_v_ctxt) {
int __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":311
 * 
 * cdef int _closeFilelikeWriter(void* ctxt):
 *     return (<_FilelikeWriter>ctxt).close()             # <<<<<<<<<<<<<< 
 * 
 * cdef _tofilelike(f, _Element element, encoding, method,
 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":311
 * 
 * cdef int _closeFilelikeWriter(void* ctxt):
 *     return (<_FilelikeWriter>ctxt).close()             # <<<<<<<<<<<<<< 
 * 
 * cdef _tofilelike(f, _Element element, encoding, method,
 */
__pyx_r = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_1)->__pyx_vtab)->close(((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_1));
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":313
 *     return (<_FilelikeWriter>ctxt).close()
 * 
 * cdef _tofilelike(f, _Element element, encoding, method,             # <<<<<<<<<<<<<< 
 *                  bint write_xml_declaration, bint write_doctype,
 *                  bint pretty_print):
 */

static PyObject *__pyx_n_open;
static PyObject *__pyx_n_wb;

static PyObject *__pyx_k584p;

static PyObject *__pyx_builtin_open;

static char __pyx_k582[] = "unknown encoding: '%s'";
static char __pyx_k584[] = "File or filename expected, got '%s'";

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) {
PyThreadState *__pyx_v_state;
struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_writer;
xmlOutputBuffer *__pyx_v_c_buffer;
xmlCharEncodingHandler *__pyx_v_enchandler;
char *__pyx_v_c_enc;
PyObject *__pyx_v_c_method;
PyObject *__pyx_v_filename8;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
xmlOutputBuffer *__pyx_6;
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_method);
__pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)Py_None); Py_INCREF(Py_None);
__pyx_v_c_method = Py_None; Py_INCREF(Py_None);
__pyx_v_filename8 = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":321
 *     cdef tree.xmlCharEncodingHandler* enchandler
 *     cdef char* c_enc
 *     if encoding is None:             # <<<<<<<<<<<<<< 
 *         c_enc = NULL
 *     else:
 */
__pyx_1 = (__pyx_v_encoding == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":322
 *     cdef char* c_enc
 *     if encoding is None:
 *         c_enc = NULL             # <<<<<<<<<<<<<< 
 *     else:
 *         encoding = _utf8(encoding)
 */
  __pyx_v_c_enc = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":324
 *         c_enc = NULL
 *     else:
 *         encoding = _utf8(encoding)             # <<<<<<<<<<<<<< 
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_encoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 324; goto __pyx_L1;}
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":325
 *     else:
 *         encoding = _utf8(encoding)
 *         c_enc = _cstr(encoding)             # <<<<<<<<<<<<<< 
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 */
  __pyx_v_c_enc = _cstr(__pyx_v_encoding);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":326
 *         encoding = _utf8(encoding)
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)             # <<<<<<<<<<<<<< 
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         if _isString(f):
 */
__pyx_3 = __pyx_f_4lxml_5etree__findOutputMethod(__pyx_v_method); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 326; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 326; goto __pyx_L1;}
Py_DECREF(__pyx_v_c_method);
__pyx_v_c_method = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":327
 *         c_enc = _cstr(encoding)
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:             # <<<<<<<<<<<<<< 
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)
 */
__pyx_2 = PyInt_FromLong(__pyx_e_4lxml_5etree_OUTPUT_METHOD_TEXT); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 327; goto __pyx_L1;}
__pyx_4 = PyObject_RichCompare(__pyx_v_c_method, __pyx_2, Py_EQ); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 327; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 327; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":328
 *     c_method = _findOutputMethod(method)
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         if _isString(f):             # <<<<<<<<<<<<<< 
 *             filename8 = _encodeFilename(f)
 *             f = open(filename8, 'wb')
 */
  __pyx_3 = _isString(__pyx_v_f);
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":329
 *     if c_method == OUTPUT_METHOD_TEXT:
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<< 
 *             f = open(filename8, 'wb')
 *             f.write(_textToString(element._c_node, encoding))
 */
    __pyx_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 329; goto __pyx_L1;}
    Py_DECREF(__pyx_v_filename8);
    __pyx_v_filename8 = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":330
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)
 *             f = open(filename8, 'wb')             # <<<<<<<<<<<<<< 
 *             f.write(_textToString(element._c_node, encoding))
 *             f.close()
 */
    __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; goto __pyx_L1;}
    Py_INCREF(__pyx_v_filename8);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_filename8);
    Py_INCREF(__pyx_n_wb);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_n_wb);
    __pyx_2 = PyObject_CallObject(__pyx_builtin_open, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_f);
    __pyx_v_f = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":331
 *             filename8 = _encodeFilename(f)
 *             f = open(filename8, 'wb')
 *             f.write(_textToString(element._c_node, encoding))             # <<<<<<<<<<<<<< 
 *             f.close()
 *         else:
 */
    __pyx_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_write); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 331; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":331
 *             filename8 = _encodeFilename(f)
 *             f = open(filename8, 'wb')
 *             f.write(_textToString(element._c_node, encoding))             # <<<<<<<<<<<<<< 
 *             f.close()
 *         else:
 */
    __pyx_2 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node,__pyx_v_encoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 331; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 331; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 331; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":332
 *             f = open(filename8, 'wb')
 *             f.write(_textToString(element._c_node, encoding))
 *             f.close()             # <<<<<<<<<<<<<< 
 *         else:
 *             f.write(_textToString(element._c_node, encoding))
 */
    __pyx_4 = PyObject_GetAttr(__pyx_v_f, __pyx_n_close); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 332; goto __pyx_L1;}
    __pyx_5 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 332; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":334
 *             f.close()
 *         else:
 *             f.write(_textToString(element._c_node, encoding))             # <<<<<<<<<<<<<< 
 *         return
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_write); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 334; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":334
 *             f.close()
 *         else:
 *             f.write(_textToString(element._c_node, encoding))             # <<<<<<<<<<<<<< 
 *         return
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
 */
    __pyx_4 = __pyx_f_4lxml_5etree__textToString(__pyx_v_element->_c_node,__pyx_v_encoding); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 334; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 334; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
    __pyx_4 = 0;
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 334; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":335
 *         else:
 *             f.write(_textToString(element._c_node, encoding))
 *         return             # <<<<<<<<<<<<<< 
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
 *     if enchandler is NULL:
 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":336
 *             f.write(_textToString(element._c_node, encoding))
 *         return
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)             # <<<<<<<<<<<<<< 
 *     if enchandler is NULL:
 *         raise LookupError, python.PyString_FromFormat(
 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":337
 *         return
 *     enchandler = tree.xmlFindCharEncodingHandler(c_enc)
 *     if enchandler is NULL:             # <<<<<<<<<<<<<< 
 *         raise LookupError, python.PyString_FromFormat(
 *             "unknown encoding: '%s'", c_enc)
 */
__pyx_1 = (__pyx_v_enchandler == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":339
 *     if enchandler is NULL:
 *         raise LookupError, python.PyString_FromFormat(
 *             "unknown encoding: '%s'", c_enc)             # <<<<<<<<<<<<<< 
 * 
 *     if _isString(f):
 */
  __pyx_2 = PyString_FromFormat(__pyx_k582,__pyx_v_c_enc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 338; goto __pyx_L1;}
  __Pyx_Raise(__pyx_builtin_LookupError, __pyx_2, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 338; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":341
 *             "unknown encoding: '%s'", c_enc)
 * 
 *     if _isString(f):             # <<<<<<<<<<<<<< 
 *         filename8 = _encodeFilename(f)
 *         c_buffer = tree.xmlOutputBufferCreateFilename(
 */
__pyx_3 = _isString(__pyx_v_f);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":342
 * 
 *     if _isString(f):
 *         filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<< 
 *         c_buffer = tree.xmlOutputBufferCreateFilename(
 *             _cstr(filename8), enchandler, 0)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 342; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename8);
  __pyx_v_filename8 = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":344
 *         filename8 = _encodeFilename(f)
 *         c_buffer = tree.xmlOutputBufferCreateFilename(
 *             _cstr(filename8), enchandler, 0)             # <<<<<<<<<<<<<< 
 *         if c_buffer is NULL:
 *             python.PyErr_SetFromErrno(IOError)
 */
  __pyx_v_c_buffer = xmlOutputBufferCreateFilename(_cstr(__pyx_v_filename8),__pyx_v_enchandler,0);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":345
 *         c_buffer = tree.xmlOutputBufferCreateFilename(
 *             _cstr(filename8), enchandler, 0)
 *         if c_buffer is NULL:             # <<<<<<<<<<<<<< 
 *             python.PyErr_SetFromErrno(IOError)
 *         state = python.PyEval_SaveThread()
 */
  __pyx_1 = (__pyx_v_c_buffer == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":346
 *             _cstr(filename8), enchandler, 0)
 *         if c_buffer is NULL:
 *             python.PyErr_SetFromErrno(IOError)             # <<<<<<<<<<<<<< 
 *         state = python.PyEval_SaveThread()
 *     elif hasattr(f, 'write'):
 */
    __pyx_4 = PyErr_SetFromErrno(__pyx_builtin_IOError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 346; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":347
 *         if c_buffer is NULL:
 *             python.PyErr_SetFromErrno(IOError)
 *         state = python.PyEval_SaveThread()             # <<<<<<<<<<<<<< 
 *     elif hasattr(f, 'write'):
 *         writer   = _FilelikeWriter(f)
 */
  __pyx_v_state = PyEval_SaveThread();
  goto __pyx_L6;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":348
 *             python.PyErr_SetFromErrno(IOError)
 *         state = python.PyEval_SaveThread()
 *     elif hasattr(f, 'write'):             # <<<<<<<<<<<<<< 
 *         writer   = _FilelikeWriter(f)
 *         c_buffer = writer._createOutputBuffer(enchandler)
 */
__pyx_1 = PyObject_HasAttr(__pyx_v_f,__pyx_n_write); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 348; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":349
 *         state = python.PyEval_SaveThread()
 *     elif hasattr(f, 'write'):
 *         writer   = _FilelikeWriter(f)             # <<<<<<<<<<<<<< 
 *         c_buffer = writer._createOutputBuffer(enchandler)
 *     else:
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 349; goto __pyx_L1;}
  Py_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_f);
  __pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__FilelikeWriter), __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 349; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__FilelikeWriter)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 349; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_writer));
  __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_5);
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":350
 *     elif hasattr(f, 'write'):
 *         writer   = _FilelikeWriter(f)
 *         c_buffer = writer._createOutputBuffer(enchandler)             # <<<<<<<<<<<<<< 
 *     else:
 *         tree.xmlCharEncCloseFunc(enchandler)
 */
  __pyx_6 = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer,__pyx_v_enchandler); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 350; goto __pyx_L1;}
  __pyx_v_c_buffer = __pyx_6;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":352
 *         c_buffer = writer._createOutputBuffer(enchandler)
 *     else:
 *         tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<< 
 *         raise TypeError, "File or filename expected, got '%s'" % type(f)
 * 
 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":353
 *     else:
 *         tree.xmlCharEncCloseFunc(enchandler)
 *         raise TypeError, "File or filename expected, got '%s'" % type(f)             # <<<<<<<<<<<<<< 
 * 
 *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
 */
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 353; goto __pyx_L1;}
  Py_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_f);
  __pyx_2 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 353; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_5 = PyNumber_Remainder(__pyx_k584p, __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 353; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_5, 0);
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 353; goto __pyx_L1;}
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":355
 *         raise TypeError, "File or filename expected, got '%s'" % type(f)
 * 
 *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,             # <<<<<<<<<<<<<< 
 *                        write_xml_declaration, write_doctype, pretty_print)
 *     tree.xmlOutputBufferClose(c_buffer)
 */
__pyx_3 = PyInt_AsLong(__pyx_v_c_method); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 355; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":356
 * 
 *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
 *                        write_xml_declaration, write_doctype, pretty_print)             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferClose(c_buffer)
 *     tree.xmlCharEncCloseFunc(enchandler)
 */
__pyx_f_4lxml_5etree__writeNodeToBuffer(__pyx_v_c_buffer,__pyx_v_element->_c_node,__pyx_v_c_enc,__pyx_3,__pyx_v_write_xml_declaration,__pyx_v_write_doctype,__pyx_v_pretty_print);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":357
 *     _writeNodeToBuffer(c_buffer, element._c_node, c_enc, c_method,
 *                        write_xml_declaration, write_doctype, pretty_print)
 *     tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<< 
 *     tree.xmlCharEncCloseFunc(enchandler)
 *     if writer is None:
 */
xmlOutputBufferClose(__pyx_v_c_buffer);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":358
 *                        write_xml_declaration, write_doctype, pretty_print)
 *     tree.xmlOutputBufferClose(c_buffer)
 *     tree.xmlCharEncCloseFunc(enchandler)             # <<<<<<<<<<<<<< 
 *     if writer is None:
 *         python.PyEval_RestoreThread(state)
 */
xmlCharEncCloseFunc(__pyx_v_enchandler);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":359
 *     tree.xmlOutputBufferClose(c_buffer)
 *     tree.xmlCharEncCloseFunc(enchandler)
 *     if writer is None:             # <<<<<<<<<<<<<< 
 *         python.PyEval_RestoreThread(state)
 *     else:
 */
__pyx_1 = (((PyObject *)__pyx_v_writer) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":360
 *     tree.xmlCharEncCloseFunc(enchandler)
 *     if writer is None:
 *         python.PyEval_RestoreThread(state)             # <<<<<<<<<<<<<< 
 *     else:
 *         writer._exc_context._raise_if_stored()
 */
  PyEval_RestoreThread(__pyx_v_state);
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":362
 *         python.PyEval_RestoreThread(state)
 *     else:
 *         writer._exc_context._raise_if_stored()             # <<<<<<<<<<<<<< 
 * 
 * cdef _tofilelikeC14N(f, _Element element):
 */
  __pyx_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_3 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 362; goto __pyx_L1;}
}
__pyx_L8:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._tofilelike");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_writer);
Py_DECREF(__pyx_v_c_method);
Py_DECREF(__pyx_v_filename8);
Py_DECREF(__pyx_v_f);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_method);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":364
 *         writer._exc_context._raise_if_stored()
 * 
 * cdef _tofilelikeC14N(f, _Element element):             # <<<<<<<<<<<<<< 
 *     cdef _FilelikeWriter writer
 *     cdef tree.xmlOutputBuffer* c_buffer
 */

static PyObject *__pyx_n_message;

static PyObject *__pyx_k586p;
static PyObject *__pyx_k587p;

static char __pyx_k586[] = "File or filename expected, got '%s'";
static char __pyx_k587[] = "C14N failed";

static  PyObject *__pyx_f_4lxml_5etree__tofilelikeC14N(PyObject *__pyx_v_f,struct LxmlElement *__pyx_v_element) {
struct __pyx_obj_4lxml_5etree__FilelikeWriter *__pyx_v_writer;
xmlOutputBuffer *__pyx_v_c_buffer;
char *__pyx_v_c_filename;
xmlDoc *__pyx_v_c_base_doc;
xmlDoc *__pyx_v_c_doc;
int __pyx_v_bytes;
PyObject *__pyx_v_filename8;
PyObject *__pyx_v_message;
PyObject *__pyx_v_errors;
PyObject *__pyx_r;
xmlDoc *__pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
xmlOutputBuffer *__pyx_6;
Py_ssize_t __pyx_7;
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_element);
__pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename8 = Py_None; Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_errors = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":372
 *     cdef int bytes
 * 
 *     c_base_doc = element._c_node.doc             # <<<<<<<<<<<<<< 
 *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
 *     try:
 */
__pyx_v_c_base_doc = __pyx_v_element->_c_node->doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":373
 * 
 *     c_base_doc = element._c_node.doc
 *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)             # <<<<<<<<<<<<<< 
 *     try:
 *         if _isString(f):
 */
__pyx_1 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_c_base_doc,__pyx_v_element->_c_node); if (unlikely(__pyx_1 == NULL)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 373; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":374
 *     c_base_doc = element._c_node.doc
 *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
 *     try:             # <<<<<<<<<<<<<< 
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":375
 *     c_doc = _fakeRootDoc(c_base_doc, element._c_node)
 *     try:
 *         if _isString(f):             # <<<<<<<<<<<<<< 
 *             filename8 = _encodeFilename(f)
 *             c_filename = _cstr(filename8)
 */
  __pyx_2 = _isString(__pyx_v_f);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":376
 *     try:
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)             # <<<<<<<<<<<<<< 
 *             c_filename = _cstr(filename8)
 *             with nogil:
 */
    __pyx_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_f); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 376; goto __pyx_L3;}
    Py_DECREF(__pyx_v_filename8);
    __pyx_v_filename8 = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":377
 *         if _isString(f):
 *             filename8 = _encodeFilename(f)
 *             c_filename = _cstr(filename8)             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, 0, NULL, 1,
 */
    __pyx_v_c_filename = _cstr(__pyx_v_filename8);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":378
 *             filename8 = _encodeFilename(f)
 *             c_filename = _cstr(filename8)
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, 0, NULL, 1,
 *                                             c_filename, 0)
 */
    /*with nogil:*/ {
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":380
 *             with nogil:
 *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, 0, NULL, 1,
 *                                             c_filename, 0)             # <<<<<<<<<<<<<< 
 *         elif hasattr(f, 'write'):
 *             writer   = _FilelikeWriter(f)
 */
        __pyx_v_bytes = xmlC14NDocSave(__pyx_v_c_doc,NULL,0,NULL,1,__pyx_v_c_filename,0);
      }
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
    }
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":381
 *                 bytes = c14n.xmlC14NDocSave(c_doc, NULL, 0, NULL, 1,
 *                                             c_filename, 0)
 *         elif hasattr(f, 'write'):             # <<<<<<<<<<<<<< 
 *             writer   = _FilelikeWriter(f)
 *             c_buffer = writer._createOutputBuffer(NULL)
 */
  __pyx_4 = PyObject_HasAttr(__pyx_v_f,__pyx_n_write); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 381; goto __pyx_L3;}
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":382
 *                                             c_filename, 0)
 *         elif hasattr(f, 'write'):
 *             writer   = _FilelikeWriter(f)             # <<<<<<<<<<<<<< 
 *             c_buffer = writer._createOutputBuffer(NULL)
 *             writer.error_log.connect()
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 382; goto __pyx_L3;}
    Py_INCREF(__pyx_v_f);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_f);
    __pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__FilelikeWriter), __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 382; goto __pyx_L3;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__FilelikeWriter)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 382; goto __pyx_L3;}
    Py_DECREF(((PyObject *)__pyx_v_writer));
    __pyx_v_writer = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)__pyx_5);
    __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":383
 *         elif hasattr(f, 'write'):
 *             writer   = _FilelikeWriter(f)
 *             c_buffer = writer._createOutputBuffer(NULL)             # <<<<<<<<<<<<<< 
 *             writer.error_log.connect()
 *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, 0, NULL, 1, c_buffer)
 */
    __pyx_6 = ((struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer,NULL); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 383; goto __pyx_L3;}
    __pyx_v_c_buffer = __pyx_6;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":384
 *             writer   = _FilelikeWriter(f)
 *             c_buffer = writer._createOutputBuffer(NULL)
 *             writer.error_log.connect()             # <<<<<<<<<<<<<< 
 *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, 0, NULL, 1, c_buffer)
 *             writer.error_log.disconnect()
 */
    ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_writer->error_log);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":385
 *             c_buffer = writer._createOutputBuffer(NULL)
 *             writer.error_log.connect()
 *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, 0, NULL, 1, c_buffer)             # <<<<<<<<<<<<<< 
 *             writer.error_log.disconnect()
 *             tree.xmlOutputBufferClose(c_buffer)
 */
    __pyx_v_bytes = xmlC14NDocSaveTo(__pyx_v_c_doc,NULL,0,NULL,1,__pyx_v_c_buffer);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":386
 *             writer.error_log.connect()
 *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, 0, NULL, 1, c_buffer)
 *             writer.error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             tree.xmlOutputBufferClose(c_buffer)
 *         else:
 */
    ((struct __pyx_vtabstruct_4lxml_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_writer->error_log);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":387
 *             bytes = c14n.xmlC14NDocSaveTo(c_doc, NULL, 0, NULL, 1, c_buffer)
 *             writer.error_log.disconnect()
 *             tree.xmlOutputBufferClose(c_buffer)             # <<<<<<<<<<<<<< 
 *         else:
 *             raise TypeError, "File or filename expected, got '%s'" % type(f)
 */
    xmlOutputBufferClose(__pyx_v_c_buffer);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":389
 *             tree.xmlOutputBufferClose(c_buffer)
 *         else:
 *             raise TypeError, "File or filename expected, got '%s'" % type(f)             # <<<<<<<<<<<<<< 
 *     finally:
 *         _destroyFakeDoc(c_base_doc, c_doc)
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; goto __pyx_L3;}
    Py_INCREF(__pyx_v_f);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_f);
    __pyx_5 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_3); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; goto __pyx_L3;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = PyNumber_Remainder(__pyx_k586p, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; goto __pyx_L3;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_3, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; goto __pyx_L3;}
  }
  __pyx_L5:;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_5); __pyx_5 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":391
 *             raise TypeError, "File or filename expected, got '%s'" % type(f)
 *     finally:
 *         _destroyFakeDoc(c_base_doc, c_doc)             # <<<<<<<<<<<<<< 
 * 
 *     if writer is not None:
 */
  __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_c_base_doc,__pyx_v_c_doc);
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":393
 *         _destroyFakeDoc(c_base_doc, c_doc)
 * 
 *     if writer is not None:             # <<<<<<<<<<<<<< 
 *         writer._exc_context._raise_if_stored()
 * 
 */
__pyx_4 = (((PyObject *)__pyx_v_writer) != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":394
 * 
 *     if writer is not None:
 *         writer._exc_context._raise_if_stored()             # <<<<<<<<<<<<<< 
 * 
 *     if bytes < 0:
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 394; goto __pyx_L1;}
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":396
 *         writer._exc_context._raise_if_stored()
 * 
 *     if bytes < 0:             # <<<<<<<<<<<<<< 
 *         message = "C14N failed"
 *         if writer is not None:
 */
__pyx_4 = (__pyx_v_bytes < 0);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":397
 * 
 *     if bytes < 0:
 *         message = "C14N failed"             # <<<<<<<<<<<<<< 
 *         if writer is not None:
 *             errors = writer.error_log
 */
  Py_INCREF(__pyx_k587p);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_k587p;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":398
 *     if bytes < 0:
 *         message = "C14N failed"
 *         if writer is not None:             # <<<<<<<<<<<<<< 
 *             errors = writer.error_log
 *             if len(errors):
 */
  __pyx_4 = (((PyObject *)__pyx_v_writer) != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":399
 *         message = "C14N failed"
 *         if writer is not None:
 *             errors = writer.error_log             # <<<<<<<<<<<<<< 
 *             if len(errors):
 *                 message = errors[0].message
 */
    Py_INCREF(((PyObject *)__pyx_v_writer->error_log));
    Py_DECREF(__pyx_v_errors);
    __pyx_v_errors = ((PyObject *)__pyx_v_writer->error_log);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":400
 *         if writer is not None:
 *             errors = writer.error_log
 *             if len(errors):             # <<<<<<<<<<<<<< 
 *                 message = errors[0].message
 *         raise C14NError, message
 */
    __pyx_7 = PyObject_Length(__pyx_v_errors); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 400; goto __pyx_L1;}
    if (__pyx_7) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":401
 *             errors = writer.error_log
 *             if len(errors):
 *                 message = errors[0].message             # <<<<<<<<<<<<<< 
 *         raise C14NError, message
 * 
 */
      if (PyList_CheckExact(__pyx_v_errors) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_errors)) {
        __pyx_3 = PyList_GET_ITEM(__pyx_v_errors, 0); Py_INCREF(__pyx_3);
        } else if (PyTuple_CheckExact(__pyx_v_errors) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_errors)) {
        __pyx_3 = PyTuple_GET_ITEM(__pyx_v_errors, 0); Py_INCREF(__pyx_3);
        } else {
        __pyx_5 = PyInt_FromLong(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 401; goto __pyx_L1;}
        __pyx_3 = PyObject_GetItem(__pyx_v_errors, __pyx_5); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 401; goto __pyx_L1;}
        Py_DECREF(__pyx_5); __pyx_5 = 0;
      }
      __pyx_5 = PyObject_GetAttr(__pyx_3, __pyx_n_message); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 401; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_5;
      __pyx_5 = 0;
      goto __pyx_L13;
    }
    __pyx_L13:;
    goto __pyx_L12;
  }
  __pyx_L12:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":402
 *             if len(errors):
 *                 message = errors[0].message
 *         raise C14NError, message             # <<<<<<<<<<<<<< 
 * 
 * # dump node to file (mainly for debug)
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_C14NError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 402; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":402
 *             if len(errors):
 *                 message = errors[0].message
 *         raise C14NError, message             # <<<<<<<<<<<<<< 
 * 
 * # dump node to file (mainly for debug)
 */
  __Pyx_Raise(__pyx_3, __pyx_v_message, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 402; goto __pyx_L1;}
  goto __pyx_L11;
}
__pyx_L11:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._tofilelikeC14N");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_writer);
Py_DECREF(__pyx_v_filename8);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_errors);
Py_DECREF(__pyx_v_f);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":406
 * # dump node to file (mainly for debug)
 * 
 * cdef _dumpToFile(f, xmlNode* c_node, bint pretty_print):             # <<<<<<<<<<<<<< 
 *     cdef tree.xmlOutputBuffer* c_buffer
 *     if not python.PyFile_Check(f):
 */

static PyObject *__pyx_k588p;

static char __pyx_k588[] = "Not a file";
static char __pyx_k589[] = "\n";

static  PyObject *__pyx_f_4lxml_5etree__dumpToFile(PyObject *__pyx_v_f,xmlNode *__pyx_v_c_node,int __pyx_v_pretty_print) {
xmlOutputBuffer *__pyx_v_c_buffer;
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_f);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":408
 * cdef _dumpToFile(f, xmlNode* c_node, bint pretty_print):
 *     cdef tree.xmlOutputBuffer* c_buffer
 *     if not python.PyFile_Check(f):             # <<<<<<<<<<<<<< 
 *         raise ValueError, "Not a file"
 *     c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)
 */
__pyx_1 = (!PyFile_Check(__pyx_v_f));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":409
 *     cdef tree.xmlOutputBuffer* c_buffer
 *     if not python.PyFile_Check(f):
 *         raise ValueError, "Not a file"             # <<<<<<<<<<<<<< 
 *     c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)
 *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k588p, 0);
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 409; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":410
 *     if not python.PyFile_Check(f):
 *         raise ValueError, "Not a file"
 *     c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)             # <<<<<<<<<<<<<< 
 *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
 *     _writeTail(c_buffer, c_node, NULL, 0)
 */
__pyx_v_c_buffer = xmlOutputBufferCreateFile(PyFile_AsFile(__pyx_v_f),NULL);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":411
 *         raise ValueError, "Not a file"
 *     c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)
 *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)             # <<<<<<<<<<<<<< 
 *     _writeTail(c_buffer, c_node, NULL, 0)
 *     if not pretty_print:
 */
xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_node,0,__pyx_v_pretty_print,NULL);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":412
 *     c_buffer = tree.xmlOutputBufferCreateFile(python.PyFile_AsFile(f), NULL)
 *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
 *     _writeTail(c_buffer, c_node, NULL, 0)             # <<<<<<<<<<<<<< 
 *     if not pretty_print:
 *         # not written yet
 */
__pyx_f_4lxml_5etree__writeTail(__pyx_v_c_buffer,__pyx_v_c_node,NULL,0);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":413
 *     tree.xmlNodeDumpOutput(c_buffer, c_node.doc, c_node, 0, pretty_print, NULL)
 *     _writeTail(c_buffer, c_node, NULL, 0)
 *     if not pretty_print:             # <<<<<<<<<<<<<< 
 *         # not written yet
 *         tree.xmlOutputBufferWriteString(c_buffer, '\n')
 */
__pyx_1 = (!__pyx_v_pretty_print);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":415
 *     if not pretty_print:
 *         # not written yet
 *         tree.xmlOutputBufferWriteString(c_buffer, '\n')             # <<<<<<<<<<<<<< 
 *     tree.xmlOutputBufferFlush(c_buffer)
 */
  xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k589);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":416
 *         # not written yet
 *         tree.xmlOutputBufferWriteString(c_buffer, '\n')
 *     tree.xmlOutputBufferFlush(c_buffer)             # <<<<<<<<<<<<<< 
 */
xmlOutputBufferFlush(__pyx_v_c_buffer);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._dumpToFile");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_f);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":12
 *     ITERPARSE_FILTER_END_NS    = 8
 * 
 * cdef int _buildIterparseEventFilter(events):             # <<<<<<<<<<<<<< 
 *     cdef int event_filter
 *     event_filter = 0
 */

static PyObject *__pyx_k592p;
static PyObject *__pyx_k593p;

static char __pyx_k592[] = "start-ns";
static char __pyx_k593[] = "end-ns";

static  int __pyx_f_4lxml_5etree__buildIterparseEventFilter(PyObject *__pyx_v_events) {
int __pyx_v_event_filter;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_events);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":14
 * cdef int _buildIterparseEventFilter(events):
 *     cdef int event_filter
 *     event_filter = 0             # <<<<<<<<<<<<<< 
 *     if 'start' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START
 */
__pyx_v_event_filter = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":15
 *     cdef int event_filter
 *     event_filter = 0
 *     if 'start' in events:             # <<<<<<<<<<<<<< 
 *         event_filter = event_filter | ITERPARSE_FILTER_START
 *     if 'end' in events:
 */
__pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_n_start)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 15; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":16
 *     event_filter = 0
 *     if 'start' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START             # <<<<<<<<<<<<<< 
 *     if 'end' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END
 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":17
 *     if 'start' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START
 *     if 'end' in events:             # <<<<<<<<<<<<<< 
 *         event_filter = event_filter | ITERPARSE_FILTER_END
 *     if 'start-ns' in events:
 */
__pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_n_end)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 17; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":18
 *         event_filter = event_filter | ITERPARSE_FILTER_START
 *     if 'end' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END             # <<<<<<<<<<<<<< 
 *     if 'start-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START_NS
 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":19
 *     if 'end' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END
 *     if 'start-ns' in events:             # <<<<<<<<<<<<<< 
 *         event_filter = event_filter | ITERPARSE_FILTER_START_NS
 *     if 'end-ns' in events:
 */
__pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_k592p)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 19; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":20
 *         event_filter = event_filter | ITERPARSE_FILTER_END
 *     if 'start-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START_NS             # <<<<<<<<<<<<<< 
 *     if 'end-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END_NS
 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":21
 *     if 'start-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_START_NS
 *     if 'end-ns' in events:             # <<<<<<<<<<<<<< 
 *         event_filter = event_filter | ITERPARSE_FILTER_END_NS
 *     return event_filter
 */
__pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_k593p)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 21; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":22
 *         event_filter = event_filter | ITERPARSE_FILTER_START_NS
 *     if 'end-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END_NS             # <<<<<<<<<<<<<< 
 *     return event_filter
 * 
 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":23
 *     if 'end-ns' in events:
 *         event_filter = event_filter | ITERPARSE_FILTER_END_NS
 *     return event_filter             # <<<<<<<<<<<<<< 
 * 
 * cdef int _countNsDefs(xmlNode* c_node):
 */
__pyx_r = __pyx_v_event_filter;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree._buildIterparseEventFilter");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_events);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":25
 *     return event_filter
 * 
 * cdef int _countNsDefs(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef xmlNs* c_ns
 *     cdef int count
 */

static  int __pyx_f_4lxml_5etree__countNsDefs(xmlNode *__pyx_v_c_node) {
xmlNs *__pyx_v_c_ns;
int __pyx_v_count;
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":28
 *     cdef xmlNs* c_ns
 *     cdef int count
 *     count = 0             # <<<<<<<<<<<<<< 
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:
 */
__pyx_v_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":29
 *     cdef int count
 *     count = 0
 *     c_ns = c_node.nsDef             # <<<<<<<<<<<<<< 
 *     while c_ns is not NULL:
 *         count = count + 1
 */
__pyx_v_c_ns = __pyx_v_c_node->nsDef;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":30
 *     count = 0
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *         count = count + 1
 *         c_ns = c_ns.next
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":30
 *     count = 0
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *         count = count + 1
 *         c_ns = c_ns.next
 */
  __pyx_1 = (__pyx_v_c_ns != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":31
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:
 *         count = count + 1             # <<<<<<<<<<<<<< 
 *         c_ns = c_ns.next
 *     return count
 */
  __pyx_v_count = (__pyx_v_count + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":32
 *     while c_ns is not NULL:
 *         count = count + 1
 *         c_ns = c_ns.next             # <<<<<<<<<<<<<< 
 *     return count
 * 
 */
  __pyx_v_c_ns = __pyx_v_c_ns->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":33
 *         count = count + 1
 *         c_ns = c_ns.next
 *     return count             # <<<<<<<<<<<<<< 
 * 
 * cdef int _appendStartNsEvents(xmlNode* c_node, event_list):
 */
__pyx_r = __pyx_v_count;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":35
 *     return count
 * 
 * cdef int _appendStartNsEvents(xmlNode* c_node, event_list):             # <<<<<<<<<<<<<< 
 *     cdef xmlNs* c_ns
 *     cdef int count
 */

static PyObject *__pyx_k594p;
static PyObject *__pyx_k595p;

static char __pyx_k594[] = "";
static char __pyx_k595[] = "start-ns";

static  int __pyx_f_4lxml_5etree__appendStartNsEvents(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_event_list) {
xmlNs *__pyx_v_c_ns;
int __pyx_v_count;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_ns_tuple;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_event_list);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_tuple = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":38
 *     cdef xmlNs* c_ns
 *     cdef int count
 *     count = 0             # <<<<<<<<<<<<<< 
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:
 */
__pyx_v_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":39
 *     cdef int count
 *     count = 0
 *     c_ns = c_node.nsDef             # <<<<<<<<<<<<<< 
 *     while c_ns is not NULL:
 *         if c_ns.prefix is NULL:
 */
__pyx_v_c_ns = __pyx_v_c_node->nsDef;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":40
 *     count = 0
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_ns.prefix is NULL:
 *             prefix = ''
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":40
 *     count = 0
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:             # <<<<<<<<<<<<<< 
 *         if c_ns.prefix is NULL:
 *             prefix = ''
 */
  __pyx_1 = (__pyx_v_c_ns != NULL);
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":41
 *     c_ns = c_node.nsDef
 *     while c_ns is not NULL:
 *         if c_ns.prefix is NULL:             # <<<<<<<<<<<<<< 
 *             prefix = ''
 *         else:
 */
  __pyx_1 = (__pyx_v_c_ns->prefix == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":42
 *     while c_ns is not NULL:
 *         if c_ns.prefix is NULL:
 *             prefix = ''             # <<<<<<<<<<<<<< 
 *         else:
 *             prefix = funicode(c_ns.prefix)
 */
    Py_INCREF(__pyx_k594p);
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_k594p;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":44
 *             prefix = ''
 *         else:
 *             prefix = funicode(c_ns.prefix)             # <<<<<<<<<<<<<< 
 *         ns_tuple = (prefix, funicode(c_ns.href))
 *         python.PyList_Append(event_list, ("start-ns", ns_tuple))
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->prefix); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 44; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":45
 *         else:
 *             prefix = funicode(c_ns.prefix)
 *         ns_tuple = (prefix, funicode(c_ns.href))             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(event_list, ("start-ns", ns_tuple))
 *         count = count + 1
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_ns->href); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; goto __pyx_L1;}
  Py_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
  __pyx_2 = 0;
  Py_DECREF(__pyx_v_ns_tuple);
  __pyx_v_ns_tuple = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":46
 *             prefix = funicode(c_ns.prefix)
 *         ns_tuple = (prefix, funicode(c_ns.href))
 *         python.PyList_Append(event_list, ("start-ns", ns_tuple))             # <<<<<<<<<<<<<< 
 *         count = count + 1
 *         c_ns = c_ns.next
 */
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; goto __pyx_L1;}
  Py_INCREF(__pyx_k595p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k595p);
  Py_INCREF(__pyx_v_ns_tuple);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ns_tuple);
  __pyx_4 = PyList_Append(__pyx_v_event_list,__pyx_2); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 46; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":47
 *         ns_tuple = (prefix, funicode(c_ns.href))
 *         python.PyList_Append(event_list, ("start-ns", ns_tuple))
 *         count = count + 1             # <<<<<<<<<<<<<< 
 *         c_ns = c_ns.next
 *     return count
 */
  __pyx_v_count = (__pyx_v_count + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":48
 *         python.PyList_Append(event_list, ("start-ns", ns_tuple))
 *         count = count + 1
 *         c_ns = c_ns.next             # <<<<<<<<<<<<<< 
 *     return count
 * 
 */
  __pyx_v_c_ns = __pyx_v_c_ns->next;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":49
 *         count = count + 1
 *         c_ns = c_ns.next
 *     return count             # <<<<<<<<<<<<<< 
 * 
 * cdef class _IterparseContext(_ParserContext):
 */
__pyx_r = __pyx_v_count;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("lxml.etree._appendStartNsEvents");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_ns_tuple);
Py_DECREF(__pyx_v_event_list);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":69
 *     cdef char*  _tag_name
 * 
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         self._ns_stack = []
 *         self._pop_ns = self._ns_stack.pop
 */

static int __pyx_pf_4lxml_5etree_17_IterparseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17_IterparseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":70
 * 
 *     def __init__(self):
 *         self._ns_stack = []             # <<<<<<<<<<<<<< 
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 70; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":70
 * 
 *     def __init__(self):
 *         self._ns_stack = []             # <<<<<<<<<<<<<< 
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack);
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":71
 *     def __init__(self):
 *         self._ns_stack = []
 *         self._pop_ns = self._ns_stack.pop             # <<<<<<<<<<<<<< 
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_ns_stack, __pyx_n_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 71; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":71
 *     def __init__(self):
 *         self._ns_stack = []
 *         self._pop_ns = self._ns_stack.pop             # <<<<<<<<<<<<<< 
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_ns);
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_ns = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":72
 *         self._ns_stack = []
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []             # <<<<<<<<<<<<<< 
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 72; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":72
 *         self._ns_stack = []
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []             # <<<<<<<<<<<<<< 
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack);
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":73
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<< 
 *         self._events = []
 *         self._event_index = 0
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_node_stack, __pyx_n_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 73; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":73
 *         self._pop_ns = self._ns_stack.pop
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<< 
 *         self._events = []
 *         self._event_index = 0
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_node);
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_pop_node = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":74
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop
 *         self._events = []             # <<<<<<<<<<<<<< 
 *         self._event_index = 0
 * 
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 74; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":74
 *         self._node_stack = []
 *         self._pop_node = self._node_stack.pop
 *         self._events = []             # <<<<<<<<<<<<<< 
 *         self._event_index = 0
 * 
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_events);
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_events = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":75
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 *         self._event_index = 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):
 */
((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_v_self)->_event_index = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IterparseContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":77
 *         self._event_index = 0
 * 
 *     cdef void _initParserContext(self, xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *         "wrap original SAX2 callbacks"
 *         cdef xmlparser.xmlSAXHandler* sax
 */

static  void __pyx_f_4lxml_5etree_17_IterparseContext__initParserContext(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self,xmlParserCtxt *__pyx_v_c_ctxt) {
xmlSAXHandler *__pyx_v_sax;
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":80
 *         "wrap original SAX2 callbacks"
 *         cdef xmlparser.xmlSAXHandler* sax
 *         _ParserContext._initParserContext(self, c_ctxt)             # <<<<<<<<<<<<<< 
 *         sax = c_ctxt.sax
 *         self._origSaxStart = sax.startElementNs
 */
__pyx_vtabptr_4lxml_5etree__ParserContext->_initParserContext(((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_v_self),__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":81
 *         cdef xmlparser.xmlSAXHandler* sax
 *         _ParserContext._initParserContext(self, c_ctxt)
 *         sax = c_ctxt.sax             # <<<<<<<<<<<<<< 
 *         self._origSaxStart = sax.startElementNs
 *         self._origSaxStartNoNs = sax.startElement
 */
__pyx_v_sax = __pyx_v_c_ctxt->sax;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":82
 *         _ParserContext._initParserContext(self, c_ctxt)
 *         sax = c_ctxt.sax
 *         self._origSaxStart = sax.startElementNs             # <<<<<<<<<<<<<< 
 *         self._origSaxStartNoNs = sax.startElement
 *         # only override start event handler if needed
 */
__pyx_v_self->_origSaxStart = __pyx_v_sax->startElementNs;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":83
 *         sax = c_ctxt.sax
 *         self._origSaxStart = sax.startElementNs
 *         self._origSaxStartNoNs = sax.startElement             # <<<<<<<<<<<<<< 
 *         # only override start event handler if needed
 *         if self._event_filter == 0 or \
 */
__pyx_v_self->_origSaxStartNoNs = __pyx_v_sax->startElement;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":85
 *         self._origSaxStartNoNs = sax.startElement
 *         # only override start event handler if needed
 *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<< 
 *                self._event_filter & (ITERPARSE_FILTER_START | \
 *                                      ITERPARSE_FILTER_START_NS | \
 */
__pyx_1 = (__pyx_v_self->_event_filter == 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":88
 *                self._event_filter & (ITERPARSE_FILTER_START | \
 *                                      ITERPARSE_FILTER_START_NS | \
 *                                      ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<< 
 *             sax.startElementNs = _iterparseSaxStart
 *             sax.startElement = _iterparseSaxStartNoNs
 */
  __pyx_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));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":89
 *                                      ITERPARSE_FILTER_START_NS | \
 *                                      ITERPARSE_FILTER_END_NS):
 *             sax.startElementNs = _iterparseSaxStart             # <<<<<<<<<<<<<< 
 *             sax.startElement = _iterparseSaxStartNoNs
 * 
 */
  __pyx_v_sax->startElementNs = __pyx_f_4lxml_5etree__iterparseSaxStart;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":90
 *                                      ITERPARSE_FILTER_END_NS):
 *             sax.startElementNs = _iterparseSaxStart
 *             sax.startElement = _iterparseSaxStartNoNs             # <<<<<<<<<<<<<< 
 * 
 *         self._origSaxEnd = sax.endElementNs
 */
  __pyx_v_sax->startElement = __pyx_f_4lxml_5etree__iterparseSaxStartNoNs;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":92
 *             sax.startElement = _iterparseSaxStartNoNs
 * 
 *         self._origSaxEnd = sax.endElementNs             # <<<<<<<<<<<<<< 
 *         self._origSaxEndNoNs = sax.endElement
 *         # only override end event handler if needed
 */
__pyx_v_self->_origSaxEnd = __pyx_v_sax->endElementNs;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":93
 * 
 *         self._origSaxEnd = sax.endElementNs
 *         self._origSaxEndNoNs = sax.endElement             # <<<<<<<<<<<<<< 
 *         # only override end event handler if needed
 *         if self._event_filter == 0 or \
 */
__pyx_v_self->_origSaxEndNoNs = __pyx_v_sax->endElement;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":95
 *         self._origSaxEndNoNs = sax.endElement
 *         # only override end event handler if needed
 *         if self._event_filter == 0 or \             # <<<<<<<<<<<<<< 
 *                self._event_filter & (ITERPARSE_FILTER_END | \
 *                                      ITERPARSE_FILTER_END_NS):
 */
__pyx_1 = (__pyx_v_self->_event_filter == 0);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":97
 *         if self._event_filter == 0 or \
 *                self._event_filter & (ITERPARSE_FILTER_END | \
 *                                      ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<< 
 *             sax.endElementNs = _iterparseSaxEnd
 *             sax.endElement = _iterparseSaxEndNoNs
 */
  __pyx_1 = (__pyx_v_self->_event_filter & (__pyx_e_4lxml_5etree_ITERPARSE_FILTER_END | __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":98
 *                self._event_filter & (ITERPARSE_FILTER_END | \
 *                                      ITERPARSE_FILTER_END_NS):
 *             sax.endElementNs = _iterparseSaxEnd             # <<<<<<<<<<<<<< 
 *             sax.endElement = _iterparseSaxEndNoNs
 * 
 */
  __pyx_v_sax->endElementNs = __pyx_f_4lxml_5etree__iterparseSaxEnd;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":99
 *                                      ITERPARSE_FILTER_END_NS):
 *             sax.endElementNs = _iterparseSaxEnd
 *             sax.endElement = _iterparseSaxEndNoNs             # <<<<<<<<<<<<<< 
 * 
 *     cdef _setEventFilter(self, events, tag):
 */
  __pyx_v_sax->endElement = __pyx_f_4lxml_5etree__iterparseSaxEndNoNs;
  goto __pyx_L3;
}
__pyx_L3:;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":101
 *             sax.endElement = _iterparseSaxEndNoNs
 * 
 *     cdef _setEventFilter(self, events, tag):             # <<<<<<<<<<<<<< 
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         if tag is None or tag == '*':
 */

static PyObject *__pyx_k596p;
static PyObject *__pyx_k597p;
static PyObject *__pyx_k598p;

static char __pyx_k596[] = "*";
static char __pyx_k597[] = "*";
static char __pyx_k598[] = "*";

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) {
PyObject *__pyx_v_href;
PyObject *__pyx_v_name;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_events);
Py_INCREF(__pyx_v_tag);
__pyx_v_href = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":102
 * 
 *     cdef _setEventFilter(self, events, tag):
 *         self._event_filter = _buildIterparseEventFilter(events)             # <<<<<<<<<<<<<< 
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL
 */
__pyx_v_self->_event_filter = __pyx_f_4lxml_5etree__buildIterparseEventFilter(__pyx_v_events);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":103
 *     cdef _setEventFilter(self, events, tag):
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         if tag is None or tag == '*':             # <<<<<<<<<<<<<< 
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL
 */
__pyx_2 = (__pyx_v_tag == Py_None);
__pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
if (!__pyx_2) {
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":103
 *     cdef _setEventFilter(self, events, tag):
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         if tag is None or tag == '*':             # <<<<<<<<<<<<<< 
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL
 */
  __pyx_1 = PyObject_RichCompare(__pyx_v_tag, __pyx_k596p, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":104
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL             # <<<<<<<<<<<<<< 
 *             self._tag_name  = NULL
 *         else:
 */
  __pyx_v_self->_tag_href = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":105
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 */
  __pyx_v_self->_tag_name = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":107
 *             self._tag_name  = NULL
 *         else:
 *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 */
  __pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 107; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":107
 *             self._tag_name  = NULL
 *         else:
 *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 */
  Py_DECREF(__pyx_v_self->_tag_tuple);
  __pyx_v_self->_tag_tuple = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":108
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
  if (PyTuple_CheckExact(__pyx_v_self->_tag_tuple) && PyTuple_GET_SIZE(__pyx_v_self->_tag_tuple) == 2) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_tag_tuple, 0);
    Py_INCREF(__pyx_3);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":108
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_tag_tuple, 1);
    Py_INCREF(__pyx_3);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":108
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_3;
    __pyx_3 = 0;
  }
  else {
    __pyx_1 = PyObject_GetIter(__pyx_v_self->_tag_tuple); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}
    __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":108
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":108
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":109
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_href = NULL
 *             else:
 */
  __pyx_2 = (__pyx_v_href == Py_None);
  __pyx_3 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":109
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_href = NULL
 *             else:
 */
    __pyx_3 = PyObject_RichCompare(__pyx_v_href, __pyx_k597p, Py_EQ); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  }
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 109; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":110
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 *                 self._tag_href = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._tag_href = _cstr(href)
 */
    __pyx_v_self->_tag_href = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":112
 *                 self._tag_href = NULL
 *             else:
 *                 self._tag_href = _cstr(href)             # <<<<<<<<<<<<<< 
 *             if name is None or name == '*':
 *                 self._tag_name = NULL
 */
    __pyx_v_self->_tag_href = _cstr(__pyx_v_href);
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":113
 *             else:
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_name = NULL
 *             else:
 */
  __pyx_2 = (__pyx_v_name == Py_None);
  __pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":113
 *             else:
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_name = NULL
 *             else:
 */
    __pyx_1 = PyObject_RichCompare(__pyx_v_name, __pyx_k598p, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  }
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":114
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':
 *                 self._tag_name = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._tag_name = _cstr(name)
 */
    __pyx_v_self->_tag_name = NULL;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":116
 *                 self._tag_name = NULL
 *             else:
 *                 self._tag_name = _cstr(name)             # <<<<<<<<<<<<<< 
 *             if self._tag_href is NULL and self._tag_name is NULL:
 *                 self._tag_tuple = None
 */
    __pyx_v_self->_tag_name = _cstr(__pyx_v_name);
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":117
 *             else:
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<< 
 *                 self._tag_tuple = None
 * 
 */
  __pyx_2 = (__pyx_v_self->_tag_href == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":117
 *             else:
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<< 
 *                 self._tag_tuple = None
 * 
 */
    __pyx_2 = (__pyx_v_self->_tag_name == NULL);
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":118
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:
 *                 self._tag_tuple = None             # <<<<<<<<<<<<<< 
 * 
 *     cdef int startNode(self, xmlNode* c_node) except -1:
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_self->_tag_tuple);
    __pyx_v_self->_tag_tuple = Py_None;
    goto __pyx_L5;
  }
  __pyx_L5:;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._IterparseContext._setEventFilter");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_href);
Py_DECREF(__pyx_v_name);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_events);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":120
 *                 self._tag_tuple = None
 * 
 *     cdef int startNode(self, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<< 
 *         cdef xmlNs* c_ns
 *         cdef int ns_count
 */


static  int __pyx_f_4lxml_5etree_17_IterparseContext_startNode(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self,xmlNode *__pyx_v_c_node) {
int __pyx_v_ns_count;
PyObject *__pyx_v_node;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_node = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":123
 *         cdef xmlNs* c_ns
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:             # <<<<<<<<<<<<<< 
 *             ns_count = _appendStartNsEvents(c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":124
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:
 *             ns_count = _appendStartNsEvents(c_node, self._events)             # <<<<<<<<<<<<<< 
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = _countNsDefs(c_node)
 */
  __pyx_v_ns_count = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_c_node,__pyx_v_self->_events);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":125
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:
 *             ns_count = _appendStartNsEvents(c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *             ns_count = _countNsDefs(c_node)
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":126
 *             ns_count = _appendStartNsEvents(c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = _countNsDefs(c_node)             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             python.PyList_Append(self._ns_stack, ns_count)
 */
  __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_c_node);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":127
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = _countNsDefs(c_node)
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(self._ns_stack, ns_count)
 *         if self._doc is None:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":128
 *             ns_count = _countNsDefs(c_node)
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             python.PyList_Append(self._ns_stack, ns_count)             # <<<<<<<<<<<<<< 
 *         if self._doc is None:
 *             self._doc = _documentFactory(c_node.doc, None)
 */
  __pyx_2 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 128; goto __pyx_L1;}
  __pyx_1 = PyList_Append(__pyx_v_self->_ns_stack,__pyx_2); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 128; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":129
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             python.PyList_Append(self._ns_stack, ns_count)
 *         if self._doc is None:             # <<<<<<<<<<<<<< 
 *             self._doc = _documentFactory(c_node.doc, None)
 *             self._root = self._doc.getroot()
 */
__pyx_3 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":130
 *             python.PyList_Append(self._ns_stack, ns_count)
 *         if self._doc is None:
 *             self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<< 
 *             self._root = self._doc.getroot()
 *         if self._tag_tuple is None or \
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_node->doc,((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":130
 *             python.PyList_Append(self._ns_stack, ns_count)
 *         if self._doc is None:
 *             self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<< 
 *             self._root = self._doc.getroot()
 *         if self._tag_tuple is None or \
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_doc));
  __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":131
 *         if self._doc is None:
 *             self._doc = _documentFactory(c_node.doc, None)
 *             self._root = self._doc.getroot()             # <<<<<<<<<<<<<< 
 *         if self._tag_tuple is None or \
 *                _tagMatches(c_node, self._tag_href, self._tag_name):
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":131
 *         if self._doc is None:
 *             self._doc = _documentFactory(c_node.doc, None)
 *             self._root = self._doc.getroot()             # <<<<<<<<<<<<<< 
 *         if self._tag_tuple is None or \
 *                _tagMatches(c_node, self._tag_href, self._tag_name):
 */
  Py_DECREF(((PyObject *)__pyx_v_self->_root));
  __pyx_v_self->_root = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":132
 *             self._doc = _documentFactory(c_node.doc, None)
 *             self._root = self._doc.getroot()
 *         if self._tag_tuple is None or \             # <<<<<<<<<<<<<< 
 *                _tagMatches(c_node, self._tag_href, self._tag_name):
 *             node = _elementFactory(self._doc, c_node)
 */
__pyx_3 = (__pyx_v_self->_tag_tuple == Py_None);
if (!__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":133
 *             self._root = self._doc.getroot()
 *         if self._tag_tuple is None or \
 *                _tagMatches(c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<< 
 *             node = _elementFactory(self._doc, c_node)
 *             if self._event_filter & ITERPARSE_FILTER_END:
 */
  __pyx_3 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
}
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":134
 *         if self._tag_tuple is None or \
 *                _tagMatches(c_node, self._tag_href, self._tag_name):
 *             node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *             if self._event_filter & ITERPARSE_FILTER_END:
 *                 python.PyList_Append(self._node_stack, node)
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_v_node);
  __pyx_v_node = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":135
 *                _tagMatches(c_node, self._tag_href, self._tag_name):
 *             node = _elementFactory(self._doc, c_node)
 *             if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._node_stack, node)
 *             if self._event_filter & ITERPARSE_FILTER_START:
 */
  __pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":136
 *             node = _elementFactory(self._doc, c_node)
 *             if self._event_filter & ITERPARSE_FILTER_END:
 *                 python.PyList_Append(self._node_stack, node)             # <<<<<<<<<<<<<< 
 *             if self._event_filter & ITERPARSE_FILTER_START:
 *                 python.PyList_Append(self._events, ("start", node))
 */
    __pyx_1 = PyList_Append(__pyx_v_self->_node_stack,__pyx_v_node); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":137
 *             if self._event_filter & ITERPARSE_FILTER_END:
 *                 python.PyList_Append(self._node_stack, node)
 *             if self._event_filter & ITERPARSE_FILTER_START:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._events, ("start", node))
 *         return 0
 */
  __pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":138
 *                 python.PyList_Append(self._node_stack, node)
 *             if self._event_filter & ITERPARSE_FILTER_START:
 *                 python.PyList_Append(self._events, ("start", node))             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
    __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; goto __pyx_L1;}
    Py_INCREF(__pyx_n_start);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_start);
    Py_INCREF(__pyx_v_node);
    PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_node);
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_2); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 138; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":139
 *             if self._event_filter & ITERPARSE_FILTER_START:
 *                 python.PyList_Append(self._events, ("start", node))
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef int endNode(self, xmlNode* c_node) except -1:
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IterparseContext.startNode");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":141
 *         return 0
 * 
 *     cdef int endNode(self, xmlNode* c_node) except -1:             # <<<<<<<<<<<<<< 
 *         cdef xmlNs* c_ns
 *         cdef int ns_count
 */

static PyObject *__pyx_k601p;

static char __pyx_k601[] = "end-ns";

static  int __pyx_f_4lxml_5etree_17_IterparseContext_endNode(struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_self,xmlNode *__pyx_v_c_node) {
int __pyx_v_ns_count;
PyObject *__pyx_v_node;
PyObject *__pyx_v_event;
PyObject *__pyx_v_i;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
long __pyx_4;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_node = Py_None; Py_INCREF(Py_None);
__pyx_v_event = Py_None; Py_INCREF(Py_None);
__pyx_v_i = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":144
 *         cdef xmlNs* c_ns
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<< 
 *             if self._tag_tuple is None or \
 *                    _tagMatches(c_node, self._tag_href, self._tag_name):
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":145
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<< 
 *                    _tagMatches(c_node, self._tag_href, self._tag_name):
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 */
  __pyx_2 = (__pyx_v_self->_tag_tuple == Py_None);
  if (!__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":146
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 *                    _tagMatches(c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<< 
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 *                                          ITERPARSE_FILTER_START_NS | \
 */
    __pyx_2 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":149
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 *                                          ITERPARSE_FILTER_START_NS | \
 *                                          ITERPARSE_FILTER_END_NS):             # <<<<<<<<<<<<<< 
 *                     node = self._pop_node()
 *                 else:
 */
    __pyx_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));
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":150
 *                                          ITERPARSE_FILTER_START_NS | \
 *                                          ITERPARSE_FILTER_END_NS):
 *                     node = self._pop_node()             # <<<<<<<<<<<<<< 
 *                 else:
 *                     if self._doc is None:
 */
      __pyx_3 = PyObject_CallObject(__pyx_v_self->_pop_node, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 150; goto __pyx_L1;}
      Py_DECREF(__pyx_v_node);
      __pyx_v_node = __pyx_3;
      __pyx_3 = 0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":152
 *                     node = self._pop_node()
 *                 else:
 *                     if self._doc is None:             # <<<<<<<<<<<<<< 
 *                         self._doc = _documentFactory(c_node.doc, None)
 *                         self._root = self._doc.getroot()
 */
      __pyx_2 = (((PyObject *)__pyx_v_self->_doc) == Py_None);
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":153
 *                 else:
 *                     if self._doc is None:
 *                         self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<< 
 *                         self._root = self._doc.getroot()
 *                     node = _elementFactory(self._doc, c_node)
 */
        __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_node->doc,((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None))); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 153; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":153
 *                 else:
 *                     if self._doc is None:
 *                         self._doc = _documentFactory(c_node.doc, None)             # <<<<<<<<<<<<<< 
 *                         self._root = self._doc.getroot()
 *                     node = _elementFactory(self._doc, c_node)
 */
        Py_DECREF(((PyObject *)__pyx_v_self->_doc));
        __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_3);
        __pyx_3 = 0;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":154
 *                     if self._doc is None:
 *                         self._doc = _documentFactory(c_node.doc, None)
 *                         self._root = self._doc.getroot()             # <<<<<<<<<<<<<< 
 *                     node = _elementFactory(self._doc, c_node)
 *                 python.PyList_Append(self._events, ("end", node))
 */
        __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}
        if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":154
 *                     if self._doc is None:
 *                         self._doc = _documentFactory(c_node.doc, None)
 *                         self._root = self._doc.getroot()             # <<<<<<<<<<<<<< 
 *                     node = _elementFactory(self._doc, c_node)
 *                 python.PyList_Append(self._events, ("end", node))
 */
        Py_DECREF(((PyObject *)__pyx_v_self->_root));
        __pyx_v_self->_root = ((struct LxmlElement *)__pyx_3);
        __pyx_3 = 0;
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":155
 *                         self._doc = _documentFactory(c_node.doc, None)
 *                         self._root = self._doc.getroot()
 *                     node = _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._events, ("end", node))
 * 
 */
      __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_self->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 155; goto __pyx_L1;}
      Py_DECREF(__pyx_v_node);
      __pyx_v_node = __pyx_3;
      __pyx_3 = 0;
    }
    __pyx_L4:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":156
 *                         self._root = self._doc.getroot()
 *                     node = _elementFactory(self._doc, c_node)
 *                 python.PyList_Append(self._events, ("end", node))             # <<<<<<<<<<<<<< 
 * 
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 */
    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 156; goto __pyx_L1;}
    Py_INCREF(__pyx_n_end);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_end);
    Py_INCREF(__pyx_v_node);
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_node);
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_3); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 156; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":158
 *                 python.PyList_Append(self._events, ("end", node))
 * 
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *             ns_count = self._pop_ns()
 *             if ns_count > 0:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":159
 * 
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = self._pop_ns()             # <<<<<<<<<<<<<< 
 *             if ns_count > 0:
 *                 event = ("end-ns", None)
 */
  __pyx_3 = PyObject_CallObject(__pyx_v_self->_pop_ns, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 159; goto __pyx_L1;}
  __pyx_1 = PyInt_AsLong(__pyx_3); if (unlikely((__pyx_1 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 159; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_ns_count = __pyx_1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":160
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = self._pop_ns()
 *             if ns_count > 0:             # <<<<<<<<<<<<<< 
 *                 event = ("end-ns", None)
 *                 for i from 0 <= i < ns_count:
 */
  __pyx_2 = (__pyx_v_ns_count > 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":161
 *             ns_count = self._pop_ns()
 *             if ns_count > 0:
 *                 event = ("end-ns", None)             # <<<<<<<<<<<<<< 
 *                 for i from 0 <= i < ns_count:
 *                     python.PyList_Append(self._events, event)
 */
    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 161; goto __pyx_L1;}
    Py_INCREF(__pyx_k601p);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k601p);
    Py_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_3, 1, Py_None);
    Py_DECREF(__pyx_v_event);
    __pyx_v_event = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":162
 *             if ns_count > 0:
 *                 event = ("end-ns", None)
 *                 for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<< 
 *                     python.PyList_Append(self._events, event)
 *         return 0
 */
    for (__pyx_4 = 0; __pyx_4 < __pyx_v_ns_count; __pyx_4++) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":162
 *             if ns_count > 0:
 *                 event = ("end-ns", None)
 *                 for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<< 
 *                     python.PyList_Append(self._events, event)
 *         return 0
 */
      __pyx_3 = PyInt_FromLong(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 162; goto __pyx_L1;}
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_3;
      __pyx_3 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":163
 *                 event = ("end-ns", None)
 *                 for i from 0 <= i < ns_count:
 *                     python.PyList_Append(self._events, event)             # <<<<<<<<<<<<<< 
 *         return 0
 *                 
 */
      __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_v_event); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; goto __pyx_L1;}
    }
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":164
 *                 for i from 0 <= i < ns_count:
 *                     python.PyList_Append(self._events, event)
 *         return 0             # <<<<<<<<<<<<<< 
 *                 
 * 
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._IterparseContext.endNode");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_event);
Py_DECREF(__pyx_v_i);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":167
 *                 
 * 
 * cdef void _pushSaxStartEvent(xmlparser.xmlParserCtxt* c_ctxt, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private
 */

static  void __pyx_f_4lxml_5etree__pushSaxStartEvent(xmlParserCtxt *__pyx_v_c_ctxt,xmlNode *__pyx_v_c_node) {
struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":169
 * cdef void _pushSaxStartEvent(xmlparser.xmlParserCtxt* c_ctxt, xmlNode* c_node):
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     try:
 *         context.startNode(c_node)
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":170
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private
 *     try:             # <<<<<<<<<<<<<< 
 *         context.startNode(c_node)
 *     except:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":171
 *     context = <_IterparseContext>c_ctxt._private
 *     try:
 *         context.startNode(c_node)             # <<<<<<<<<<<<<< 
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 */
  __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 171; goto __pyx_L2;}
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":172
 *     try:
 *         context.startNode(c_node)
 *     except:             # <<<<<<<<<<<<<< 
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._pushSaxStartEvent");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 172; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":173
 *         context.startNode(c_node)
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<< 
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1
 */
  __pyx_5 = (__pyx_v_c_ctxt->errNo == XML_ERR_OK);
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":174
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<< 
 *         c_ctxt.disableSAX = 1
 *         context._store_raised()
 */
    __pyx_v_c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":175
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<< 
 *         context._store_raised()
 * 
 */
  __pyx_v_c_ctxt->disableSAX = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":176
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1
 *         context._store_raised()             # <<<<<<<<<<<<<< 
 * 
 * cdef void _pushSaxEndEvent(xmlparser.xmlParserCtxt* c_ctxt, xmlNode* c_node):
 */
  ((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));
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._pushSaxStartEvent");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":178
 *         context._store_raised()
 * 
 * cdef void _pushSaxEndEvent(xmlparser.xmlParserCtxt* c_ctxt, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private
 */

static  void __pyx_f_4lxml_5etree__pushSaxEndEvent(xmlParserCtxt *__pyx_v_c_ctxt,xmlNode *__pyx_v_c_node) {
struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":180
 * cdef void _pushSaxEndEvent(xmlparser.xmlParserCtxt* c_ctxt, xmlNode* c_node):
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private             # <<<<<<<<<<<<<< 
 *     try:
 *         context.endNode(c_node)
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":181
 *     cdef _IterparseContext context
 *     context = <_IterparseContext>c_ctxt._private
 *     try:             # <<<<<<<<<<<<<< 
 *         context.endNode(c_node)
 *     except:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":182
 *     context = <_IterparseContext>c_ctxt._private
 *     try:
 *         context.endNode(c_node)             # <<<<<<<<<<<<<< 
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 */
  __pyx_2 = ((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_2 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 182; goto __pyx_L2;}
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":183
 *     try:
 *         context.endNode(c_node)
 *     except:             # <<<<<<<<<<<<<< 
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._pushSaxEndEvent");
  if (__Pyx_GetException(&__pyx_1, &__pyx_3, &__pyx_4) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 183; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":184
 *         context.endNode(c_node)
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:             # <<<<<<<<<<<<<< 
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1
 */
  __pyx_5 = (__pyx_v_c_ctxt->errNo == XML_ERR_OK);
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":185
 *     except:
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR             # <<<<<<<<<<<<<< 
 *         c_ctxt.disableSAX = 1
 *         context._store_raised()
 */
    __pyx_v_c_ctxt->errNo = XML_ERR_INTERNAL_ERROR;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":186
 *         if c_ctxt.errNo == xmlerror.XML_ERR_OK:
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1             # <<<<<<<<<<<<<< 
 *         context._store_raised()
 * 
 */
  __pyx_v_c_ctxt->disableSAX = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":187
 *             c_ctxt.errNo = xmlerror.XML_ERR_INTERNAL_ERROR
 *         c_ctxt.disableSAX = 1
 *         context._store_raised()             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.startElementNsSAX2Func _getOrigStart(xmlparser.xmlParserCtxt* c_ctxt):
 */
  ((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));
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._pushSaxEndEvent");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":189
 *         context._store_raised()
 * 
 * cdef xmlparser.startElementNsSAX2Func _getOrigStart(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStart
 * 
 */

static  startElementNsSAX2Func __pyx_f_4lxml_5etree__getOrigStart(xmlParserCtxt *__pyx_v_c_ctxt) {
startElementNsSAX2Func __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":190
 * 
 * cdef xmlparser.startElementNsSAX2Func _getOrigStart(xmlparser.xmlParserCtxt* c_ctxt):
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStart             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.startElementSAXFunc _getOrigStartNoNs(xmlparser.xmlParserCtxt* c_ctxt):
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1)->_origSaxStart;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":192
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStart
 * 
 * cdef xmlparser.startElementSAXFunc _getOrigStartNoNs(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStartNoNs
 * 
 */

static  startElementSAXFunc __pyx_f_4lxml_5etree__getOrigStartNoNs(xmlParserCtxt *__pyx_v_c_ctxt) {
startElementSAXFunc __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":193
 * 
 * cdef xmlparser.startElementSAXFunc _getOrigStartNoNs(xmlparser.xmlParserCtxt* c_ctxt):
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStartNoNs             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.endElementNsSAX2Func _getOrigEnd(xmlparser.xmlParserCtxt* c_ctxt):
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1)->_origSaxStartNoNs;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":195
 *     return (<_IterparseContext>c_ctxt._private)._origSaxStartNoNs
 * 
 * cdef xmlparser.endElementNsSAX2Func _getOrigEnd(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEnd
 * 
 */

static  endElementNsSAX2Func __pyx_f_4lxml_5etree__getOrigEnd(xmlParserCtxt *__pyx_v_c_ctxt) {
endElementNsSAX2Func __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":196
 * 
 * cdef xmlparser.endElementNsSAX2Func _getOrigEnd(xmlparser.xmlParserCtxt* c_ctxt):
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEnd             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlparser.endElementSAXFunc _getOrigEndNoNs(xmlparser.xmlParserCtxt* c_ctxt):
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1)->_origSaxEnd;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":198
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEnd
 * 
 * cdef xmlparser.endElementSAXFunc _getOrigEndNoNs(xmlparser.xmlParserCtxt* c_ctxt):             # <<<<<<<<<<<<<< 
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEndNoNs
 * 
 */

static  endElementSAXFunc __pyx_f_4lxml_5etree__getOrigEndNoNs(xmlParserCtxt *__pyx_v_c_ctxt) {
endElementSAXFunc __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":199
 * 
 * cdef xmlparser.endElementSAXFunc _getOrigEndNoNs(xmlparser.xmlParserCtxt* c_ctxt):
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEndNoNs             # <<<<<<<<<<<<<< 
 * 
 * cdef void _iterparseSaxStart(void* ctxt, char* localname, char* prefix,
 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_1)->_origSaxEndNoNs;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":201
 *     return (<_IterparseContext>c_ctxt._private)._origSaxEndNoNs
 * 
 * cdef void _iterparseSaxStart(void* ctxt, char* localname, char* prefix,             # <<<<<<<<<<<<<< 
 *                              char* URI, int nb_namespaces, char** namespaces,
 *                              int nb_attributes, int nb_defaulted,
 */

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) {
xmlParserCtxt *__pyx_v_c_ctxt;
startElementNsSAX2Func __pyx_v_origStart;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":208
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     cdef xmlparser.startElementNsSAX2Func origStart
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     origStart = _getOrigStart(c_ctxt)
 *     origStart(ctxt, localname, prefix, URI, nb_namespaces, namespaces,
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":209
 *     cdef xmlparser.startElementNsSAX2Func origStart
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     origStart = _getOrigStart(c_ctxt)             # <<<<<<<<<<<<<< 
 *     origStart(ctxt, localname, prefix, URI, nb_namespaces, namespaces,
 *               nb_attributes, nb_defaulted, attributes)
 */
__pyx_v_origStart = __pyx_f_4lxml_5etree__getOrigStart(__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":211
 *     origStart = _getOrigStart(c_ctxt)
 *     origStart(ctxt, localname, prefix, URI, nb_namespaces, namespaces,
 *               nb_attributes, nb_defaulted, attributes)             # <<<<<<<<<<<<<< 
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)
 * 
 */
__pyx_v_origStart(__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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":212
 *     origStart(ctxt, localname, prefix, URI, nb_namespaces, namespaces,
 *               nb_attributes, nb_defaulted, attributes)
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _iterparseSaxEnd(void* ctxt, char* localname, char* prefix, char* URI):
 */
__pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":214
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)
 * 
 * cdef void _iterparseSaxEnd(void* ctxt, char* localname, char* prefix, char* URI):             # <<<<<<<<<<<<<< 
 *     # no Python in here!
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__iterparseSaxEnd(void *__pyx_v_ctxt,char *__pyx_v_localname,char *__pyx_v_prefix,char *__pyx_v_URI) {
xmlParserCtxt *__pyx_v_c_ctxt;
endElementNsSAX2Func __pyx_v_origEnd;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":218
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     cdef xmlparser.endElementNsSAX2Func origEnd
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEnd(c_ctxt)
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":219
 *     cdef xmlparser.endElementNsSAX2Func origEnd
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)             # <<<<<<<<<<<<<< 
 *     origEnd = _getOrigEnd(c_ctxt)
 *     origEnd(ctxt, localname, prefix, URI)
 */
__pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":220
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEnd(c_ctxt)             # <<<<<<<<<<<<<< 
 *     origEnd(ctxt, localname, prefix, URI)
 * 
 */
__pyx_v_origEnd = __pyx_f_4lxml_5etree__getOrigEnd(__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":221
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEnd(c_ctxt)
 *     origEnd(ctxt, localname, prefix, URI)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _iterparseSaxStartNoNs(void* ctxt, char* name, char** attributes):
 */
__pyx_v_origEnd(__pyx_v_ctxt,__pyx_v_localname,__pyx_v_prefix,__pyx_v_URI);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":223
 *     origEnd(ctxt, localname, prefix, URI)
 * 
 * cdef void _iterparseSaxStartNoNs(void* ctxt, char* name, char** attributes):             # <<<<<<<<<<<<<< 
 *     # no Python in here!
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__iterparseSaxStartNoNs(void *__pyx_v_ctxt,char *__pyx_v_name,char **__pyx_v_attributes) {
xmlParserCtxt *__pyx_v_c_ctxt;
startElementSAXFunc __pyx_v_origStart;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":227
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     cdef xmlparser.startElementSAXFunc origStart
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     origStart = _getOrigStartNoNs(c_ctxt)
 *     origStart(ctxt, name, attributes)
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":228
 *     cdef xmlparser.startElementSAXFunc origStart
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     origStart = _getOrigStartNoNs(c_ctxt)             # <<<<<<<<<<<<<< 
 *     origStart(ctxt, name, attributes)
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)
 */
__pyx_v_origStart = __pyx_f_4lxml_5etree__getOrigStartNoNs(__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":229
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     origStart = _getOrigStartNoNs(c_ctxt)
 *     origStart(ctxt, name, attributes)             # <<<<<<<<<<<<<< 
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)
 * 
 */
__pyx_v_origStart(__pyx_v_ctxt,__pyx_v_name,__pyx_v_attributes);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":230
 *     origStart = _getOrigStartNoNs(c_ctxt)
 *     origStart(ctxt, name, attributes)
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _iterparseSaxEndNoNs(void* ctxt, char* name):
 */
__pyx_f_4lxml_5etree__pushSaxStartEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":232
 *     _pushSaxStartEvent(c_ctxt, c_ctxt.node)
 * 
 * cdef void _iterparseSaxEndNoNs(void* ctxt, char* name):             # <<<<<<<<<<<<<< 
 *     # no Python in here!
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 */

static  void __pyx_f_4lxml_5etree__iterparseSaxEndNoNs(void *__pyx_v_ctxt,char *__pyx_v_name) {
xmlParserCtxt *__pyx_v_c_ctxt;
endElementSAXFunc __pyx_v_origEnd;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":236
 *     cdef xmlparser.xmlParserCtxt* c_ctxt
 *     cdef xmlparser.endElementSAXFunc origEnd
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt             # <<<<<<<<<<<<<< 
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEndNoNs(c_ctxt)
 */
__pyx_v_c_ctxt = ((xmlParserCtxt *)__pyx_v_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":237
 *     cdef xmlparser.endElementSAXFunc origEnd
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)             # <<<<<<<<<<<<<< 
 *     origEnd = _getOrigEndNoNs(c_ctxt)
 *     origEnd(ctxt, name)
 */
__pyx_f_4lxml_5etree__pushSaxEndEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":238
 *     c_ctxt = <xmlparser.xmlParserCtxt*>ctxt
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEndNoNs(c_ctxt)             # <<<<<<<<<<<<<< 
 *     origEnd(ctxt, name)
 * 
 */
__pyx_v_origEnd = __pyx_f_4lxml_5etree__getOrigEndNoNs(__pyx_v_c_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":239
 *     _pushSaxEndEvent(c_ctxt, c_ctxt.node)
 *     origEnd = _getOrigEndNoNs(c_ctxt)
 *     origEnd(ctxt, name)             # <<<<<<<<<<<<<< 
 * 
 * cdef class iterparse(_BaseParser):
 */
__pyx_v_origEnd(__pyx_v_ctxt,__pyx_v_name);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":278
 *     cdef object _source
 *     cdef readonly object root
 *     def __init__(self, source, events=("end",), tag=None,             # <<<<<<<<<<<<<< 
 *                  attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, remove_blank_text=False,
 */

static PyObject *__pyx_n_rb;


static int __pyx_pf_4lxml_5etree_9iterparse___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_9iterparse___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
PyObject *__pyx_v_events = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_v_attribute_defaults = 0;
PyObject *__pyx_v_dtd_validation = 0;
PyObject *__pyx_v_load_dtd = 0;
PyObject *__pyx_v_no_network = 0;
PyObject *__pyx_v_remove_blank_text = 0;
PyObject *__pyx_v_remove_comments = 0;
PyObject *__pyx_v_remove_pis = 0;
PyObject *__pyx_v_encoding = 0;
PyObject *__pyx_v_html = 0;
struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
int __pyx_v_parse_options;
PyObject *__pyx_v_filename;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
static char *__pyx_argnames[] = {"source","events","tag","attribute_defaults","dtd_validation","load_dtd","no_network","remove_blank_text","remove_comments","remove_pis","encoding","html",0};
__pyx_v_events = __pyx_k217;
__pyx_v_tag = __pyx_k218;
__pyx_v_attribute_defaults = __pyx_k219;
__pyx_v_dtd_validation = __pyx_k220;
__pyx_v_load_dtd = __pyx_k221;
__pyx_v_no_network = __pyx_k222;
__pyx_v_remove_blank_text = __pyx_k223;
__pyx_v_remove_comments = __pyx_k224;
__pyx_v_remove_pis = __pyx_k225;
__pyx_v_encoding = __pyx_k226;
__pyx_v_html = __pyx_k227;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOOOOOOOOOO", __pyx_argnames, &__pyx_v_source, &__pyx_v_events, &__pyx_v_tag, &__pyx_v_attribute_defaults, &__pyx_v_dtd_validation, &__pyx_v_load_dtd, &__pyx_v_no_network, &__pyx_v_remove_blank_text, &__pyx_v_remove_comments, &__pyx_v_remove_pis, &__pyx_v_encoding, &__pyx_v_html))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_events);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_attribute_defaults);
Py_INCREF(__pyx_v_dtd_validation);
Py_INCREF(__pyx_v_load_dtd);
Py_INCREF(__pyx_v_no_network);
Py_INCREF(__pyx_v_remove_blank_text);
Py_INCREF(__pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_html);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":286
 *         cdef char* c_encoding
 *         cdef int parse_options
 *         if not hasattr(source, 'read'):             # <<<<<<<<<<<<<< 
 *             filename = _encodeFilename(source)
 *             source = open(filename, 'rb')
 */
__pyx_1 = PyObject_HasAttr(__pyx_v_source,__pyx_n_read); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 286; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":287
 *         cdef int parse_options
 *         if not hasattr(source, 'read'):
 *             filename = _encodeFilename(source)             # <<<<<<<<<<<<<< 
 *             source = open(filename, 'rb')
 *         else:
 */
  __pyx_3 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_source); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 287; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":288
 *         if not hasattr(source, 'read'):
 *             filename = _encodeFilename(source)
 *             source = open(filename, 'rb')             # <<<<<<<<<<<<<< 
 *         else:
 *             filename = _getFilenameForFile(source)
 */
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 288; goto __pyx_L1;}
  Py_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filename);
  Py_INCREF(__pyx_n_rb);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_n_rb);
  __pyx_4 = PyObject_CallObject(__pyx_builtin_open, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 288; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_source);
  __pyx_v_source = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":290
 *             source = open(filename, 'rb')
 *         else:
 *             filename = _getFilenameForFile(source)             # <<<<<<<<<<<<<< 
 *             if filename is not None:
 *                 filename = _encodeFilename(filename)
 */
  __pyx_3 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_source); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 290; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":291
 *         else:
 *             filename = _getFilenameForFile(source)
 *             if filename is not None:             # <<<<<<<<<<<<<< 
 *                 filename = _encodeFilename(filename)
 * 
 */
  __pyx_1 = (__pyx_v_filename != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":292
 *             filename = _getFilenameForFile(source)
 *             if filename is not None:
 *                 filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 * 
 *         self._source = source
 */
    __pyx_4 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 292; goto __pyx_L1;}
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":294
 *                 filename = _encodeFilename(filename)
 * 
 *         self._source = source             # <<<<<<<<<<<<<< 
 *         if html:
 *             # make sure we're not looking for namespaces
 */
Py_INCREF(__pyx_v_source);
Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = __pyx_v_source;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":295
 * 
 *         self._source = source
 *         if html:             # <<<<<<<<<<<<<< 
 *             # make sure we're not looking for namespaces
 *             if 'start' in events:
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_html); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 295; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":297
 *         if html:
 *             # make sure we're not looking for namespaces
 *             if 'start' in events:             # <<<<<<<<<<<<<< 
 *                 if 'end' in events:
 *                     events = ('start', 'end')
 */
  __pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_n_start)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 297; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":298
 *             # make sure we're not looking for namespaces
 *             if 'start' in events:
 *                 if 'end' in events:             # <<<<<<<<<<<<<< 
 *                     events = ('start', 'end')
 *                 else:
 */
    __pyx_2 = (PySequence_Contains(__pyx_v_events, __pyx_n_end)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 298; goto __pyx_L1;}
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":299
 *             if 'start' in events:
 *                 if 'end' in events:
 *                     events = ('start', 'end')             # <<<<<<<<<<<<<< 
 *                 else:
 *                     events = ('start',)
 */
      __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 299; goto __pyx_L1;}
      Py_INCREF(__pyx_n_start);
      PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_start);
      Py_INCREF(__pyx_n_end);
      PyTuple_SET_ITEM(__pyx_3, 1, __pyx_n_end);
      Py_DECREF(__pyx_v_events);
      __pyx_v_events = __pyx_3;
      __pyx_3 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":301
 *                     events = ('start', 'end')
 *                 else:
 *                     events = ('start',)             # <<<<<<<<<<<<<< 
 *             elif 'end' in events:
 *                 events = ('end',)
 */
      __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 301; goto __pyx_L1;}
      Py_INCREF(__pyx_n_start);
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_n_start);
      Py_DECREF(__pyx_v_events);
      __pyx_v_events = __pyx_4;
      __pyx_4 = 0;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":302
 *                 else:
 *                     events = ('start',)
 *             elif 'end' in events:             # <<<<<<<<<<<<<< 
 *                 events = ('end',)
 *             else:
 */
  __pyx_1 = (PySequence_Contains(__pyx_v_events, __pyx_n_end)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 302; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":303
 *                     events = ('start',)
 *             elif 'end' in events:
 *                 events = ('end',)             # <<<<<<<<<<<<<< 
 *             else:
 *                 events = ()
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 303; goto __pyx_L1;}
    Py_INCREF(__pyx_n_end);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_end);
    Py_DECREF(__pyx_v_events);
    __pyx_v_events = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":305
 *                 events = ('end',)
 *             else:
 *                 events = ()             # <<<<<<<<<<<<<< 
 * 
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 */
    __pyx_4 = PyTuple_New(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 305; goto __pyx_L1;}
    Py_DECREF(__pyx_v_events);
    __pyx_v_events = __pyx_4;
    __pyx_4 = 0;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":307
 *                 events = ()
 * 
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS             # <<<<<<<<<<<<<< 
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_v_parse_options = __pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":308
 * 
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 *         if load_dtd:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 *         if dtd_validation:
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_load_dtd); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 308; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":309
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if dtd_validation:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":310
 *         if load_dtd:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDLOAD
 *         if dtd_validation:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_dtd_validation); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 310; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":312
 *         if dtd_validation:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if attribute_defaults:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":313
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDVALID | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if attribute_defaults:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_attribute_defaults); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 313; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":315
 *         if attribute_defaults:
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD             # <<<<<<<<<<<<<< 
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDATTR) | XML_PARSE_DTDLOAD);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":316
 *             parse_options = parse_options | xmlparser.XML_PARSE_DTDATTR | \
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if not no_network:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if remove_blank_text:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_no_network); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 316; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":317
 *                             xmlparser.XML_PARSE_DTDLOAD
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET             # <<<<<<<<<<<<<< 
 *         if remove_blank_text:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_NONET);
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":318
 *         if not no_network:
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if remove_blank_text:             # <<<<<<<<<<<<<< 
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_remove_blank_text); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 318; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":319
 *             parse_options = parse_options ^ xmlparser.XML_PARSE_NONET
 *         if remove_blank_text:
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS             # <<<<<<<<<<<<<< 
 * 
 *         _BaseParser.__init__(self, parse_options, html,
 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
  goto __pyx_L11;
}
__pyx_L11:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":321
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 * 
 *         _BaseParser.__init__(self, parse_options, html,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              None, filename, encoding)
 */
__pyx_3 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseParser), __pyx_n___init__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":321
 *             parse_options = parse_options | xmlparser.XML_PARSE_NOBLANKS
 * 
 *         _BaseParser.__init__(self, parse_options, html,             # <<<<<<<<<<<<<< 
 *                              remove_comments, remove_pis,
 *                              None, filename, encoding)
 */
__pyx_4 = PyInt_FromLong(__pyx_v_parse_options); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":323
 *         _BaseParser.__init__(self, parse_options, html,
 *                              remove_comments, remove_pis,
 *                              None, filename, encoding)             # <<<<<<<<<<<<<< 
 * 
 *         context = <_IterparseContext>self._getPushParserContext()
 */
__pyx_5 = PyTuple_New(8); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_4);
Py_INCREF(__pyx_v_html);
PyTuple_SET_ITEM(__pyx_5, 2, __pyx_v_html);
Py_INCREF(__pyx_v_remove_comments);
PyTuple_SET_ITEM(__pyx_5, 3, __pyx_v_remove_comments);
Py_INCREF(__pyx_v_remove_pis);
PyTuple_SET_ITEM(__pyx_5, 4, __pyx_v_remove_pis);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_5, 5, Py_None);
Py_INCREF(__pyx_v_filename);
PyTuple_SET_ITEM(__pyx_5, 6, __pyx_v_filename);
Py_INCREF(__pyx_v_encoding);
PyTuple_SET_ITEM(__pyx_5, 7, __pyx_v_encoding);
__pyx_4 = 0;
__pyx_4 = PyObject_CallObject(__pyx_3, __pyx_5); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 321; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":325
 *                              None, filename, encoding)
 * 
 *         context = <_IterparseContext>self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *         context._setEventFilter(events, tag)
 *         context.prepare()
 */
__pyx_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_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 325; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_3)));
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_3);
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":326
 * 
 *         context = <_IterparseContext>self._getPushParserContext()
 *         context._setEventFilter(events, tag)             # <<<<<<<<<<<<<< 
 *         context.prepare()
 *         # parser will not be unlocked - no other methods supported
 */
__pyx_5 = ((struct __pyx_vtabstruct_4lxml_5etree__IterparseContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab)->_setEventFilter(__pyx_v_context,__pyx_v_events,__pyx_v_tag); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 326; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":327
 *         context = <_IterparseContext>self._getPushParserContext()
 *         context._setEventFilter(events, tag)
 *         context.prepare()             # <<<<<<<<<<<<<< 
 *         # parser will not be unlocked - no other methods supported
 * 
 */
__pyx_6 = ((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_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 327; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.iterparse.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_events);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_attribute_defaults);
Py_DECREF(__pyx_v_dtd_validation);
Py_DECREF(__pyx_v_load_dtd);
Py_DECREF(__pyx_v_no_network);
Py_DECREF(__pyx_v_remove_blank_text);
Py_DECREF(__pyx_v_remove_comments);
Py_DECREF(__pyx_v_remove_pis);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_html);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":333
 *         """The error log of the last (or current) parser run.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()
 */

static PyObject *__pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(PyObject *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_v_context;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":335
 *         def __get__(self):
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *             return context._error_log.copy()
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 335; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":336
 *             cdef _ParserContext context
 *             context = self._getPushParserContext()
 *             return context._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 *     cdef _ParserContext _createContext(self, target):
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 336; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.iterparse.error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":338
 *             return context._error_log.copy()
 * 
 *     cdef _ParserContext _createContext(self, target):             # <<<<<<<<<<<<<< 
 *         return _IterparseContext()
 * 
 */

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) {
struct __pyx_obj_4lxml_5etree__ParserContext *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_target);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":339
 * 
 *     cdef _ParserContext _createContext(self, target):
 *         return _IterparseContext()             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__IterparseContext), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 339; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ParserContext)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 339; goto __pyx_L1;}
__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.iterparse._createContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_target);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":341
 *         return _IterparseContext()
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         raise TypeError, "iterparse parsers cannot be copied"
 * 
 */

static PyObject *__pyx_k611p;

static char __pyx_k611[] = "iterparse parsers cannot be copied";

static PyObject *__pyx_pf_4lxml_5etree_9iterparse_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9iterparse_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":342
 * 
 *     def copy(self):
 *         raise TypeError, "iterparse parsers cannot be copied"             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__Pyx_Raise(__pyx_builtin_TypeError, __pyx_k611p, 0);
{__pyx_filename = __pyx_f[10]; __pyx_lineno = 342; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.iterparse.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":344
 *         raise TypeError, "iterparse parsers cannot be copied"
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_9iterparse___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9iterparse___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":345
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":347
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef _IterparseContext context
 *         cdef xmlparser.xmlParserCtxt* pctxt
 */

static PyObject *__pyx_k612p;

static char __pyx_k612[] = "reading file objects must return plain strings";

static PyObject *__pyx_pf_4lxml_5etree_9iterparse___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_9iterparse___next__(PyObject *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__IterparseContext *__pyx_v_context;
xmlParserCtxt *__pyx_v_pctxt;
int __pyx_v_error;
PyObject *__pyx_v_item;
PyObject *__pyx_v_data;
PyObject *__pyx_v_element;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);
__pyx_v_data = Py_None; Py_INCREF(Py_None);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":351
 *         cdef xmlparser.xmlParserCtxt* pctxt
 *         cdef int error
 *         if self._source is None:             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":352
 *         cdef int error
 *         if self._source is None:
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 * 
 *         context = <_IterparseContext>self._getPushParserContext()
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[10]; __pyx_lineno = 352; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":354
 *             raise StopIteration
 * 
 *         context = <_IterparseContext>self._getPushParserContext()             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(context._events) > context._event_index:
 *             item = python.PyList_GET_ITEM(context._events, context._event_index)
 */
__pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 354; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_2)));
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":355
 * 
 *         context = <_IterparseContext>self._getPushParserContext()
 *         if python.PyList_GET_SIZE(context._events) > context._event_index:             # <<<<<<<<<<<<<< 
 *             item = python.PyList_GET_ITEM(context._events, context._event_index)
 *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) > __pyx_v_context->_event_index);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":356
 *         context = <_IterparseContext>self._getPushParserContext()
 *         if python.PyList_GET_SIZE(context._events) > context._event_index:
 *             item = python.PyList_GET_ITEM(context._events, context._event_index)             # <<<<<<<<<<<<<< 
 *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
 *             context._event_index = context._event_index + 1
 */
  __pyx_2 = PyList_GET_ITEM(__pyx_v_context->_events,__pyx_v_context->_event_index); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":357
 *         if python.PyList_GET_SIZE(context._events) > context._event_index:
 *             item = python.PyList_GET_ITEM(context._events, context._event_index)
 *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM             # <<<<<<<<<<<<<< 
 *             context._event_index = context._event_index + 1
 *             return item
 */
  Py_INCREF(__pyx_v_item);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":358
 *             item = python.PyList_GET_ITEM(context._events, context._event_index)
 *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
 *             context._event_index = context._event_index + 1             # <<<<<<<<<<<<<< 
 *             return item
 * 
 */
  __pyx_v_context->_event_index = (__pyx_v_context->_event_index + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":359
 *             python.Py_INCREF(item) # 'borrowed reference' from PyList_GET_ITEM
 *             context._event_index = context._event_index + 1
 *             return item             # <<<<<<<<<<<<<< 
 * 
 *         del context._events[:]
 */
  Py_INCREF(__pyx_v_item);
  __pyx_r = __pyx_v_item;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":361
 *             return item
 * 
 *         del context._events[:]             # <<<<<<<<<<<<<< 
 *         pctxt = context._c_ctxt
 *         error = 0
 */
if (PySequence_DelSlice(__pyx_v_context->_events, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 361; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":362
 * 
 *         del context._events[:]
 *         pctxt = context._c_ctxt             # <<<<<<<<<<<<<< 
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:
 */
__pyx_v_pctxt = __pyx_v_context->__pyx_base._c_ctxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":363
 *         del context._events[:]
 *         pctxt = context._c_ctxt
 *         error = 0             # <<<<<<<<<<<<<< 
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 */
__pyx_v_error = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":364
 *         pctxt = context._c_ctxt
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:             # <<<<<<<<<<<<<< 
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 *             if not python.PyString_Check(data):
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":364
 *         pctxt = context._c_ctxt
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:             # <<<<<<<<<<<<<< 
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 *             if not python.PyString_Check(data):
 */
  __pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":364
 *         pctxt = context._c_ctxt
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:             # <<<<<<<<<<<<<< 
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 *             if not python.PyString_Check(data):
 */
    __pyx_1 = (__pyx_v_error == 0);
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":365
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)             # <<<<<<<<<<<<<< 
 *             if not python.PyString_Check(data):
 *                 self._source = None
 */
  __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source, __pyx_n_read); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 365; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":365
 *         error = 0
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)             # <<<<<<<<<<<<<< 
 *             if not python.PyString_Check(data):
 *                 self._source = None
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_INCREF(__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 365; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":366
 *         while python.PyList_GET_SIZE(context._events) == 0 and error == 0:
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 *             if not python.PyString_Check(data):             # <<<<<<<<<<<<<< 
 *                 self._source = None
 *                 raise TypeError, "reading file objects must return plain strings"
 */
  __pyx_1 = (!PyString_Check(__pyx_v_data));
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":367
 *             data = self._source.read(__ITERPARSE_CHUNK_SIZE)
 *             if not python.PyString_Check(data):
 *                 self._source = None             # <<<<<<<<<<<<<< 
 *                 raise TypeError, "reading file objects must return plain strings"
 *             elif data:
 */
    Py_INCREF(Py_None);
    Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
    ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":368
 *             if not python.PyString_Check(data):
 *                 self._source = None
 *                 raise TypeError, "reading file objects must return plain strings"             # <<<<<<<<<<<<<< 
 *             elif data:
 *                 if self._for_html:
 */
    __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k612p, 0);
    {__pyx_filename = __pyx_f[10]; __pyx_lineno = 368; goto __pyx_L1;}
    goto __pyx_L6;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":369
 *                 self._source = None
 *                 raise TypeError, "reading file objects must return plain strings"
 *             elif data:             # <<<<<<<<<<<<<< 
 *                 if self._for_html:
 *                     error = htmlparser.htmlParseChunk(
 */
  __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_data); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 369; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":370
 *                 raise TypeError, "reading file objects must return plain strings"
 *             elif data:
 *                 if self._for_html:             # <<<<<<<<<<<<<< 
 *                     error = htmlparser.htmlParseChunk(
 *                         pctxt, _cstr(data), python.PyString_GET_SIZE(data), 0)
 */
    __pyx_1 = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._for_html;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":372
 *                 if self._for_html:
 *                     error = htmlparser.htmlParseChunk(
 *                         pctxt, _cstr(data), python.PyString_GET_SIZE(data), 0)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     error = xmlparser.xmlParseChunk(
 */
      __pyx_v_error = htmlParseChunk(__pyx_v_pctxt,_cstr(__pyx_v_data),PyString_GET_SIZE(__pyx_v_data),0);
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":375
 *                 else:
 *                     error = xmlparser.xmlParseChunk(
 *                         pctxt, _cstr(data), python.PyString_GET_SIZE(data), 0)             # <<<<<<<<<<<<<< 
 *             else:
 *                 if self._for_html:
 */
      __pyx_v_error = xmlParseChunk(__pyx_v_pctxt,_cstr(__pyx_v_data),PyString_GET_SIZE(__pyx_v_data),0);
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":377
 *                         pctxt, _cstr(data), python.PyString_GET_SIZE(data), 0)
 *             else:
 *                 if self._for_html:             # <<<<<<<<<<<<<< 
 *                     error = htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
 *                 else:
 */
    __pyx_1 = ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->__pyx_base._for_html;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":378
 *             else:
 *                 if self._for_html:
 *                     error = htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<< 
 *                 else:
 *                     error = xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 */
      __pyx_v_error = htmlParseChunk(__pyx_v_pctxt,NULL,0,1);
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":380
 *                     error = htmlparser.htmlParseChunk(pctxt, NULL, 0, 1)
 *                 else:
 *                     error = xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)             # <<<<<<<<<<<<<< 
 *                 self._source = None
 *                 break
 */
      __pyx_v_error = xmlParseChunk(__pyx_v_pctxt,NULL,0,1);
    }
    __pyx_L8:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":381
 *                 else:
 *                     error = xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 *                 self._source = None             # <<<<<<<<<<<<<< 
 *                 break
 *         if error != 0:
 */
    Py_INCREF(Py_None);
    Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
    ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":382
 *                     error = xmlparser.xmlParseChunk(pctxt, NULL, 0, 1)
 *                 self._source = None
 *                 break             # <<<<<<<<<<<<<< 
 *         if error != 0:
 *             self._source = None
 */
    goto __pyx_L5;
  }
  __pyx_L6:;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":383
 *                 self._source = None
 *                 break
 *         if error != 0:             # <<<<<<<<<<<<<< 
 *             self._source = None
 *             del context._events[:]
 */
__pyx_1 = (__pyx_v_error != 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":384
 *                 break
 *         if error != 0:
 *             self._source = None             # <<<<<<<<<<<<<< 
 *             del context._events[:]
 *             _raiseParseError(pctxt, self._filename, context._error_log)
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
  ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":385
 *         if error != 0:
 *             self._source = None
 *             del context._events[:]             # <<<<<<<<<<<<<< 
 *             _raiseParseError(pctxt, self._filename, context._error_log)
 *         if python.PyList_GET_SIZE(context._events) == 0:
 */
  if (PySequence_DelSlice(__pyx_v_context->_events, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 385; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":386
 *             self._source = None
 *             del context._events[:]
 *             _raiseParseError(pctxt, self._filename, context._error_log)             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(context._events) == 0:
 *             self.root = context._root
 */
  __pyx_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_5 == 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 386; goto __pyx_L1;}
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":387
 *             del context._events[:]
 *             _raiseParseError(pctxt, self._filename, context._error_log)
 *         if python.PyList_GET_SIZE(context._events) == 0:             # <<<<<<<<<<<<<< 
 *             self.root = context._root
 *             self._source = None
 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":388
 *             _raiseParseError(pctxt, self._filename, context._error_log)
 *         if python.PyList_GET_SIZE(context._events) == 0:
 *             self.root = context._root             # <<<<<<<<<<<<<< 
 *             self._source = None
 *             raise StopIteration
 */
  Py_INCREF(((PyObject *)__pyx_v_context->_root));
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->root);
  ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->root = ((PyObject *)__pyx_v_context->_root);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":389
 *         if python.PyList_GET_SIZE(context._events) == 0:
 *             self.root = context._root
 *             self._source = None             # <<<<<<<<<<<<<< 
 *             raise StopIteration
 * 
 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source);
  ((struct __pyx_obj_4lxml_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":390
 *             self.root = context._root
 *             self._source = None
 *             raise StopIteration             # <<<<<<<<<<<<<< 
 * 
 *         context._event_index = 1
 */
  __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[10]; __pyx_lineno = 390; goto __pyx_L1;}
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":392
 *             raise StopIteration
 * 
 *         context._event_index = 1             # <<<<<<<<<<<<<< 
 *         element = python.PyList_GET_ITEM(context._events, 0)
 *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
 */
__pyx_v_context->_event_index = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":393
 * 
 *         context._event_index = 1
 *         element = python.PyList_GET_ITEM(context._events, 0)             # <<<<<<<<<<<<<< 
 *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
 *         return element
 */
__pyx_2 = PyList_GET_ITEM(__pyx_v_context->_events,0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 393; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":394
 *         context._event_index = 1
 *         element = python.PyList_GET_ITEM(context._events, 0)
 *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM             # <<<<<<<<<<<<<< 
 *         return element
 * 
 */
Py_INCREF(__pyx_v_element);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":395
 *         element = python.PyList_GET_ITEM(context._events, 0)
 *         python.Py_INCREF(element) # 'borrowed reference' from PyList_GET_ITEM
 *         return element             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(__pyx_v_element);
__pyx_r = __pyx_v_element;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.iterparse.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_item);
Py_DECREF(__pyx_v_data);
Py_DECREF(__pyx_v_element);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":412
 *     cdef char*  _tag_name
 * 
 *     def __init__(self, element_or_tree, events=("end",), tag=None):             # <<<<<<<<<<<<<< 
 *         cdef _Element root
 *         cdef int ns_count
 */

static int __pyx_pf_4lxml_5etree_8iterwalk___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_8iterwalk___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_or_tree = 0;
PyObject *__pyx_v_events = 0;
PyObject *__pyx_v_tag = 0;
struct LxmlElement *__pyx_v_root;
int __pyx_v_ns_count;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"element_or_tree","events","tag",0};
__pyx_v_events = __pyx_k229;
__pyx_v_tag = __pyx_k230;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_element_or_tree, &__pyx_v_events, &__pyx_v_tag))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element_or_tree);
Py_INCREF(__pyx_v_events);
Py_INCREF(__pyx_v_tag);
__pyx_v_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":415
 *         cdef _Element root
 *         cdef int ns_count
 *         root = _rootNodeOrRaise(element_or_tree)             # <<<<<<<<<<<<<< 
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         self._setTagFilter(tag)
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_element_or_tree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 415; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root));
__pyx_v_root = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":416
 *         cdef int ns_count
 *         root = _rootNodeOrRaise(element_or_tree)
 *         self._event_filter = _buildIterparseEventFilter(events)             # <<<<<<<<<<<<<< 
 *         self._setTagFilter(tag)
 *         self._node_stack  = []
 */
((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter = __pyx_f_4lxml_5etree__buildIterparseEventFilter(__pyx_v_events);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":417
 *         root = _rootNodeOrRaise(element_or_tree)
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         self._setTagFilter(tag)             # <<<<<<<<<<<<<< 
 *         self._node_stack  = []
 *         self._pop_node = self._node_stack.pop
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":418
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         self._setTagFilter(tag)
 *         self._node_stack  = []             # <<<<<<<<<<<<<< 
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 418; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":418
 *         self._event_filter = _buildIterparseEventFilter(events)
 *         self._setTagFilter(tag)
 *         self._node_stack  = []             # <<<<<<<<<<<<<< 
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack);
((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":419
 *         self._setTagFilter(tag)
 *         self._node_stack  = []
 *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<< 
 *         self._events = []
 *         self._pop_event = self._events.pop
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack, __pyx_n_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 419; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":419
 *         self._setTagFilter(tag)
 *         self._node_stack  = []
 *         self._pop_node = self._node_stack.pop             # <<<<<<<<<<<<<< 
 *         self._events = []
 *         self._pop_event = self._events.pop
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_node);
((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_node = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":420
 *         self._node_stack  = []
 *         self._pop_node = self._node_stack.pop
 *         self._events = []             # <<<<<<<<<<<<<< 
 *         self._pop_event = self._events.pop
 * 
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 420; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":420
 *         self._node_stack  = []
 *         self._pop_node = self._node_stack.pop
 *         self._events = []             # <<<<<<<<<<<<<< 
 *         self._pop_event = self._events.pop
 * 
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events);
((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":421
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 *         self._pop_event = self._events.pop             # <<<<<<<<<<<<<< 
 * 
 *         if self._event_filter != 0:
 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events, __pyx_n_pop); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 421; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":421
 *         self._pop_node = self._node_stack.pop
 *         self._events = []
 *         self._pop_event = self._events.pop             # <<<<<<<<<<<<<< 
 * 
 *         if self._event_filter != 0:
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event);
((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":423
 *         self._pop_event = self._events.pop
 * 
 *         if self._event_filter != 0:             # <<<<<<<<<<<<<< 
 *             self._index = 0
 *             ns_count = self._start_node(root)
 */
__pyx_2 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter != 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":424
 * 
 *         if self._event_filter != 0:
 *             self._index = 0             # <<<<<<<<<<<<<< 
 *             ns_count = self._start_node(root)
 *             python.PyList_Append(self._node_stack, (root, ns_count))
 */
  ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":425
 *         if self._event_filter != 0:
 *             self._index = 0
 *             ns_count = self._start_node(root)             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(self._node_stack, (root, ns_count))
 *         else:
 */
  __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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":426
 *             self._index = 0
 *             ns_count = self._start_node(root)
 *             python.PyList_Append(self._node_stack, (root, ns_count))             # <<<<<<<<<<<<<< 
 *         else:
 *             self._index = -1
 */
  __pyx_1 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 426; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 426; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_1);
  __pyx_1 = 0;
  __pyx_4 = PyList_Append(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack,__pyx_3); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 426; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":428
 *             python.PyList_Append(self._node_stack, (root, ns_count))
 *         else:
 *             self._index = -1             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _setTagFilter(self, tag):
 */
  ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = -1;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.iterwalk.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element_or_tree);
Py_DECREF(__pyx_v_events);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":430
 *             self._index = -1
 * 
 *     cdef void _setTagFilter(self, tag):             # <<<<<<<<<<<<<< 
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL
 */

static PyObject *__pyx_k613p;
static PyObject *__pyx_k614p;
static PyObject *__pyx_k615p;

static char __pyx_k613[] = "*";
static char __pyx_k614[] = "*";
static char __pyx_k615[] = "*";

static  void __pyx_f_4lxml_5etree_8iterwalk__setTagFilter(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_v_href;
PyObject *__pyx_v_name;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
__pyx_v_href = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":431
 * 
 *     cdef void _setTagFilter(self, tag):
 *         if tag is None or tag == '*':             # <<<<<<<<<<<<<< 
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL
 */
__pyx_2 = (__pyx_v_tag == Py_None);
__pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 431; goto __pyx_L1;}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 431; goto __pyx_L1;}
if (!__pyx_2) {
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":431
 * 
 *     cdef void _setTagFilter(self, tag):
 *         if tag is None or tag == '*':             # <<<<<<<<<<<<<< 
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL
 */
  __pyx_1 = PyObject_RichCompare(__pyx_v_tag, __pyx_k613p, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 431; goto __pyx_L1;}
}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 431; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":432
 *     cdef void _setTagFilter(self, tag):
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL             # <<<<<<<<<<<<<< 
 *             self._tag_name  = NULL
 *         else:
 */
  __pyx_v_self->_tag_href = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":433
 *         if tag is None or tag == '*':
 *             self._tag_href  = NULL
 *             self._tag_name  = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 */
  __pyx_v_self->_tag_name = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":435
 *             self._tag_name  = NULL
 *         else:
 *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 */
  __pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 435; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":435
 *             self._tag_name  = NULL
 *         else:
 *             self._tag_tuple = _getNsTag(tag)             # <<<<<<<<<<<<<< 
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 */
  Py_DECREF(__pyx_v_self->_tag_tuple);
  __pyx_v_self->_tag_tuple = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":436
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
  if (PyTuple_CheckExact(__pyx_v_self->_tag_tuple) && PyTuple_GET_SIZE(__pyx_v_self->_tag_tuple) == 2) {
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_tag_tuple, 0);
    Py_INCREF(__pyx_3);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":436
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = PyTuple_GET_ITEM(__pyx_v_self->_tag_tuple, 1);
    Py_INCREF(__pyx_3);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":436
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_3;
    __pyx_3 = 0;
  }
  else {
    __pyx_1 = PyObject_GetIter(__pyx_v_self->_tag_tuple); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 436; goto __pyx_L1;}
    __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 436; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":436
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 436; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":436
 *         else:
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple             # <<<<<<<<<<<<<< 
 *             if href is None or href == '*':
 *                 self._tag_href = NULL
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 436; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":437
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_href = NULL
 *             else:
 */
  __pyx_2 = (__pyx_v_href == Py_None);
  __pyx_3 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 437; goto __pyx_L1;}
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 437; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":437
 *             self._tag_tuple = _getNsTag(tag)
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_href = NULL
 *             else:
 */
    __pyx_3 = PyObject_RichCompare(__pyx_v_href, __pyx_k614p, Py_EQ); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 437; goto __pyx_L1;}
  }
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 437; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":438
 *             href, name = self._tag_tuple
 *             if href is None or href == '*':
 *                 self._tag_href = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._tag_href = _cstr(href)
 */
    __pyx_v_self->_tag_href = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":440
 *                 self._tag_href = NULL
 *             else:
 *                 self._tag_href = _cstr(href)             # <<<<<<<<<<<<<< 
 *             if name is None or name == '*':
 *                 self._tag_name = NULL
 */
    __pyx_v_self->_tag_href = _cstr(__pyx_v_href);
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":441
 *             else:
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_name = NULL
 *             else:
 */
  __pyx_2 = (__pyx_v_name == Py_None);
  __pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 441; goto __pyx_L1;}
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 441; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":441
 *             else:
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':             # <<<<<<<<<<<<<< 
 *                 self._tag_name = NULL
 *             else:
 */
    __pyx_1 = PyObject_RichCompare(__pyx_v_name, __pyx_k615p, Py_EQ); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 441; goto __pyx_L1;}
  }
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 441; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":442
 *                 self._tag_href = _cstr(href)
 *             if name is None or name == '*':
 *                 self._tag_name = NULL             # <<<<<<<<<<<<<< 
 *             else:
 *                 self._tag_name = _cstr(name)
 */
    __pyx_v_self->_tag_name = NULL;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":444
 *                 self._tag_name = NULL
 *             else:
 *                 self._tag_name = _cstr(name)             # <<<<<<<<<<<<<< 
 *             if self._tag_href is NULL and self._tag_name is NULL:
 *                 self._tag_tuple = None
 */
    __pyx_v_self->_tag_name = _cstr(__pyx_v_name);
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":445
 *             else:
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<< 
 *                 self._tag_tuple = None
 * 
 */
  __pyx_2 = (__pyx_v_self->_tag_href == NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":445
 *             else:
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:             # <<<<<<<<<<<<<< 
 *                 self._tag_tuple = None
 * 
 */
    __pyx_2 = (__pyx_v_self->_tag_name == NULL);
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":446
 *                 self._tag_name = _cstr(name)
 *             if self._tag_href is NULL and self._tag_name is NULL:
 *                 self._tag_tuple = None             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_self->_tag_tuple);
    __pyx_v_self->_tag_tuple = Py_None;
    goto __pyx_L5;
  }
  __pyx_L5:;
}
__pyx_L2:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("lxml.etree.iterwalk._setTagFilter");
__pyx_L0:;
Py_DECREF(__pyx_v_href);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":448
 *                 self._tag_tuple = None
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":449
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __next__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":451
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_child
 *         cdef _Element node
 */

static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_8iterwalk___next__(PyObject *__pyx_v_self) {
xmlNode *__pyx_v_c_child;
struct LxmlElement *__pyx_v_node;
struct LxmlElement *__pyx_v_next_node;
int __pyx_v_ns_count;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
int __pyx_6;
Py_INCREF(__pyx_v_self);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_next_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":456
 *         cdef _Element next_node
 *         cdef int ns_count
 *         if python.PyList_GET_SIZE(self._events):             # <<<<<<<<<<<<<< 
 *             return self._pop_event(0)
 *         ns_count = 0
 */
__pyx_1 = PyList_GET_SIZE(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":457
 *         cdef int ns_count
 *         if python.PyList_GET_SIZE(self._events):
 *             return self._pop_event(0)             # <<<<<<<<<<<<<< 
 *         ns_count = 0
 *         # find next node
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 457; goto __pyx_L1;}
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_num_0);
  __pyx_3 = PyObject_CallObject(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 457; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":458
 *         if python.PyList_GET_SIZE(self._events):
 *             return self._pop_event(0)
 *         ns_count = 0             # <<<<<<<<<<<<<< 
 *         # find next node
 *         while self._index >= 0:
 */
__pyx_v_ns_count = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":460
 *         ns_count = 0
 *         # find next node
 *         while self._index >= 0:             # <<<<<<<<<<<<<< 
 *             node = self._node_stack[self._index][0]
 * 
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":460
 *         ns_count = 0
 *         # find next node
 *         while self._index >= 0:             # <<<<<<<<<<<<<< 
 *             node = self._node_stack[self._index][0]
 * 
 */
  __pyx_4 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index >= 0);
  if (!__pyx_4) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":461
 *         # find next node
 *         while self._index >= 0:
 *             node = self._node_stack[self._index][0]             # <<<<<<<<<<<<<< 
 * 
 *             c_child = _findChildForwards(node._c_node, 0)
 */
  if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack) && 0 <= ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index && ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index < PyList_GET_SIZE(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack)) {
    __pyx_3 = PyList_GET_ITEM(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack, ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index); Py_INCREF(__pyx_3);
    } else if (PyTuple_CheckExact(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack) && 0 <= ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index && ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index < PyTuple_GET_SIZE(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack)) {
    __pyx_3 = PyTuple_GET_ITEM(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack, ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index); Py_INCREF(__pyx_3);
    } else {
    __pyx_2 = PyInt_FromLong(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 461; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 461; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":461
 *         # find next node
 *         while self._index >= 0:
 *             node = self._node_stack[self._index][0]             # <<<<<<<<<<<<<< 
 * 
 *             c_child = _findChildForwards(node._c_node, 0)
 */
  if (PyList_CheckExact(__pyx_3) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_3)) {
    __pyx_5 = PyList_GET_ITEM(__pyx_3, 0); Py_INCREF(__pyx_5);
    } else if (PyTuple_CheckExact(__pyx_3) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_3)) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0); Py_INCREF(__pyx_5);
    } else {
    __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 461; goto __pyx_L1;}
    __pyx_5 = PyObject_GetItem(__pyx_3, __pyx_2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 461; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 461; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_5);
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":463
 *             node = self._node_stack[self._index][0]
 * 
 *             c_child = _findChildForwards(node._c_node, 0)             # <<<<<<<<<<<<<< 
 *             if c_child is not NULL:
 *                 # try children
 */
  __pyx_v_c_child = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_node->_c_node,0);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":464
 * 
 *             c_child = _findChildForwards(node._c_node, 0)
 *             if c_child is not NULL:             # <<<<<<<<<<<<<< 
 *                 # try children
 *                 next_node = _elementFactory(node._doc, c_child)
 */
  __pyx_4 = (__pyx_v_c_child != NULL);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":466
 *             if c_child is not NULL:
 *                 # try children
 *                 next_node = _elementFactory(node._doc, c_child)             # <<<<<<<<<<<<<< 
 *             else:
 *                 # back off
 */
    __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_node->_doc,__pyx_v_c_child)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 466; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_next_node));
    __pyx_v_next_node = ((struct LxmlElement *)__pyx_3);
    __pyx_3 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":469
 *             else:
 *                 # back off
 *                 next_node = None             # <<<<<<<<<<<<<< 
 *                 while next_node is None:
 *                     # back off through parents
 */
    Py_INCREF(Py_None);
    Py_DECREF(((PyObject *)__pyx_v_next_node));
    __pyx_v_next_node = ((struct LxmlElement *)Py_None);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":470
 *                 # back off
 *                 next_node = None
 *                 while next_node is None:             # <<<<<<<<<<<<<< 
 *                     # back off through parents
 *                     self._index = self._index - 1
 */
    while (1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":470
 *                 # back off
 *                 next_node = None
 *                 while next_node is None:             # <<<<<<<<<<<<<< 
 *                     # back off through parents
 *                     self._index = self._index - 1
 */
      __pyx_4 = (((PyObject *)__pyx_v_next_node) == Py_None);
      if (!__pyx_4) break;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":472
 *                 while next_node is None:
 *                     # back off through parents
 *                     self._index = self._index - 1             # <<<<<<<<<<<<<< 
 *                     node = self._end_node()
 *                     if self._index < 0:
 */
      ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index - 1);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":473
 *                     # back off through parents
 *                     self._index = self._index - 1
 *                     node = self._end_node()             # <<<<<<<<<<<<<< 
 *                     if self._index < 0:
 *                         break
 */
      __pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 473; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_2);
      __pyx_2 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":474
 *                     self._index = self._index - 1
 *                     node = self._end_node()
 *                     if self._index < 0:             # <<<<<<<<<<<<<< 
 *                         break
 *                     next_node = node.getnext()
 */
      __pyx_4 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index < 0);
      if (__pyx_4) {
        goto __pyx_L7;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":476
 *                     if self._index < 0:
 *                         break
 *                     next_node = node.getnext()             # <<<<<<<<<<<<<< 
 *             if next_node is not None:
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 */
      __pyx_5 = PyObject_GetAttr(((PyObject *)__pyx_v_node), __pyx_n_getnext); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 476; goto __pyx_L1;}
      __pyx_3 = PyObject_CallObject(__pyx_5, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 476; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 476; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_next_node));
      __pyx_v_next_node = ((struct LxmlElement *)__pyx_3);
      __pyx_3 = 0;
    }
    __pyx_L7:;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":477
 *                         break
 *                     next_node = node.getnext()
 *             if next_node is not None:             # <<<<<<<<<<<<<< 
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 *                                          ITERPARSE_FILTER_START_NS):
 */
  __pyx_4 = (((PyObject *)__pyx_v_next_node) != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":479
 *             if next_node is not None:
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 *                                          ITERPARSE_FILTER_START_NS):             # <<<<<<<<<<<<<< 
 *                     ns_count = self._start_node(next_node)
 *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
 */
    __pyx_6 = (((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));
    if (__pyx_6) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":480
 *                 if self._event_filter & (ITERPARSE_FILTER_START | \
 *                                          ITERPARSE_FILTER_START_NS):
 *                     ns_count = self._start_node(next_node)             # <<<<<<<<<<<<<< 
 *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *                     ns_count = _countNsDefs(next_node._c_node)
 */
      __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);
      goto __pyx_L10;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":481
 *                                          ITERPARSE_FILTER_START_NS):
 *                     ns_count = self._start_node(next_node)
 *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *                     ns_count = _countNsDefs(next_node._c_node)
 *                 python.PyList_Append(self._node_stack, (next_node, ns_count))
 */
    __pyx_6 = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
    if (__pyx_6) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":482
 *                     ns_count = self._start_node(next_node)
 *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *                     ns_count = _countNsDefs(next_node._c_node)             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._node_stack, (next_node, ns_count))
 *                 self._index = self._index + 1
 */
      __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_next_node->_c_node);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":483
 *                 elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *                     ns_count = _countNsDefs(next_node._c_node)
 *                 python.PyList_Append(self._node_stack, (next_node, ns_count))             # <<<<<<<<<<<<<< 
 *                 self._index = self._index + 1
 *             if python.PyList_GET_SIZE(self._events):
 */
    __pyx_2 = PyInt_FromLong(__pyx_v_ns_count); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 483; goto __pyx_L1;}
    __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_next_node));
    PyTuple_SET_ITEM(__pyx_5, 0, ((PyObject *)__pyx_v_next_node));
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_2);
    __pyx_2 = 0;
    __pyx_6 = PyList_Append(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_node_stack,__pyx_5); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 483; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":484
 *                     ns_count = _countNsDefs(next_node._c_node)
 *                 python.PyList_Append(self._node_stack, (next_node, ns_count))
 *                 self._index = self._index + 1             # <<<<<<<<<<<<<< 
 *             if python.PyList_GET_SIZE(self._events):
 *                 return self._pop_event(0)
 */
    ((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_index + 1);
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":485
 *                 python.PyList_Append(self._node_stack, (next_node, ns_count))
 *                 self._index = self._index + 1
 *             if python.PyList_GET_SIZE(self._events):             # <<<<<<<<<<<<<< 
 *                 return self._pop_event(0)
 *         raise StopIteration
 */
  __pyx_1 = PyList_GET_SIZE(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_events);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":486
 *                 self._index = self._index + 1
 *             if python.PyList_GET_SIZE(self._events):
 *                 return self._pop_event(0)             # <<<<<<<<<<<<<< 
 *         raise StopIteration
 * 
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 486; goto __pyx_L1;}
    Py_INCREF(__pyx_num_0);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_num_0);
    __pyx_2 = PyObject_CallObject(((struct __pyx_obj_4lxml_5etree_iterwalk *)__pyx_v_self)->_pop_event, __pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 486; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L11;
  }
  __pyx_L11:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":487
 *             if python.PyList_GET_SIZE(self._events):
 *                 return self._pop_event(0)
 *         raise StopIteration             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _start_node(self, _Element node):
 */
__Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
{__pyx_filename = __pyx_f[10]; __pyx_lineno = 487; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.iterwalk.__next__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_next_node);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":489
 *         raise StopIteration
 * 
 *     cdef int _start_node(self, _Element node):             # <<<<<<<<<<<<<< 
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:
 */


static  int __pyx_f_4lxml_5etree_8iterwalk__start_node(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self,struct LxmlElement *__pyx_v_node) {
int __pyx_v_ns_count;
int __pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":491
 *     cdef int _start_node(self, _Element node):
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:             # <<<<<<<<<<<<<< 
 *             ns_count = _appendStartNsEvents(node._c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":492
 *         cdef int ns_count
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:
 *             ns_count = _appendStartNsEvents(node._c_node, self._events)             # <<<<<<<<<<<<<< 
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = _countNsDefs(node._c_node)
 */
  __pyx_v_ns_count = __pyx_f_4lxml_5etree__appendStartNsEvents(__pyx_v_node->_c_node,__pyx_v_self->_events);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":493
 *         if self._event_filter & ITERPARSE_FILTER_START_NS:
 *             ns_count = _appendStartNsEvents(node._c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *             ns_count = _countNsDefs(node._c_node)
 *         else:
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":494
 *             ns_count = _appendStartNsEvents(node._c_node, self._events)
 *         elif self._event_filter & ITERPARSE_FILTER_END_NS:
 *             ns_count = _countNsDefs(node._c_node)             # <<<<<<<<<<<<<< 
 *         else:
 *             ns_count = 0
 */
  __pyx_v_ns_count = __pyx_f_4lxml_5etree__countNsDefs(__pyx_v_node->_c_node);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":496
 *             ns_count = _countNsDefs(node._c_node)
 *         else:
 *             ns_count = 0             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_START:
 *             if self._tag_tuple is None or \
 */
  __pyx_v_ns_count = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":497
 *         else:
 *             ns_count = 0
 *         if self._event_filter & ITERPARSE_FILTER_START:             # <<<<<<<<<<<<<< 
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_START);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":498
 *             ns_count = 0
 *         if self._event_filter & ITERPARSE_FILTER_START:
 *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<< 
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("start", node))
 */
  __pyx_2 = (__pyx_v_self->_tag_tuple == Py_None);
  if (!__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":499
 *         if self._event_filter & ITERPARSE_FILTER_START:
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._events, ("start", node))
 *         return ns_count
 */
    __pyx_2 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_node->_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":500
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("start", node))             # <<<<<<<<<<<<<< 
 *         return ns_count
 * 
 */
    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 500; goto __pyx_L1;}
    Py_INCREF(__pyx_n_start);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_start);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_node));
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_3); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 500; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":501
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("start", node))
 *         return ns_count             # <<<<<<<<<<<<<< 
 * 
 *     cdef _Element _end_node(self):
 */
__pyx_r = __pyx_v_ns_count;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("lxml.etree.iterwalk._start_node");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_node);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":503
 *         return ns_count
 * 
 *     cdef _Element _end_node(self):             # <<<<<<<<<<<<<< 
 *         cdef _Element node
 *         cdef int i, ns_count
 */

static PyObject *__pyx_k618p;

static char __pyx_k618[] = "end-ns";

static  struct LxmlElement *__pyx_f_4lxml_5etree_8iterwalk__end_node(struct __pyx_obj_4lxml_5etree_iterwalk *__pyx_v_self) {
struct LxmlElement *__pyx_v_node;
int __pyx_v_i;
int __pyx_v_ns_count;
PyObject *__pyx_v_event;
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
Py_INCREF(__pyx_v_self);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_event = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":506
 *         cdef _Element node
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 */
__pyx_1 = PyObject_CallObject(__pyx_v_self->_pop_node, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":506
 *         cdef _Element node
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 */
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":506
 *         cdef _Element node
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 */
  __pyx_4 = PyInt_AsLong(__pyx_3); if (unlikely((__pyx_4 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_ns_count = __pyx_4;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":506
 *         cdef _Element node
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 */
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":506
 *         cdef _Element node
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 */
  __pyx_4 = PyInt_AsLong(__pyx_3); if (unlikely((__pyx_4 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_v_ns_count = __pyx_4;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":507
 *         cdef int i, ns_count
 *         node, ns_count = self._pop_node()
 *         if self._event_filter & ITERPARSE_FILTER_END:             # <<<<<<<<<<<<<< 
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 */
__pyx_4 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":508
 *         node, ns_count = self._pop_node()
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \             # <<<<<<<<<<<<<< 
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("end", node))
 */
  __pyx_5 = (__pyx_v_self->_tag_tuple == Py_None);
  if (!__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":509
 *         if self._event_filter & ITERPARSE_FILTER_END:
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._events, ("end", node))
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 */
    __pyx_5 = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_node->_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":510
 *             if self._tag_tuple is None or \
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("end", node))             # <<<<<<<<<<<<<< 
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             event = ("end-ns", None)
 */
    __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 510; goto __pyx_L1;}
    Py_INCREF(__pyx_n_end);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_end);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_node));
    __pyx_4 = PyList_Append(__pyx_v_self->_events,__pyx_3); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 510; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":511
 *                    _tagMatches(node._c_node, self._tag_href, self._tag_name):
 *                 python.PyList_Append(self._events, ("end", node))
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:             # <<<<<<<<<<<<<< 
 *             event = ("end-ns", None)
 *             for i from 0 <= i < ns_count:
 */
__pyx_4 = (__pyx_v_self->_event_filter & __pyx_e_4lxml_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":512
 *                 python.PyList_Append(self._events, ("end", node))
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             event = ("end-ns", None)             # <<<<<<<<<<<<<< 
 *             for i from 0 <= i < ns_count:
 *                 python.PyList_Append(self._events, event)
 */
  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 512; goto __pyx_L1;}
  Py_INCREF(__pyx_k618p);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k618p);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_1, 1, Py_None);
  Py_DECREF(__pyx_v_event);
  __pyx_v_event = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":513
 *         if self._event_filter & ITERPARSE_FILTER_END_NS:
 *             event = ("end-ns", None)
 *             for i from 0 <= i < ns_count:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._events, event)
 *         return node
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_ns_count; __pyx_v_i++) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":514
 *             event = ("end-ns", None)
 *             for i from 0 <= i < ns_count:
 *                 python.PyList_Append(self._events, event)             # <<<<<<<<<<<<<< 
 *         return node
 */
    __pyx_4 = PyList_Append(__pyx_v_self->_events,__pyx_v_event); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 514; goto __pyx_L1;}
  }
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":515
 *             for i from 0 <= i < ns_count:
 *                 python.PyList_Append(self._events, event)
 *         return node             # <<<<<<<<<<<<<< 
 */
Py_INCREF(((PyObject *)__pyx_v_node));
__pyx_r = __pyx_v_node;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.iterwalk._end_node");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_event);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":3
 * cdef object _find_id_attributes
 * 
 * def XMLID(text):             # <<<<<<<<<<<<<< 
 *     """Parse the text and return a tuple (root node, ID dictionary).  The root
 *     node is the same as returned by the XML() function.  The dictionary
 */

static PyObject *__pyx_n_XML;

static PyObject *__pyx_k619p;

static char __pyx_k619[] = "//*[string(@id)]";

static PyObject *__pyx_pf_4lxml_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static char __pyx_doc_4lxml_5etree_XMLID[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_v_text) {
PyObject *__pyx_v_root;
PyObject *__pyx_v_dic;
PyObject *__pyx_v_elem;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_ssize_t __pyx_5;
PyObject *__pyx_6 = 0;
int __pyx_7;
Py_INCREF(__pyx_v_text);
__pyx_v_root = Py_None; Py_INCREF(Py_None);
__pyx_v_dic = Py_None; Py_INCREF(Py_None);
__pyx_v_elem = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":11
 *     """
 *     global _find_id_attributes
 *     if _find_id_attributes is None:             # <<<<<<<<<<<<<< 
 *         _find_id_attributes = XPath('//*[string(@id)]')
 * 
 */
__pyx_1 = (__pyx_v_4lxml_5etree__find_id_attributes == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":12
 *     global _find_id_attributes
 *     if _find_id_attributes is None:
 *         _find_id_attributes = XPath('//*[string(@id)]')             # <<<<<<<<<<<<<< 
 * 
 *     # ElementTree compatible implementation: parse and look for 'id' attributes
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_INCREF(__pyx_k619p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k619p);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_XPath), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_4lxml_5etree__find_id_attributes);
  __pyx_v_4lxml_5etree__find_id_attributes = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":15
 * 
 *     # ElementTree compatible implementation: parse and look for 'id' attributes
 *     root = XML(text)             # <<<<<<<<<<<<<< 
 *     dic = {}
 *     for elem in _find_id_attributes(root):
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XML); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":15
 * 
 *     # ElementTree compatible implementation: parse and look for 'id' attributes
 *     root = XML(text)             # <<<<<<<<<<<<<< 
 *     dic = {}
 *     for elem in _find_id_attributes(root):
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}
Py_INCREF(__pyx_v_text);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_text);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":16
 *     # ElementTree compatible implementation: parse and look for 'id' attributes
 *     root = XML(text)
 *     dic = {}             # <<<<<<<<<<<<<< 
 *     for elem in _find_id_attributes(root):
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_v_dic);
__pyx_v_dic = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":17
 *     root = XML(text)
 *     dic = {}
 *     for elem in _find_id_attributes(root):             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)
 *     return (root, dic)
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_root);
__pyx_4 = PyObject_CallObject(__pyx_v_4lxml_5etree__find_id_attributes, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (PyList_CheckExact(__pyx_4)) { __pyx_5 = 0; __pyx_2 = __pyx_4; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 17; goto __pyx_L1;} }
Py_DECREF(__pyx_4); __pyx_4 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":17
 *     root = XML(text)
 *     dic = {}
 *     for elem in _find_id_attributes(root):             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)
 *     return (root, dic)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_5++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  Py_DECREF(__pyx_v_elem);
  __pyx_v_elem = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":18
 *     dic = {}
 *     for elem in _find_id_attributes(root):
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)             # <<<<<<<<<<<<<< 
 *     return (root, dic)
 * 
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_elem, __pyx_n_get); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 18; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":18
 *     dic = {}
 *     for elem in _find_id_attributes(root):
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)             # <<<<<<<<<<<<<< 
 *     return (root, dic)
 * 
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_INCREF(__pyx_n_id);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_id);
  __pyx_6 = PyObject_CallObject(__pyx_4, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":18
 *     dic = {}
 *     for elem in _find_id_attributes(root):
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)             # <<<<<<<<<<<<<< 
 *     return (root, dic)
 * 
 */
  __pyx_7 = PyDict_SetItem(__pyx_v_dic,__pyx_6,__pyx_v_elem); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 18; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":19
 *     for elem in _find_id_attributes(root):
 *         python.PyDict_SetItem(dic, elem.get('id'), elem)
 *     return (root, dic)             # <<<<<<<<<<<<<< 
 * 
 * def XMLDTDID(text):
 */
__pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 19; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_root);
Py_INCREF(__pyx_v_dic);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_dic);
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree.XMLID");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_dic);
Py_DECREF(__pyx_v_elem);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":21
 *     return (root, dic)
 * 
 * def XMLDTDID(text):             # <<<<<<<<<<<<<< 
 *     """Parse the text and return a tuple (root node, ID dictionary).  The root
 *     node is the same as returned by the XML() function.  The dictionary
 */

static PyObject *__pyx_pf_4lxml_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_v_text); /*proto*/
static char __pyx_doc_4lxml_5etree_XMLDTDID[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_v_text) {
struct LxmlElement *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_text);
__pyx_v_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":32
 *     """
 *     cdef _Element root
 *     root = XML(text)             # <<<<<<<<<<<<<< 
 *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
 *     if root._doc._c_doc.ids is NULL:
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XML); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":32
 *     """
 *     cdef _Element root
 *     root = XML(text)             # <<<<<<<<<<<<<< 
 *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
 *     if root._doc._c_doc.ids is NULL:
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
Py_INCREF(__pyx_v_text);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_text);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root));
__pyx_v_root = ((struct LxmlElement *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":34
 *     root = XML(text)
 *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
 *     if root._doc._c_doc.ids is NULL:             # <<<<<<<<<<<<<< 
 *         return (root, {})
 *     else:
 */
__pyx_4 = (__pyx_v_root->_doc->_c_doc->ids == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":35
 *     # xml:id spec compatible implementation: use DTD ID attributes from libxml2
 *     if root._doc._c_doc.ids is NULL:
 *         return (root, {})             # <<<<<<<<<<<<<< 
 *     else:
 *         return (root, _IDDict(root))
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 35; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 35; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1);
  __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":37
 *         return (root, {})
 *     else:
 *         return (root, _IDDict(root))             # <<<<<<<<<<<<<< 
 * 
 * def parseid(source, parser=None):
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_root));
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__IDDict), __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_root));
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_1);
  __pyx_1 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XMLDTDID");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":39
 *         return (root, _IDDict(root))
 * 
 * def parseid(source, parser=None):             # <<<<<<<<<<<<<< 
 *     """Parses the source into a tuple containing an ElementTree object and an
 *     ID dictionary.  If no parser is provided as second argument, the default
 */

static PyObject *__pyx_pf_4lxml_5etree_parseid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_parseid[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_parseid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
PyObject *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"source","parser",0};
__pyx_v_parser = __pyx_k231;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser))) return NULL;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":48
 *     """
 *     cdef _Document doc
 *     doc = _parseDocument(source, parser)             # <<<<<<<<<<<<<< 
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 48; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_source,((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 48; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":49
 *     cdef _Document doc
 *     doc = _parseDocument(source, parser)
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))             # <<<<<<<<<<<<<< 
 * 
 * cdef class _IDDict:
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_doc,((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":49
 *     cdef _Document doc
 *     doc = _parseDocument(source, parser)
 *     return (_elementTreeFactory(doc, None), _IDDict(doc))             # <<<<<<<<<<<<<< 
 * 
 * cdef class _IDDict:
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_doc));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_doc));
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__IDDict), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_3);
__pyx_1 = 0;
__pyx_3 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.parseid");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":61
 *     cdef object _keys
 *     cdef object _items
 *     def __init__(self, etree):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         doc = _documentOrRaise(etree)
 */

static PyObject *__pyx_k621p;

static char __pyx_k621[] = "No ID dictionary available.";

static int __pyx_pf_4lxml_5etree_7_IDDict___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_7_IDDict___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
struct LxmlDocument *__pyx_v_doc;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"etree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":63
 *     def __init__(self, etree):
 *         cdef _Document doc
 *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *         if doc._c_doc.ids is NULL:
 *             raise ValueError, "No ID dictionary available."
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":64
 *         cdef _Document doc
 *         doc = _documentOrRaise(etree)
 *         if doc._c_doc.ids is NULL:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "No ID dictionary available."
 *         self._doc = doc
 */
__pyx_2 = (__pyx_v_doc->_c_doc->ids == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":65
 *         doc = _documentOrRaise(etree)
 *         if doc._c_doc.ids is NULL:
 *             raise ValueError, "No ID dictionary available."             # <<<<<<<<<<<<<< 
 *         self._doc = doc
 *         self._keys  = None
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k621p, 0);
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 65; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":66
 *         if doc._c_doc.ids is NULL:
 *             raise ValueError, "No ID dictionary available."
 *         self._doc = doc             # <<<<<<<<<<<<<< 
 *         self._keys  = None
 *         self._items = None
 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc = __pyx_v_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":67
 *             raise ValueError, "No ID dictionary available."
 *         self._doc = doc
 *         self._keys  = None             # <<<<<<<<<<<<<< 
 *         self._items = None
 * 
 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":68
 *         self._doc = doc
 *         self._keys  = None
 *         self._items = None             # <<<<<<<<<<<<<< 
 * 
 *     def copy(self):
 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = Py_None;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":70
 *         self._items = None
 * 
 *     def copy(self):             # <<<<<<<<<<<<<< 
 *         return _IDDict(self._doc)
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":71
 * 
 *     def copy(self):
 *         return _IDDict(self._doc)             # <<<<<<<<<<<<<< 
 * 
 *     def __getitem__(self, id_name):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 71; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc));
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__IDDict), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 71; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.copy");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":73
 *         return _IDDict(self._doc)
 * 
 *     def __getitem__(self, id_name):             # <<<<<<<<<<<<<< 
 *         cdef tree.xmlHashTable* c_ids
 *         cdef tree.xmlID* c_id
 */

static PyObject *__pyx_k622p;
static PyObject *__pyx_k623p;

static char __pyx_k622[] = "Key not found.";
static char __pyx_k623[] = "ID attribute not found.";

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
xmlHashTable *__pyx_v_c_ids;
xmlID *__pyx_v_c_id;
xmlAttr *__pyx_v_c_attr;
PyObject *__pyx_v_id_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);
__pyx_v_id_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":77
 *         cdef tree.xmlID* c_id
 *         cdef xmlAttr* c_attr
 *         c_ids = self._doc._c_doc.ids             # <<<<<<<<<<<<<< 
 *         id_utf = _utf8(id_name)
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
 */
__pyx_v_c_ids = ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":78
 *         cdef xmlAttr* c_attr
 *         c_ids = self._doc._c_doc.ids
 *         id_utf = _utf8(id_name)             # <<<<<<<<<<<<<< 
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
 *         if c_id is NULL:
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_id_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 78; goto __pyx_L1;}
Py_DECREF(__pyx_v_id_utf);
__pyx_v_id_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":79
 *         c_ids = self._doc._c_doc.ids
 *         id_utf = _utf8(id_name)
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))             # <<<<<<<<<<<<<< 
 *         if c_id is NULL:
 *             raise KeyError, "Key not found."
 */
__pyx_v_c_id = ((xmlID *)xmlHashLookup(__pyx_v_c_ids,_cstr(__pyx_v_id_utf)));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":80
 *         id_utf = _utf8(id_name)
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
 *         if c_id is NULL:             # <<<<<<<<<<<<<< 
 *             raise KeyError, "Key not found."
 *         c_attr = c_id.attr
 */
__pyx_2 = (__pyx_v_c_id == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":81
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(c_ids, _cstr(id_utf))
 *         if c_id is NULL:
 *             raise KeyError, "Key not found."             # <<<<<<<<<<<<<< 
 *         c_attr = c_id.attr
 *         if c_attr is NULL or c_attr.parent is NULL:
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k622p, 0);
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 81; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":82
 *         if c_id is NULL:
 *             raise KeyError, "Key not found."
 *         c_attr = c_id.attr             # <<<<<<<<<<<<<< 
 *         if c_attr is NULL or c_attr.parent is NULL:
 *             raise KeyError, "ID attribute not found."
 */
__pyx_v_c_attr = __pyx_v_c_id->attr;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":83
 *             raise KeyError, "Key not found."
 *         c_attr = c_id.attr
 *         if c_attr is NULL or c_attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *             raise KeyError, "ID attribute not found."
 *         return _elementFactory(self._doc, c_attr.parent)
 */
__pyx_2 = (__pyx_v_c_attr == NULL);
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":83
 *             raise KeyError, "Key not found."
 *         c_attr = c_id.attr
 *         if c_attr is NULL or c_attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *             raise KeyError, "ID attribute not found."
 *         return _elementFactory(self._doc, c_attr.parent)
 */
  __pyx_2 = (__pyx_v_c_attr->parent == NULL);
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":84
 *         c_attr = c_id.attr
 *         if c_attr is NULL or c_attr.parent is NULL:
 *             raise KeyError, "ID attribute not found."             # <<<<<<<<<<<<<< 
 *         return _elementFactory(self._doc, c_attr.parent)
 * 
 */
  __Pyx_Raise(__pyx_builtin_KeyError, __pyx_k623p, 0);
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 84; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":85
 *         if c_attr is NULL or c_attr.parent is NULL:
 *             raise KeyError, "ID attribute not found."
 *         return _elementFactory(self._doc, c_attr.parent)             # <<<<<<<<<<<<<< 
 * 
 *     def get(self, id_name):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 85; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict.__getitem__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_id_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":87
 *         return _elementFactory(self._doc, c_attr.parent)
 * 
 *     def get(self, id_name):             # <<<<<<<<<<<<<< 
 *         return self[id_name]
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":88
 * 
 *     def get(self, id_name):
 *         return self[id_name]             # <<<<<<<<<<<<<< 
 * 
 *     def __contains__(self, id_name):
 */
__pyx_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_id_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict.get");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":90
 *         return self[id_name]
 * 
 *     def __contains__(self, id_name):             # <<<<<<<<<<<<<< 
 *         cdef tree.xmlID* c_id
 *         id_utf = _utf8(id_name)
 */

static int __pyx_pf_4lxml_5etree_7_IDDict___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static int __pyx_pf_4lxml_5etree_7_IDDict___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
xmlID *__pyx_v_c_id;
PyObject *__pyx_v_id_utf;
int __pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);
__pyx_v_id_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":92
 *     def __contains__(self, id_name):
 *         cdef tree.xmlID* c_id
 *         id_utf = _utf8(id_name)             # <<<<<<<<<<<<<< 
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(
 *             self._doc._c_doc.ids, _cstr(id_utf))
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_id_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(__pyx_v_id_utf);
__pyx_v_id_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":94
 *         id_utf = _utf8(id_name)
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(
 *             self._doc._c_doc.ids, _cstr(id_utf))             # <<<<<<<<<<<<<< 
 *         return c_id is not NULL
 * 
 */
__pyx_v_c_id = ((xmlID *)xmlHashLookup(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids,_cstr(__pyx_v_id_utf)));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":95
 *         c_id = <tree.xmlID*>tree.xmlHashLookup(
 *             self._doc._c_doc.ids, _cstr(id_utf))
 *         return c_id is not NULL             # <<<<<<<<<<<<<< 
 * 
 *     def has_key(self, id_name):
 */
__pyx_r = (__pyx_v_c_id != NULL);
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict.__contains__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_id_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":97
 *         return c_id is not NULL
 * 
 *     def has_key(self, id_name):             # <<<<<<<<<<<<<< 
 *         return id_name in self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":98
 * 
 *     def has_key(self, id_name):
 *         return id_name in self             # <<<<<<<<<<<<<< 
 * 
 *     def __cmp__(self, other):
 */
__pyx_1 = (PySequence_Contains(__pyx_v_self, __pyx_v_id_name)); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.has_key");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":100
 *         return id_name in self
 * 
 *     def __cmp__(self, other):             # <<<<<<<<<<<<<< 
 *         if other is None:
 *             return 1
 */

static int __pyx_pf_4lxml_5etree_7_IDDict___cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static int __pyx_pf_4lxml_5etree_7_IDDict___cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_other);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":101
 * 
 *     def __cmp__(self, other):
 *         if other is None:             # <<<<<<<<<<<<<< 
 *             return 1
 *         else:
 */
__pyx_1 = (__pyx_v_other == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":102
 *     def __cmp__(self, other):
 *         if other is None:
 *             return 1             # <<<<<<<<<<<<<< 
 *         else:
 *             return cmp(dict(self), other)
 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":104
 *             return 1
 *         else:
 *             return cmp(dict(self), other)             # <<<<<<<<<<<<<< 
 * 
 *     def __richcmp__(self, other, int op):
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":104
 *             return 1
 *         else:
 *             return cmp(dict(self), other)             # <<<<<<<<<<<<<< 
 * 
 *     def __richcmp__(self, other, int op):
 */
  __pyx_4 = PyObject_Compare(__pyx_3,__pyx_v_other); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_4;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._IDDict.__cmp__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":106
 *             return cmp(dict(self), other)
 * 
 *     def __richcmp__(self, other, int op):             # <<<<<<<<<<<<<< 
 *         cdef int c_cmp
 *         if other is None:
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op) {
int __pyx_v_c_cmp;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_other);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":108
 *     def __richcmp__(self, other, int op):
 *         cdef int c_cmp
 *         if other is None:             # <<<<<<<<<<<<<< 
 *             return op == 0 or op == 1 or op == 3
 *         c_cmp = cmp(dict(self), other)
 */
__pyx_1 = (__pyx_v_other == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":109
 *         cdef int c_cmp
 *         if other is None:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 */
  __pyx_1 = (__pyx_v_op == 0);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":109
 *         cdef int c_cmp
 *         if other is None:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 */
    __pyx_1 = (__pyx_v_op == 1);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":109
 *         cdef int c_cmp
 *         if other is None:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 */
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 109; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":110
 *         if other is None:
 *             return op == 0 or op == 1 or op == 3
 *         c_cmp = cmp(dict(self), other)             # <<<<<<<<<<<<<< 
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":110
 *         if other is None:
 *             return op == 0 or op == 1 or op == 3
 *         c_cmp = cmp(dict(self), other)             # <<<<<<<<<<<<<< 
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5
 */
__pyx_4 = PyObject_Compare(__pyx_3,__pyx_v_other); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 110; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_v_c_cmp = __pyx_4;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":111
 *             return op == 0 or op == 1 or op == 3
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal             # <<<<<<<<<<<<<< 
 *             return op == 1 or op == 2 or op == 5
 *         elif c_cmp < 0:
 */
__pyx_1 = (__pyx_v_c_cmp == 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":112
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5             # <<<<<<<<<<<<<< 
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3
 */
  __pyx_1 = (__pyx_v_op == 1);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":112
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5             # <<<<<<<<<<<<<< 
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3
 */
    __pyx_1 = (__pyx_v_op == 2);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":112
 *         c_cmp = cmp(dict(self), other)
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5             # <<<<<<<<<<<<<< 
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3
 */
      __pyx_1 = (__pyx_v_op == 5);
    }
  }
  __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":113
 *         if c_cmp == 0: # equal
 *             return op == 1 or op == 2 or op == 5
 *         elif c_cmp < 0:             # <<<<<<<<<<<<<< 
 *             return op == 0 or op == 1 or op == 3
 *         else:
 */
__pyx_1 = (__pyx_v_c_cmp < 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":114
 *             return op == 1 or op == 2 or op == 5
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         else:
 *             return op == 4 or op == 5 or op == 3
 */
  __pyx_1 = (__pyx_v_op == 0);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":114
 *             return op == 1 or op == 2 or op == 5
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         else:
 *             return op == 4 or op == 5 or op == 3
 */
    __pyx_1 = (__pyx_v_op == 1);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":114
 *             return op == 1 or op == 2 or op == 5
 *         elif c_cmp < 0:
 *             return op == 0 or op == 1 or op == 3             # <<<<<<<<<<<<<< 
 *         else:
 *             return op == 4 or op == 5 or op == 3
 */
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_3 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 114; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":116
 *             return op == 0 or op == 1 or op == 3
 *         else:
 *             return op == 4 or op == 5 or op == 3             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
  __pyx_1 = (__pyx_v_op == 4);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":116
 *             return op == 0 or op == 1 or op == 3
 *         else:
 *             return op == 4 or op == 5 or op == 3             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
    __pyx_1 = (__pyx_v_op == 5);
    if (!__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":116
 *             return op == 0 or op == 1 or op == 3
 *         else:
 *             return op == 4 or op == 5 or op == 3             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
}
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._IDDict.__richcmp__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":118
 *             return op == 4 or op == 5 or op == 3
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return repr(dict(self))
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":119
 * 
 *     def __repr__(self):
 *         return repr(dict(self))             # <<<<<<<<<<<<<< 
 * 
 *     def keys(self):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyObject_CallObject(((PyObject*)&PyDict_Type), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_Repr(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.__repr__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":121
 *         return repr(dict(self))
 * 
 *     def keys(self):             # <<<<<<<<<<<<<< 
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_keys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_keys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":122
 * 
 *     def keys(self):
 *         if self._keys is None:             # <<<<<<<<<<<<<< 
 *             self._keys = self._build_keys()
 *         return self._keys[:]
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":123
 *     def keys(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return self._keys[:]
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 123; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":123
 *     def keys(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return self._keys[:]
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":124
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 *         return self._keys[:]             # <<<<<<<<<<<<<< 
 * 
 *     def __iter__(self):
 */
__pyx_2 = PySequence_GetSlice(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 124; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.keys");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":126
 *         return self._keys[:]
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<< 
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":127
 * 
 *     def __iter__(self):
 *         if self._keys is None:             # <<<<<<<<<<<<<< 
 *             self._keys = self._build_keys()
 *         return iter(self._keys)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":128
 *     def __iter__(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return iter(self._keys)
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 128; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":128
 *     def __iter__(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return iter(self._keys)
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":129
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 *         return iter(self._keys)             # <<<<<<<<<<<<<< 
 * 
 *     def iterkeys(self):
 */
__pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 129; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.__iter__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":131
 *         return iter(self._keys)
 * 
 *     def iterkeys(self):             # <<<<<<<<<<<<<< 
 *         return self
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":132
 * 
 *     def iterkeys(self):
 *         return self             # <<<<<<<<<<<<<< 
 * 
 *     def __len__(self):
 */
Py_INCREF(__pyx_v_self);
__pyx_r = __pyx_v_self;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":134
 *         return self
 * 
 *     def __len__(self):             # <<<<<<<<<<<<<< 
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 */

static Py_ssize_t __pyx_pf_4lxml_5etree_7_IDDict___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_4lxml_5etree_7_IDDict___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":135
 * 
 *     def __len__(self):
 *         if self._keys is None:             # <<<<<<<<<<<<<< 
 *             self._keys = self._build_keys()
 *         return len(self._keys)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":136
 *     def __len__(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return len(self._keys)
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 136; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":136
 *     def __len__(self):
 *         if self._keys is None:
 *             self._keys = self._build_keys()             # <<<<<<<<<<<<<< 
 *         return len(self._keys)
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":137
 *         if self._keys is None:
 *             self._keys = self._build_keys()
 *         return len(self._keys)             # <<<<<<<<<<<<<< 
 * 
 *     def items(self):
 */
__pyx_3 = PyObject_Length(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_keys); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 137; goto __pyx_L1;}
__pyx_r = __pyx_3;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.__len__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":139
 *         return len(self._keys)
 * 
 *     def items(self):             # <<<<<<<<<<<<<< 
 *         if self._items is None:
 *             self._items = self._build_items()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_items(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_items(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":140
 * 
 *     def items(self):
 *         if self._items is None:             # <<<<<<<<<<<<<< 
 *             self._items = self._build_items()
 *         return self._items[:]
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":141
 *     def items(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         return self._items[:]
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 141; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":141
 *     def items(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         return self._items[:]
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":142
 *         if self._items is None:
 *             self._items = self._build_items()
 *         return self._items[:]             # <<<<<<<<<<<<<< 
 * 
 *     def iteritems(self):
 */
__pyx_2 = PySequence_GetSlice(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 142; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.items");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":144
 *         return self._items[:]
 * 
 *     def iteritems(self):             # <<<<<<<<<<<<<< 
 *         if self._items is None:
 *             self._items = self._build_items()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iteritems(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_iteritems(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":145
 * 
 *     def iteritems(self):
 *         if self._items is None:             # <<<<<<<<<<<<<< 
 *             self._items = self._build_items()
 *         return iter(self._items)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":146
 *     def iteritems(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         return iter(self._items)
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 146; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":146
 *     def iteritems(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         return iter(self._items)
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":147
 *         if self._items is None:
 *             self._items = self._build_items()
 *         return iter(self._items)             # <<<<<<<<<<<<<< 
 * 
 *     def values(self):
 */
__pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.iteritems");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":149
 *         return iter(self._items)
 * 
 *     def values(self):             # <<<<<<<<<<<<<< 
 *         if self._items is None:
 *             self._items = self._build_items()
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_v_values;
PyObject *__pyx_v_item;
PyObject *__pyx_v_value;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF(__pyx_v_self);
__pyx_v_values = Py_None; Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":150
 * 
 *     def values(self):
 *         if self._items is None:             # <<<<<<<<<<<<<< 
 *             self._items = self._build_items()
 *         values = []
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":151
 *     def values(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         values = []
 *         for item in self._items:
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 151; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":151
 *     def values(self):
 *         if self._items is None:
 *             self._items = self._build_items()             # <<<<<<<<<<<<<< 
 *         values = []
 *         for item in self._items:
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":152
 *         if self._items is None:
 *             self._items = self._build_items()
 *         values = []             # <<<<<<<<<<<<<< 
 *         for item in self._items:
 *             value = python.PyTuple_GET_ITEM(item, 1)
 */
__pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 152; goto __pyx_L1;}
Py_DECREF(__pyx_v_values);
__pyx_v_values = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":153
 *             self._items = self._build_items()
 *         values = []
 *         for item in self._items:             # <<<<<<<<<<<<<< 
 *             value = python.PyTuple_GET_ITEM(item, 1)
 *             python.Py_INCREF(value)
 */
if (PyList_CheckExact(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items)) { __pyx_3 = 0; __pyx_2 = ((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(((struct __pyx_obj_4lxml_5etree__IDDict *)__pyx_v_self)->_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 153; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":153
 *             self._items = self._build_items()
 *         values = []
 *         for item in self._items:             # <<<<<<<<<<<<<< 
 *             value = python.PyTuple_GET_ITEM(item, 1)
 *             python.Py_INCREF(value)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_2);
    if (!__pyx_4) {
      break;
    }
  }
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":154
 *         values = []
 *         for item in self._items:
 *             value = python.PyTuple_GET_ITEM(item, 1)             # <<<<<<<<<<<<<< 
 *             python.Py_INCREF(value)
 *             python.PyList_Append(values, value)
 */
  __pyx_4 = PyTuple_GET_ITEM(__pyx_v_item,1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 154; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":155
 *         for item in self._items:
 *             value = python.PyTuple_GET_ITEM(item, 1)
 *             python.Py_INCREF(value)             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(values, value)
 *         return values
 */
  Py_INCREF(__pyx_v_value);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":156
 *             value = python.PyTuple_GET_ITEM(item, 1)
 *             python.Py_INCREF(value)
 *             python.PyList_Append(values, value)             # <<<<<<<<<<<<<< 
 *         return values
 * 
 */
  __pyx_5 = PyList_Append(__pyx_v_values,__pyx_v_value); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 156; goto __pyx_L1;}
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":157
 *             python.Py_INCREF(value)
 *             python.PyList_Append(values, value)
 *         return values             # <<<<<<<<<<<<<< 
 * 
 *     def itervalues(self):
 */
Py_INCREF(__pyx_v_values);
__pyx_r = __pyx_v_values;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._IDDict.values");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_values);
Py_DECREF(__pyx_v_item);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":159
 *         return values
 * 
 *     def itervalues(self):             # <<<<<<<<<<<<<< 
 *         return iter(self.values())
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_itervalues(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_7_IDDict_itervalues(PyObject *__pyx_v_self, PyObject *unused) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":160
 * 
 *     def itervalues(self):
 *         return iter(self.values())             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _build_keys(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_values); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 160; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 160; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 160; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._IDDict.itervalues");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":162
 *         return iter(self.values())
 * 
 *     cdef object _build_keys(self):             # <<<<<<<<<<<<<< 
 *         keys = []
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 */

static  PyObject *__pyx_f_4lxml_5etree_7_IDDict__build_keys(struct __pyx_obj_4lxml_5etree__IDDict *__pyx_v_self) {
PyObject *__pyx_v_keys;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_keys = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":163
 * 
 *     cdef object _build_keys(self):
 *         keys = []             # <<<<<<<<<<<<<< 
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashKeys, <python.PyObject*>keys)
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_v_keys);
__pyx_v_keys = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":165
 *         keys = []
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashKeys, <python.PyObject*>keys)             # <<<<<<<<<<<<<< 
 *         return keys
 * 
 */
xmlHashScan(((xmlHashTable *)__pyx_v_self->_doc->_c_doc->ids),__pyx_f_4lxml_5etree__collectIdHashKeys,((PyObject *)__pyx_v_keys));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":166
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashKeys, <python.PyObject*>keys)
 *         return keys             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _build_items(self):
 */
Py_INCREF(__pyx_v_keys);
__pyx_r = __pyx_v_keys;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict._build_keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_keys);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":168
 *         return keys
 * 
 *     cdef object _build_items(self):             # <<<<<<<<<<<<<< 
 *         items = []
 *         context = (items, self._doc)
 */

static  PyObject *__pyx_f_4lxml_5etree_7_IDDict__build_items(struct __pyx_obj_4lxml_5etree__IDDict *__pyx_v_self) {
PyObject *__pyx_v_items;
PyObject *__pyx_v_context;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_items = Py_None; Py_INCREF(Py_None);
__pyx_v_context = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":169
 * 
 *     cdef object _build_items(self):
 *         items = []             # <<<<<<<<<<<<<< 
 *         context = (items, self._doc)
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 169; goto __pyx_L1;}
Py_DECREF(__pyx_v_items);
__pyx_v_items = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":170
 *     cdef object _build_items(self):
 *         items = []
 *         context = (items, self._doc)             # <<<<<<<<<<<<<< 
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashItemList, <python.PyObject*>context)
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 170; goto __pyx_L1;}
Py_INCREF(__pyx_v_items);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_items);
Py_INCREF(((PyObject *)__pyx_v_self->_doc));
PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_self->_doc));
Py_DECREF(__pyx_v_context);
__pyx_v_context = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":172
 *         context = (items, self._doc)
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashItemList, <python.PyObject*>context)             # <<<<<<<<<<<<<< 
 *         return items
 * 
 */
xmlHashScan(((xmlHashTable *)__pyx_v_self->_doc->_c_doc->ids),__pyx_f_4lxml_5etree__collectIdHashItemList,((PyObject *)__pyx_v_context));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":173
 *         tree.xmlHashScan(<tree.xmlHashTable*>self._doc._c_doc.ids,
 *                          _collectIdHashItemList, <python.PyObject*>context)
 *         return items             # <<<<<<<<<<<<<< 
 * 
 * cdef void _collectIdHashItemDict(void* payload, void* context, char* name):
 */
Py_INCREF(__pyx_v_items);
__pyx_r = __pyx_v_items;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._IDDict._build_items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_items);
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":175
 *         return items
 * 
 * cdef void _collectIdHashItemDict(void* payload, void* context, char* name):             # <<<<<<<<<<<<<< 
 *     # collect elements from ID attribute hash table
 *     cdef tree.xmlID* c_id
 */

static  void __pyx_f_4lxml_5etree__collectIdHashItemDict(void *__pyx_v_payload,void *__pyx_v_context,char *__pyx_v_name) {
xmlID *__pyx_v_c_id;
PyObject *__pyx_v_dic;
PyObject *__pyx_v_doc;
PyObject *__pyx_v_element;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
__pyx_v_dic = Py_None; Py_INCREF(Py_None);
__pyx_v_doc = Py_None; Py_INCREF(Py_None);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":178
 *     # collect elements from ID attribute hash table
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<< 
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 */
__pyx_v_c_id = ((xmlID *)__pyx_v_payload);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":179
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     dic, doc = <object>context
 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":179
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     dic, doc = <object>context
 */
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":179
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     dic, doc = <object>context
 */
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":180
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     dic, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":181
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     dic, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)
 */
__pyx_2 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_2);
if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":181
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     dic, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)
 */
  Py_DECREF(__pyx_v_dic);
  __pyx_v_dic = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 1);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":181
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     dic, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)
 */
  Py_DECREF(__pyx_v_doc);
  __pyx_v_doc = __pyx_4;
  __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
else {
  __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":181
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     dic, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)
 */
  Py_DECREF(__pyx_v_dic);
  __pyx_v_dic = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":181
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     dic, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)
 */
  Py_DECREF(__pyx_v_doc);
  __pyx_v_doc = __pyx_4;
  __pyx_4 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":182
 *         return
 *     dic, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<< 
 *     python.PyDict_SetItem(dic, funicode(name), element)
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 182; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":182
 *         return
 *     dic, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<< 
 *     python.PyDict_SetItem(dic, funicode(name), element)
 * 
 */
__pyx_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_id->attr->parent)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":183
 *     dic, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _collectIdHashItemList(void* payload, void* context, char* name):
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 183; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":183
 *     dic, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyDict_SetItem(dic, funicode(name), element)             # <<<<<<<<<<<<<< 
 * 
 * cdef void _collectIdHashItemList(void* payload, void* context, char* name):
 */
__pyx_5 = PyDict_SetItem(__pyx_v_dic,__pyx_2,__pyx_v_element); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 183; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._collectIdHashItemDict");
__pyx_L0:;
Py_DECREF(__pyx_v_dic);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":185
 *     python.PyDict_SetItem(dic, funicode(name), element)
 * 
 * cdef void _collectIdHashItemList(void* payload, void* context, char* name):             # <<<<<<<<<<<<<< 
 *     # collect elements from ID attribute hash table
 *     cdef tree.xmlID* c_id
 */

static  void __pyx_f_4lxml_5etree__collectIdHashItemList(void *__pyx_v_payload,void *__pyx_v_context,char *__pyx_v_name) {
xmlID *__pyx_v_c_id;
PyObject *__pyx_v_lst;
PyObject *__pyx_v_doc;
PyObject *__pyx_v_element;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
__pyx_v_lst = Py_None; Py_INCREF(Py_None);
__pyx_v_doc = Py_None; Py_INCREF(Py_None);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":188
 *     # collect elements from ID attribute hash table
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<< 
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 */
__pyx_v_c_id = ((xmlID *)__pyx_v_payload);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":189
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     lst, doc = <object>context
 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":189
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     lst, doc = <object>context
 */
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":189
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     lst, doc = <object>context
 */
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":190
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     lst, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":191
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     lst, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))
 */
__pyx_2 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_2);
if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 0);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":191
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     lst, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))
 */
  Py_DECREF(__pyx_v_lst);
  __pyx_v_lst = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = PyTuple_GET_ITEM(__pyx_2, 1);
  Py_INCREF(__pyx_4);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":191
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     lst, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))
 */
  Py_DECREF(__pyx_v_doc);
  __pyx_v_doc = __pyx_4;
  __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
else {
  __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":191
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     lst, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))
 */
  Py_DECREF(__pyx_v_lst);
  __pyx_v_lst = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":191
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     lst, doc = <object>context             # <<<<<<<<<<<<<< 
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))
 */
  Py_DECREF(__pyx_v_doc);
  __pyx_v_doc = __pyx_4;
  __pyx_4 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":192
 *         return
 *     lst, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<< 
 *     python.PyList_Append(lst, (funicode(name), element))
 * 
 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 192; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":192
 *         return
 *     lst, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)             # <<<<<<<<<<<<<< 
 *     python.PyList_Append(lst, (funicode(name), element))
 * 
 */
__pyx_4 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_id->attr->parent)); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 192; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":193
 *     lst, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))             # <<<<<<<<<<<<<< 
 * 
 * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 193; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":193
 *     lst, doc = <object>context
 *     element = _elementFactory(doc, c_id.attr.parent)
 *     python.PyList_Append(lst, (funicode(name), element))             # <<<<<<<<<<<<<< 
 * 
 * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 193; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
Py_INCREF(__pyx_v_element);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_element);
__pyx_2 = 0;
__pyx_5 = PyList_Append(__pyx_v_lst,__pyx_3); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 193; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._collectIdHashItemList");
__pyx_L0:;
Py_DECREF(__pyx_v_lst);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":195
 *     python.PyList_Append(lst, (funicode(name), element))
 * 
 * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):             # <<<<<<<<<<<<<< 
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 */

static  void __pyx_f_4lxml_5etree__collectIdHashKeys(void *__pyx_v_payload,void *__pyx_v_collect_list,char *__pyx_v_name) {
xmlID *__pyx_v_c_id;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":197
 * cdef void _collectIdHashKeys(void* payload, void* collect_list, char* name):
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload             # <<<<<<<<<<<<<< 
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 */
__pyx_v_c_id = ((xmlID *)__pyx_v_payload);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":198
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     python.PyList_Append(<object>collect_list, funicode(name))
 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":198
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     python.PyList_Append(<object>collect_list, funicode(name))
 */
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":198
 *     cdef tree.xmlID* c_id
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:             # <<<<<<<<<<<<<< 
 *         return
 *     python.PyList_Append(<object>collect_list, funicode(name))
 */
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":199
 *     c_id = <tree.xmlID*>payload
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return             # <<<<<<<<<<<<<< 
 *     python.PyList_Append(<object>collect_list, funicode(name))
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":200
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     python.PyList_Append(<object>collect_list, funicode(name))             # <<<<<<<<<<<<<< 
 */
__pyx_2 = (PyObject *)__pyx_v_collect_list;
Py_INCREF(__pyx_2);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":200
 *     if c_id is NULL or c_id.attr is NULL or c_id.attr.parent is NULL:
 *         return
 *     python.PyList_Append(<object>collect_list, funicode(name))             # <<<<<<<<<<<<<< 
 */
__pyx_3 = __pyx_f_4lxml_5etree_funicode(__pyx_v_name); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 200; goto __pyx_L1;}
__pyx_4 = PyList_Append(__pyx_2,__pyx_3); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 200; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("lxml.etree._collectIdHashKeys");
__pyx_L0:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":44
 *     cdef _ExceptionContext _exc
 * 
 *     def __init__(self, namespaces, extensions, enable_regexp):             # <<<<<<<<<<<<<< 
 *         cdef _ExsltRegExp _regexp 
 *         self._utf_refs = {}
 */

static PyObject *__pyx_k624p;
static PyObject *__pyx_k625p;
static PyObject *__pyx_k626p;

static char __pyx_k624[] = "extensions must have non empty names";
static char __pyx_k625[] = "empty namespace prefix is not supported in XPath";
static char __pyx_k626[] = "setting default namespace is not supported in XPath";

static int __pyx_pf_4lxml_5etree_12_BaseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_12_BaseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_enable_regexp = 0;
struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v__regexp;
PyObject *__pyx_v_new_extensions;
PyObject *__pyx_v_extension;
PyObject *__pyx_v_ns_uri;
PyObject *__pyx_v_name;
PyObject *__pyx_v_function;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
Py_ssize_t __pyx_5;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
PyObject *__pyx_8 = 0;
PyObject *__pyx_9 = 0;
PyObject *__pyx_10 = 0;
int __pyx_11;
int __pyx_12;
static char *__pyx_argnames[] = {"namespaces","extensions","enable_regexp",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_enable_regexp))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
__pyx_v__regexp = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)Py_None); Py_INCREF(Py_None);
__pyx_v_new_extensions = Py_None; Py_INCREF(Py_None);
__pyx_v_extension = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_function = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":46
 *     def __init__(self, namespaces, extensions, enable_regexp):
 *         cdef _ExsltRegExp _regexp 
 *         self._utf_refs = {}             # <<<<<<<<<<<<<< 
 *         self._global_namespaces = []
 *         self._function_cache = {}
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":46
 *     def __init__(self, namespaces, extensions, enable_regexp):
 *         cdef _ExsltRegExp _regexp 
 *         self._utf_refs = {}             # <<<<<<<<<<<<<< 
 *         self._global_namespaces = []
 *         self._function_cache = {}
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_utf_refs);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_utf_refs = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":47
 *         cdef _ExsltRegExp _regexp 
 *         self._utf_refs = {}
 *         self._global_namespaces = []             # <<<<<<<<<<<<<< 
 *         self._function_cache = {}
 *         self._eval_context_dict = None
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 47; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":47
 *         cdef _ExsltRegExp _regexp 
 *         self._utf_refs = {}
 *         self._global_namespaces = []             # <<<<<<<<<<<<<< 
 *         self._function_cache = {}
 *         self._eval_context_dict = None
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_global_namespaces);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_global_namespaces = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":48
 *         self._utf_refs = {}
 *         self._global_namespaces = []
 *         self._function_cache = {}             # <<<<<<<<<<<<<< 
 *         self._eval_context_dict = None
 * 
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 48; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":48
 *         self._utf_refs = {}
 *         self._global_namespaces = []
 *         self._function_cache = {}             # <<<<<<<<<<<<<< 
 *         self._eval_context_dict = None
 * 
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_function_cache);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_function_cache = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":49
 *         self._global_namespaces = []
 *         self._function_cache = {}
 *         self._eval_context_dict = None             # <<<<<<<<<<<<<< 
 * 
 *         if extensions is not None:
 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":51
 *         self._eval_context_dict = None
 * 
 *         if extensions is not None:             # <<<<<<<<<<<<<< 
 *             # convert extensions to UTF-8
 *             if python.PyDict_Check(extensions):
 */
__pyx_2 = (__pyx_v_extensions != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":53
 *         if extensions is not None:
 *             # convert extensions to UTF-8
 *             if python.PyDict_Check(extensions):             # <<<<<<<<<<<<<< 
 *                 extensions = (extensions,)
 *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
 */
  __pyx_2 = PyDict_Check(__pyx_v_extensions);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":54
 *             # convert extensions to UTF-8
 *             if python.PyDict_Check(extensions):
 *                 extensions = (extensions,)             # <<<<<<<<<<<<<< 
 *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
 *             new_extensions = {}
 */
    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 54; goto __pyx_L1;}
    Py_INCREF(__pyx_v_extensions);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_extensions);
    Py_DECREF(__pyx_v_extensions);
    __pyx_v_extensions = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":56
 *                 extensions = (extensions,)
 *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
 *             new_extensions = {}             # <<<<<<<<<<<<<< 
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 56; goto __pyx_L1;}
  Py_DECREF(__pyx_v_new_extensions);
  __pyx_v_new_extensions = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":57
 *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
 *             new_extensions = {}
 *             for extension in extensions:             # <<<<<<<<<<<<<< 
 *                 for (ns_uri, name), function in extension.items():
 *                     if name is None:
 */
  if (PyList_CheckExact(__pyx_v_extensions)) { __pyx_3 = 0; __pyx_1 = __pyx_v_extensions; Py_INCREF(__pyx_1); }
  else { __pyx_1 = PyObject_GetIter(__pyx_v_extensions); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 57; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":57
 *             # format: [ {(ns, name):function} ] -> {(ns_utf, name_utf):function}
 *             new_extensions = {}
 *             for extension in extensions:             # <<<<<<<<<<<<<< 
 *                 for (ns_uri, name), function in extension.items():
 *                     if name is None:
 */
    if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_4 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_1);
      if (!__pyx_4) {
        break;
      }
    }
    Py_DECREF(__pyx_v_extension);
    __pyx_v_extension = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
    __pyx_4 = PyObject_GetAttr(__pyx_v_extension, __pyx_n_items); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
    __pyx_6 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (PyList_CheckExact(__pyx_6)) { __pyx_5 = 0; __pyx_4 = __pyx_6; Py_INCREF(__pyx_4); }
    else { __pyx_4 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;} }
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
      if (PyList_CheckExact(__pyx_4)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_6 = PyList_GET_ITEM(__pyx_4, __pyx_5++); Py_INCREF(__pyx_6); }
      else {
        __pyx_6 = PyIter_Next(__pyx_4);
        if (!__pyx_6) {
          break;
        }
      }
      if (PyTuple_CheckExact(__pyx_6) && PyTuple_GET_SIZE(__pyx_6) == 2) {
        __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 0);
        Py_INCREF(__pyx_8);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
        if (PyTuple_CheckExact(__pyx_8) && PyTuple_GET_SIZE(__pyx_8) == 2) {
          __pyx_10 = PyTuple_GET_ITEM(__pyx_8, 0);
          Py_INCREF(__pyx_10);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_ns_uri);
          __pyx_v_ns_uri = __pyx_10;
          __pyx_10 = 0;
          __pyx_10 = PyTuple_GET_ITEM(__pyx_8, 1);
          Py_INCREF(__pyx_10);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_name);
          __pyx_v_name = __pyx_10;
          __pyx_10 = 0;
          Py_DECREF(__pyx_8); __pyx_8 = 0;
        }
        else {
          __pyx_9 = PyObject_GetIter(__pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
          Py_DECREF(__pyx_8); __pyx_8 = 0;
          __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_ns_uri);
          __pyx_v_ns_uri = __pyx_10;
          __pyx_10 = 0;
          __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_name);
          __pyx_v_name = __pyx_10;
          __pyx_10 = 0;
          if (__Pyx_EndUnpack(__pyx_9) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
          Py_DECREF(__pyx_9); __pyx_9 = 0;
        }
        __pyx_10 = PyTuple_GET_ITEM(__pyx_6, 1);
        Py_INCREF(__pyx_10);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
        Py_DECREF(__pyx_v_function);
        __pyx_v_function = __pyx_10;
        __pyx_10 = 0;
        Py_DECREF(__pyx_6); __pyx_6 = 0;
      }
      else {
        __pyx_7 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
        Py_DECREF(__pyx_6); __pyx_6 = 0;
        __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
        if (PyTuple_CheckExact(__pyx_8) && PyTuple_GET_SIZE(__pyx_8) == 2) {
          __pyx_10 = PyTuple_GET_ITEM(__pyx_8, 0);
          Py_INCREF(__pyx_10);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_ns_uri);
          __pyx_v_ns_uri = __pyx_10;
          __pyx_10 = 0;
          __pyx_10 = PyTuple_GET_ITEM(__pyx_8, 1);
          Py_INCREF(__pyx_10);

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_name);
          __pyx_v_name = __pyx_10;
          __pyx_10 = 0;
          Py_DECREF(__pyx_8); __pyx_8 = 0;
        }
        else {
          __pyx_9 = PyObject_GetIter(__pyx_8); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
          Py_DECREF(__pyx_8); __pyx_8 = 0;
          __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_ns_uri);
          __pyx_v_ns_uri = __pyx_10;
          __pyx_10 = 0;
          __pyx_10 = __Pyx_UnpackItem(__pyx_9); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

          /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
          Py_DECREF(__pyx_v_name);
          __pyx_v_name = __pyx_10;
          __pyx_10 = 0;
          if (__Pyx_EndUnpack(__pyx_9) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
          Py_DECREF(__pyx_9); __pyx_9 = 0;
        }
        __pyx_10 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":58
 *             new_extensions = {}
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():             # <<<<<<<<<<<<<< 
 *                     if name is None:
 *                         raise ValueError, \
 */
        Py_DECREF(__pyx_v_function);
        __pyx_v_function = __pyx_10;
        __pyx_10 = 0;
        if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 58; goto __pyx_L1;}
        Py_DECREF(__pyx_7); __pyx_7 = 0;
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":59
 *             for extension in extensions:
 *                 for (ns_uri, name), function in extension.items():
 *                     if name is None:             # <<<<<<<<<<<<<< 
 *                         raise ValueError, \
 *                               "extensions must have non empty names"
 */
      __pyx_2 = (__pyx_v_name == Py_None);
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":61
 *                     if name is None:
 *                         raise ValueError, \
 *                               "extensions must have non empty names"             # <<<<<<<<<<<<<< 
 *                     ns_utf   = self._to_utf(ns_uri)
 *                     name_utf = self._to_utf(name)
 */
        __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k624p, 0);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 60; goto __pyx_L1;}
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":62
 *                         raise ValueError, \
 *                               "extensions must have non empty names"
 *                     ns_utf   = self._to_utf(ns_uri)             # <<<<<<<<<<<<<< 
 *                     name_utf = self._to_utf(name)
 *                     python.PyDict_SetItem(
 */
      __pyx_8 = ((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_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 62; goto __pyx_L1;}
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_8;
      __pyx_8 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":63
 *                               "extensions must have non empty names"
 *                     ns_utf   = self._to_utf(ns_uri)
 *                     name_utf = self._to_utf(name)             # <<<<<<<<<<<<<< 
 *                     python.PyDict_SetItem(
 *                         new_extensions, (ns_utf, name_utf), function)
 */
      __pyx_9 = ((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_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 63; goto __pyx_L1;}
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_9;
      __pyx_9 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":65
 *                     name_utf = self._to_utf(name)
 *                     python.PyDict_SetItem(
 *                         new_extensions, (ns_utf, name_utf), function)             # <<<<<<<<<<<<<< 
 *             extensions = new_extensions or None
 * 
 */
      __pyx_10 = PyTuple_New(2); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 65; goto __pyx_L1;}
      Py_INCREF(__pyx_v_ns_utf);
      PyTuple_SET_ITEM(__pyx_10, 0, __pyx_v_ns_utf);
      Py_INCREF(__pyx_v_name_utf);
      PyTuple_SET_ITEM(__pyx_10, 1, __pyx_v_name_utf);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":65
 *                     name_utf = self._to_utf(name)
 *                     python.PyDict_SetItem(
 *                         new_extensions, (ns_utf, name_utf), function)             # <<<<<<<<<<<<<< 
 *             extensions = new_extensions or None
 * 
 */
      __pyx_11 = PyDict_SetItem(__pyx_v_new_extensions,__pyx_10,__pyx_v_function); if (unlikely(__pyx_11 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 64; goto __pyx_L1;}
      Py_DECREF(__pyx_10); __pyx_10 = 0;
    }
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":66
 *                     python.PyDict_SetItem(
 *                         new_extensions, (ns_utf, name_utf), function)
 *             extensions = new_extensions or None             # <<<<<<<<<<<<<< 
 * 
 *         if namespaces is not None:
 */
  __pyx_6 = __pyx_v_new_extensions;
  Py_INCREF(__pyx_6);
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 66; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_6); __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":66
 *                     python.PyDict_SetItem(
 *                         new_extensions, (ns_utf, name_utf), function)
 *             extensions = new_extensions or None             # <<<<<<<<<<<<<< 
 * 
 *         if namespaces is not None:
 */
    __pyx_6 = Py_None;
    Py_INCREF(__pyx_6);
  }
  Py_DECREF(__pyx_v_extensions);
  __pyx_v_extensions = __pyx_6;
  __pyx_6 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":68
 *             extensions = new_extensions or None
 * 
 *         if namespaces is not None:             # <<<<<<<<<<<<<< 
 *             if python.PyDict_Check(namespaces):
 *                 namespaces = namespaces.items()
 */
__pyx_2 = (__pyx_v_namespaces != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":69
 * 
 *         if namespaces is not None:
 *             if python.PyDict_Check(namespaces):             # <<<<<<<<<<<<<< 
 *                 namespaces = namespaces.items()
 *             if namespaces:
 */
  __pyx_2 = PyDict_Check(__pyx_v_namespaces);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":70
 *         if namespaces is not None:
 *             if python.PyDict_Check(namespaces):
 *                 namespaces = namespaces.items()             # <<<<<<<<<<<<<< 
 *             if namespaces:
 *                 ns = []
 */
    __pyx_7 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_n_items); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 70; goto __pyx_L1;}
    __pyx_8 = PyObject_CallObject(__pyx_7, 0); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 70; goto __pyx_L1;}
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    Py_DECREF(__pyx_v_namespaces);
    __pyx_v_namespaces = __pyx_8;
    __pyx_8 = 0;
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":71
 *             if python.PyDict_Check(namespaces):
 *                 namespaces = namespaces.items()
 *             if namespaces:             # <<<<<<<<<<<<<< 
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:
 */
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_namespaces); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 71; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":72
 *                 namespaces = namespaces.items()
 *             if namespaces:
 *                 ns = []             # <<<<<<<<<<<<<< 
 *                 for prefix, ns_uri in namespaces:
 *                     if prefix is None or not prefix:
 */
    __pyx_9 = PyList_New(0); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 72; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ns);
    __pyx_v_ns = __pyx_9;
    __pyx_9 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
    if (PyList_CheckExact(__pyx_v_namespaces)) { __pyx_5 = 0; __pyx_10 = __pyx_v_namespaces; Py_INCREF(__pyx_10); }
    else { __pyx_10 = PyObject_GetIter(__pyx_v_namespaces); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; goto __pyx_L1;} }
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
      if (PyList_CheckExact(__pyx_10)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_10)) break; __pyx_4 = PyList_GET_ITEM(__pyx_10, __pyx_5++); Py_INCREF(__pyx_4); }
      else {
        __pyx_4 = PyIter_Next(__pyx_10);
        if (!__pyx_4) {
          break;
        }
      }
      if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
        __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
        Py_INCREF(__pyx_6);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
        Py_DECREF(__pyx_v_prefix);
        __pyx_v_prefix = __pyx_6;
        __pyx_6 = 0;
        __pyx_7 = PyTuple_GET_ITEM(__pyx_4, 1);
        Py_INCREF(__pyx_7);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
        Py_DECREF(__pyx_v_ns_uri);
        __pyx_v_ns_uri = __pyx_7;
        __pyx_7 = 0;
        Py_DECREF(__pyx_4); __pyx_4 = 0;
      }
      else {
        __pyx_1 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; goto __pyx_L1;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_6 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
        Py_DECREF(__pyx_v_prefix);
        __pyx_v_prefix = __pyx_6;
        __pyx_6 = 0;
        __pyx_7 = __Pyx_UnpackItem(__pyx_1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; goto __pyx_L1;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":73
 *             if namespaces:
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:             # <<<<<<<<<<<<<< 
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 */
        Py_DECREF(__pyx_v_ns_uri);
        __pyx_v_ns_uri = __pyx_7;
        __pyx_7 = 0;
        if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 73; goto __pyx_L1;}
        Py_DECREF(__pyx_1); __pyx_1 = 0;
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":74
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:
 *                     if prefix is None or not prefix:             # <<<<<<<<<<<<<< 
 *                         raise TypeError, \
 *                               "empty namespace prefix is not supported in XPath"
 */
      __pyx_2 = (__pyx_v_prefix == Py_None);
      if (!__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":74
 *                 ns = []
 *                 for prefix, ns_uri in namespaces:
 *                     if prefix is None or not prefix:             # <<<<<<<<<<<<<< 
 *                         raise TypeError, \
 *                               "empty namespace prefix is not supported in XPath"
 */
        __pyx_12 = __Pyx_PyObject_IsTrue(__pyx_v_prefix); if (unlikely(__pyx_12 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 74; goto __pyx_L1;}
        __pyx_2 = (!__pyx_12);
      }
      if (__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":76
 *                     if prefix is None or not prefix:
 *                         raise TypeError, \
 *                               "empty namespace prefix is not supported in XPath"             # <<<<<<<<<<<<<< 
 *                     if ns_uri is None or not ns_uri:
 *                         raise TypeError, \
 */
        __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k625p, 0);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 75; goto __pyx_L1;}
        goto __pyx_L14;
      }
      __pyx_L14:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":77
 *                         raise TypeError, \
 *                               "empty namespace prefix is not supported in XPath"
 *                     if ns_uri is None or not ns_uri:             # <<<<<<<<<<<<<< 
 *                         raise TypeError, \
 *                               "setting default namespace is not supported in XPath"
 */
      __pyx_12 = (__pyx_v_ns_uri == Py_None);
      if (!__pyx_12) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":77
 *                         raise TypeError, \
 *                               "empty namespace prefix is not supported in XPath"
 *                     if ns_uri is None or not ns_uri:             # <<<<<<<<<<<<<< 
 *                         raise TypeError, \
 *                               "setting default namespace is not supported in XPath"
 */
        __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_ns_uri); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 77; goto __pyx_L1;}
        __pyx_12 = (!__pyx_2);
      }
      if (__pyx_12) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":79
 *                     if ns_uri is None or not ns_uri:
 *                         raise TypeError, \
 *                               "setting default namespace is not supported in XPath"             # <<<<<<<<<<<<<< 
 *                     prefix_utf = self._to_utf(prefix)
 *                     ns_uri_utf = self._to_utf(ns_uri)
 */
        __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k626p, 0);
        {__pyx_filename = __pyx_f[12]; __pyx_lineno = 78; goto __pyx_L1;}
        goto __pyx_L15;
      }
      __pyx_L15:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":80
 *                         raise TypeError, \
 *                               "setting default namespace is not supported in XPath"
 *                     prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<< 
 *                     ns_uri_utf = self._to_utf(ns_uri)
 *                     python.PyList_Append(ns, (prefix_utf, ns_uri_utf))
 */
      __pyx_8 = ((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_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 80; goto __pyx_L1;}
      Py_DECREF(__pyx_v_prefix_utf);
      __pyx_v_prefix_utf = __pyx_8;
      __pyx_8 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":81
 *                               "setting default namespace is not supported in XPath"
 *                     prefix_utf = self._to_utf(prefix)
 *                     ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<< 
 *                     python.PyList_Append(ns, (prefix_utf, ns_uri_utf))
 *                 namespaces = ns
 */
      __pyx_9 = ((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_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 81; goto __pyx_L1;}
      Py_DECREF(__pyx_v_ns_uri_utf);
      __pyx_v_ns_uri_utf = __pyx_9;
      __pyx_9 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":82
 *                     prefix_utf = self._to_utf(prefix)
 *                     ns_uri_utf = self._to_utf(ns_uri)
 *                     python.PyList_Append(ns, (prefix_utf, ns_uri_utf))             # <<<<<<<<<<<<<< 
 *                 namespaces = ns
 *             else:
 */
      __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 82; goto __pyx_L1;}
      Py_INCREF(__pyx_v_prefix_utf);
      PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_prefix_utf);
      Py_INCREF(__pyx_v_ns_uri_utf);
      PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_ns_uri_utf);
      __pyx_11 = PyList_Append(__pyx_v_ns,__pyx_6); if (unlikely(__pyx_11 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 82; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
    }
    Py_DECREF(__pyx_10); __pyx_10 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":83
 *                     ns_uri_utf = self._to_utf(ns_uri)
 *                     python.PyList_Append(ns, (prefix_utf, ns_uri_utf))
 *                 namespaces = ns             # <<<<<<<<<<<<<< 
 *             else:
 *                 namespaces = None
 */
    Py_INCREF(__pyx_v_ns);
    Py_DECREF(__pyx_v_namespaces);
    __pyx_v_namespaces = __pyx_v_ns;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":85
 *                 namespaces = ns
 *             else:
 *                 namespaces = None             # <<<<<<<<<<<<<< 
 * 
 *         self._doc        = None
 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_namespaces);
    __pyx_v_namespaces = Py_None;
  }
  __pyx_L11:;
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":87
 *                 namespaces = None
 * 
 *         self._doc        = None             # <<<<<<<<<<<<<< 
 *         self._exc        = _ExceptionContext()
 *         self._extensions = extensions
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc));
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":88
 * 
 *         self._doc        = None
 *         self._exc        = _ExceptionContext()             # <<<<<<<<<<<<<< 
 *         self._extensions = extensions
 *         self._namespaces = namespaces
 */
__pyx_7 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext), 0); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 88; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_7, __pyx_ptype_4lxml_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 88; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":88
 * 
 *         self._doc        = None
 *         self._exc        = _ExceptionContext()             # <<<<<<<<<<<<<< 
 *         self._extensions = extensions
 *         self._namespaces = namespaces
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_exc));
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_7);
__pyx_7 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":89
 *         self._doc        = None
 *         self._exc        = _ExceptionContext()
 *         self._extensions = extensions             # <<<<<<<<<<<<<< 
 *         self._namespaces = namespaces
 *         self._temp_refs  = _TempStore()
 */
Py_INCREF(__pyx_v_extensions);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_extensions);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_extensions = __pyx_v_extensions;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":90
 *         self._exc        = _ExceptionContext()
 *         self._extensions = extensions
 *         self._namespaces = namespaces             # <<<<<<<<<<<<<< 
 *         self._temp_refs  = _TempStore()
 * 
 */
Py_INCREF(__pyx_v_namespaces);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_namespaces);
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_namespaces = __pyx_v_namespaces;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":91
 *         self._extensions = extensions
 *         self._namespaces = namespaces
 *         self._temp_refs  = _TempStore()             # <<<<<<<<<<<<<< 
 * 
 *         if enable_regexp:
 */
__pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__TempStore), 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__TempStore)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 91; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":91
 *         self._extensions = extensions
 *         self._namespaces = namespaces
 *         self._temp_refs  = _TempStore()             # <<<<<<<<<<<<<< 
 * 
 *         if enable_regexp:
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_temp_refs));
((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":93
 *         self._temp_refs  = _TempStore()
 * 
 *         if enable_regexp:             # <<<<<<<<<<<<<< 
 *             _regexp = _ExsltRegExp()
 *             _regexp._register_in_context(self)
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_enable_regexp); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 93; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":94
 * 
 *         if enable_regexp:
 *             _regexp = _ExsltRegExp()             # <<<<<<<<<<<<<< 
 *             _regexp._register_in_context(self)
 * 
 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ExsltRegExp), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ExsltRegExp)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 94; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v__regexp));
  __pyx_v__regexp = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":95
 *         if enable_regexp:
 *             _regexp = _ExsltRegExp()
 *             _regexp._register_in_context(self)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _BaseContext _copy(self):
 */
  __pyx_8 = ((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_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 95; goto __pyx_L1;}
  Py_DECREF(__pyx_8); __pyx_8 = 0;
  goto __pyx_L16;
}
__pyx_L16:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
Py_XDECREF(__pyx_8);
Py_XDECREF(__pyx_9);
Py_XDECREF(__pyx_10);
__Pyx_AddTraceback("lxml.etree._BaseContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v__regexp);
Py_DECREF(__pyx_v_new_extensions);
Py_DECREF(__pyx_v_extension);
Py_DECREF(__pyx_v_ns_uri);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_enable_regexp);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":97
 *             _regexp._register_in_context(self)
 * 
 *     cdef _BaseContext _copy(self):             # <<<<<<<<<<<<<< 
 *         cdef _BaseContext context
 *         if self._namespaces is not None:
 */

static  struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_f_4lxml_5etree_12_BaseContext__copy(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context;
PyObject *__pyx_v_namespaces;
struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":99
 *     cdef _BaseContext _copy(self):
 *         cdef _BaseContext context
 *         if self._namespaces is not None:             # <<<<<<<<<<<<<< 
 *             namespaces = self._namespaces[:]
 *         context = self.__class__(namespaces, None, False)
 */
__pyx_1 = (__pyx_v_self->_namespaces != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":100
 *         cdef _BaseContext context
 *         if self._namespaces is not None:
 *             namespaces = self._namespaces[:]             # <<<<<<<<<<<<<< 
 *         context = self.__class__(namespaces, None, False)
 *         if self._extensions is not None:
 */
  __pyx_2 = PySequence_GetSlice(__pyx_v_self->_namespaces, 0, PY_SSIZE_T_MAX); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_v_namespaces);
  __pyx_v_namespaces = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":101
 *         if self._namespaces is not None:
 *             namespaces = self._namespaces[:]
 *         context = self.__class__(namespaces, None, False)             # <<<<<<<<<<<<<< 
 *         if self._extensions is not None:
 *             context._extensions = python.PyDict_Copy(self._extensions)
 */
__pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n___class__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 101; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":101
 *         if self._namespaces is not None:
 *             namespaces = self._namespaces[:]
 *         context = self.__class__(namespaces, None, False)             # <<<<<<<<<<<<<< 
 *         if self._extensions is not None:
 *             context._extensions = python.PyDict_Copy(self._extensions)
 */
__pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 101; goto __pyx_L1;}
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_namespaces);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_3, 1, Py_None);
Py_INCREF(Py_False);
PyTuple_SET_ITEM(__pyx_3, 2, Py_False);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__BaseContext)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":102
 *             namespaces = self._namespaces[:]
 *         context = self.__class__(namespaces, None, False)
 *         if self._extensions is not None:             # <<<<<<<<<<<<<< 
 *             context._extensions = python.PyDict_Copy(self._extensions)
 *         return context
 */
__pyx_1 = (__pyx_v_self->_extensions != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":103
 *         context = self.__class__(namespaces, None, False)
 *         if self._extensions is not None:
 *             context._extensions = python.PyDict_Copy(self._extensions)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
  __pyx_2 = PyDict_Copy(__pyx_v_self->_extensions); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 103; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":103
 *         context = self.__class__(namespaces, None, False)
 *         if self._extensions is not None:
 *             context._extensions = python.PyDict_Copy(self._extensions)             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
  Py_DECREF(__pyx_v_context->_extensions);
  __pyx_v_context->_extensions = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":104
 *         if self._extensions is not None:
 *             context._extensions = python.PyDict_Copy(self._extensions)
 *         return context             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _to_utf(self, s):
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = __pyx_v_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._BaseContext._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":106
 *         return context
 * 
 *     cdef object _to_utf(self, s):             # <<<<<<<<<<<<<< 
 *         "Convert to UTF-8 and keep a reference to the encoded string"
 *         cdef python.PyObject* dict_result
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__to_utf(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self,PyObject *__pyx_v_s) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_utf;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_s);
__pyx_v_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":109
 *         "Convert to UTF-8 and keep a reference to the encoded string"
 *         cdef python.PyObject* dict_result
 *         if s is None:             # <<<<<<<<<<<<<< 
 *             return None
 *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
 */
__pyx_1 = (__pyx_v_s == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":110
 *         cdef python.PyObject* dict_result
 *         if s is None:
 *             return None             # <<<<<<<<<<<<<< 
 *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
 *         if dict_result is not NULL:
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":111
 *         if s is None:
 *             return None
 *         dict_result = python.PyDict_GetItem(self._utf_refs, s)             # <<<<<<<<<<<<<< 
 *         if dict_result is not NULL:
 *             return <object>dict_result
 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_utf_refs,__pyx_v_s);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":112
 *             return None
 *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
 *         if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *             return <object>dict_result
 *         utf = _utf8(s)
 */
__pyx_1 = (__pyx_v_dict_result != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":113
 *         dict_result = python.PyDict_GetItem(self._utf_refs, s)
 *         if dict_result is not NULL:
 *             return <object>dict_result             # <<<<<<<<<<<<<< 
 *         utf = _utf8(s)
 *         python.PyDict_SetItem(self._utf_refs, s, utf)
 */
  __pyx_2 = (PyObject *)__pyx_v_dict_result;
  Py_INCREF(__pyx_2);
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":114
 *         if dict_result is not NULL:
 *             return <object>dict_result
 *         utf = _utf8(s)             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(self._utf_refs, s, utf)
 *         return utf
 */
__pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_v_utf);
__pyx_v_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":115
 *             return <object>dict_result
 *         utf = _utf8(s)
 *         python.PyDict_SetItem(self._utf_refs, s, utf)             # <<<<<<<<<<<<<< 
 *         return utf
 * 
 */
__pyx_3 = PyDict_SetItem(__pyx_v_self->_utf_refs,__pyx_v_s,__pyx_v_utf); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 115; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":116
 *         utf = _utf8(s)
 *         python.PyDict_SetItem(self._utf_refs, s, utf)
 *         return utf             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
 */
Py_INCREF(__pyx_v_utf);
__pyx_r = __pyx_v_utf;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseContext._to_utf");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":118
 *         return utf
 * 
 *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<< 
 *         self._xpathCtxt = xpathCtxt
 *         xpathCtxt.userData = <void*>self
 */

static  void __pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self,xmlXPathContext *__pyx_v_xpathCtxt) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":119
 * 
 *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._xpathCtxt = xpathCtxt             # <<<<<<<<<<<<<< 
 *         xpathCtxt.userData = <void*>self
 * 
 */
__pyx_v_self->_xpathCtxt = __pyx_v_xpathCtxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":120
 *     cdef void _set_xpath_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._xpathCtxt = xpathCtxt
 *         xpathCtxt.userData = <void*>self             # <<<<<<<<<<<<<< 
 * 
 *     cdef _register_context(self, _Document doc):
 */
__pyx_v_xpathCtxt->userData = ((void *)__pyx_v_self);

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":122
 *         xpathCtxt.userData = <void*>self
 * 
 *     cdef _register_context(self, _Document doc):             # <<<<<<<<<<<<<< 
 *         self._doc = doc
 *         self._exc.clear()
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__register_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self,struct LxmlDocument *__pyx_v_doc) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":123
 * 
 *     cdef _register_context(self, _Document doc):
 *         self._doc = doc             # <<<<<<<<<<<<<< 
 *         self._exc.clear()
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)__pyx_v_self->_doc));
__pyx_v_self->_doc = __pyx_v_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":124
 *     cdef _register_context(self, _Document doc):
 *         self._doc = doc
 *         self._exc.clear()             # <<<<<<<<<<<<<< 
 * 
 *     cdef _cleanup_context(self):
 */
((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_self->_exc->__pyx_vtab)->clear(__pyx_v_self->_exc);

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":126
 *         self._exc.clear()
 * 
 *     cdef _cleanup_context(self):             # <<<<<<<<<<<<<< 
 *         #xpath.xmlXPathRegisteredNsCleanup(self._xpathCtxt)
 *         #self.unregisterGlobalNamespaces()
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":129
 *         #xpath.xmlXPathRegisteredNsCleanup(self._xpathCtxt)
 *         #self.unregisterGlobalNamespaces()
 *         python.PyDict_Clear(self._utf_refs)             # <<<<<<<<<<<<<< 
 *         self._eval_context_dict = None
 *         self._doc = None
 */
PyDict_Clear(__pyx_v_self->_utf_refs);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":130
 *         #self.unregisterGlobalNamespaces()
 *         python.PyDict_Clear(self._utf_refs)
 *         self._eval_context_dict = None             # <<<<<<<<<<<<<< 
 *         self._doc = None
 * 
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_eval_context_dict);
__pyx_v_self->_eval_context_dict = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":131
 *         python.PyDict_Clear(self._utf_refs)
 *         self._eval_context_dict = None
 *         self._doc = None             # <<<<<<<<<<<<<< 
 * 
 *     cdef _release_context(self):
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)__pyx_v_self->_doc));
__pyx_v_self->_doc = ((struct LxmlDocument *)Py_None);

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":133
 *         self._doc = None
 * 
 *     cdef _release_context(self):             # <<<<<<<<<<<<<< 
 *         if self._xpathCtxt is not NULL:
 *             self._xpathCtxt.userData = NULL
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_context(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":134
 * 
 *     cdef _release_context(self):
 *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<< 
 *             self._xpathCtxt.userData = NULL
 *             self._xpathCtxt = NULL
 */
__pyx_1 = (__pyx_v_self->_xpathCtxt != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":135
 *     cdef _release_context(self):
 *         if self._xpathCtxt is not NULL:
 *             self._xpathCtxt.userData = NULL             # <<<<<<<<<<<<<< 
 *             self._xpathCtxt = NULL
 * 
 */
  __pyx_v_self->_xpathCtxt->userData = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":136
 *         if self._xpathCtxt is not NULL:
 *             self._xpathCtxt.userData = NULL
 *             self._xpathCtxt = NULL             # <<<<<<<<<<<<<< 
 * 
 *     # namespaces (internal UTF-8 methods with leading '_')
 */
  __pyx_v_self->_xpathCtxt = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":140
 *     # namespaces (internal UTF-8 methods with leading '_')
 * 
 *     cdef addNamespace(self, prefix, ns_uri):             # <<<<<<<<<<<<<< 
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"
 */

static PyObject *__pyx_k627p;

static char __pyx_k627[] = "empty prefix is not supported in XPath";

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) {
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
PyObject *__pyx_v_new_item;
PyObject *__pyx_v_namespaces;
PyObject *__pyx_v_item;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_prefix);
Py_INCREF(__pyx_v_ns_uri);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_new_item = Py_None; Py_INCREF(Py_None);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);
__pyx_v_item = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":141
 * 
 *     cdef addNamespace(self, prefix, ns_uri):
 *         if prefix is None:             # <<<<<<<<<<<<<< 
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)
 */
__pyx_1 = (__pyx_v_prefix == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":142
 *     cdef addNamespace(self, prefix, ns_uri):
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"             # <<<<<<<<<<<<<< 
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k627p, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 142; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":143
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<< 
 *         ns_uri_utf = self._to_utf(ns_uri)
 *         new_item = (prefix_utf, ns_uri_utf)
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self,__pyx_v_prefix); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 143; goto __pyx_L1;}
Py_DECREF(__pyx_v_prefix_utf);
__pyx_v_prefix_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":144
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<< 
 *         new_item = (prefix_utf, ns_uri_utf)
 *         if self._namespaces is None:
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self,__pyx_v_ns_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 144; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_uri_utf);
__pyx_v_ns_uri_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":145
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)
 *         new_item = (prefix_utf, ns_uri_utf)             # <<<<<<<<<<<<<< 
 *         if self._namespaces is None:
 *             self._namespaces = [new_item]
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 145; goto __pyx_L1;}
Py_INCREF(__pyx_v_prefix_utf);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_prefix_utf);
Py_INCREF(__pyx_v_ns_uri_utf);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_new_item);
__pyx_v_new_item = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":146
 *         ns_uri_utf = self._to_utf(ns_uri)
 *         new_item = (prefix_utf, ns_uri_utf)
 *         if self._namespaces is None:             # <<<<<<<<<<<<<< 
 *             self._namespaces = [new_item]
 *         else:
 */
__pyx_1 = (__pyx_v_self->_namespaces == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":147
 *         new_item = (prefix_utf, ns_uri_utf)
 *         if self._namespaces is None:
 *             self._namespaces = [new_item]             # <<<<<<<<<<<<<< 
 *         else:
 *             namespaces = []
 */
  __pyx_2 = PyList_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_INCREF(__pyx_v_new_item);
  PyList_SET_ITEM(__pyx_2, 0, __pyx_v_new_item);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":147
 *         new_item = (prefix_utf, ns_uri_utf)
 *         if self._namespaces is None:
 *             self._namespaces = [new_item]             # <<<<<<<<<<<<<< 
 *         else:
 *             namespaces = []
 */
  Py_DECREF(__pyx_v_self->_namespaces);
  __pyx_v_self->_namespaces = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":149
 *             self._namespaces = [new_item]
 *         else:
 *             namespaces = []             # <<<<<<<<<<<<<< 
 *             for item in self._namespaces:
 *                 if item[0] == prefix_utf:
 */
  __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_v_namespaces);
  __pyx_v_namespaces = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":150
 *         else:
 *             namespaces = []
 *             for item in self._namespaces:             # <<<<<<<<<<<<<< 
 *                 if item[0] == prefix_utf:
 *                     item = new_item
 */
  if (PyList_CheckExact(__pyx_v_self->_namespaces)) { __pyx_3 = 0; __pyx_2 = __pyx_v_self->_namespaces; Py_INCREF(__pyx_2); }
  else { __pyx_2 = PyObject_GetIter(__pyx_v_self->_namespaces); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 150; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":150
 *         else:
 *             namespaces = []
 *             for item in self._namespaces:             # <<<<<<<<<<<<<< 
 *                 if item[0] == prefix_utf:
 *                     item = new_item
 */
    if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_2);
      if (!__pyx_4) {
        break;
      }
    }
    Py_DECREF(__pyx_v_item);
    __pyx_v_item = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":151
 *             namespaces = []
 *             for item in self._namespaces:
 *                 if item[0] == prefix_utf:             # <<<<<<<<<<<<<< 
 *                     item = new_item
 *                     new_item = None
 */
    if (PyList_CheckExact(__pyx_v_item) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_item)) {
      __pyx_5 = PyList_GET_ITEM(__pyx_v_item, 0); Py_INCREF(__pyx_5);
      } else if (PyTuple_CheckExact(__pyx_v_item) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_item)) {
      __pyx_5 = PyTuple_GET_ITEM(__pyx_v_item, 0); Py_INCREF(__pyx_5);
      } else {
      __pyx_4 = PyInt_FromLong(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 151; goto __pyx_L1;}
      __pyx_5 = PyObject_GetItem(__pyx_v_item, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 151; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":151
 *             namespaces = []
 *             for item in self._namespaces:
 *                 if item[0] == prefix_utf:             # <<<<<<<<<<<<<< 
 *                     item = new_item
 *                     new_item = None
 */
    __pyx_4 = PyObject_RichCompare(__pyx_5, __pyx_v_prefix_utf, Py_EQ); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 151; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_4); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 151; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":152
 *             for item in self._namespaces:
 *                 if item[0] == prefix_utf:
 *                     item = new_item             # <<<<<<<<<<<<<< 
 *                     new_item = None
 *                 python.PyList_Append(namespaces, item)
 */
      Py_INCREF(__pyx_v_new_item);
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_v_new_item;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":153
 *                 if item[0] == prefix_utf:
 *                     item = new_item
 *                     new_item = None             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(namespaces, item)
 *             if new_item is not None:
 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_new_item);
      __pyx_v_new_item = Py_None;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":154
 *                     item = new_item
 *                     new_item = None
 *                 python.PyList_Append(namespaces, item)             # <<<<<<<<<<<<<< 
 *             if new_item is not None:
 *                 python.PyList_Append(namespaces, new_item)
 */
    __pyx_6 = PyList_Append(__pyx_v_namespaces,__pyx_v_item); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 154; goto __pyx_L1;}
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":155
 *                     new_item = None
 *                 python.PyList_Append(namespaces, item)
 *             if new_item is not None:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(namespaces, new_item)
 *             self._namespaces = namespaces
 */
  __pyx_1 = (__pyx_v_new_item != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":156
 *                 python.PyList_Append(namespaces, item)
 *             if new_item is not None:
 *                 python.PyList_Append(namespaces, new_item)             # <<<<<<<<<<<<<< 
 *             self._namespaces = namespaces
 *         if self._xpathCtxt is not NULL:
 */
    __pyx_6 = PyList_Append(__pyx_v_namespaces,__pyx_v_new_item); if (unlikely(__pyx_6 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 156; goto __pyx_L1;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":157
 *             if new_item is not None:
 *                 python.PyList_Append(namespaces, new_item)
 *             self._namespaces = namespaces             # <<<<<<<<<<<<<< 
 *         if self._xpathCtxt is not NULL:
 *             xpath.xmlXPathRegisterNs(
 */
  Py_INCREF(__pyx_v_namespaces);
  Py_DECREF(__pyx_v_self->_namespaces);
  __pyx_v_self->_namespaces = __pyx_v_namespaces;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":158
 *                 python.PyList_Append(namespaces, new_item)
 *             self._namespaces = namespaces
 *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
__pyx_1 = (__pyx_v_self->_xpathCtxt != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":160
 *         if self._xpathCtxt is not NULL:
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<< 
 * 
 *     cdef registerNamespace(self, prefix, ns_uri):
 */
  xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),_cstr(__pyx_v_ns_uri_utf));
  goto __pyx_L8;
}
__pyx_L8:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._BaseContext.addNamespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_new_item);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_item);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":162
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 * 
 *     cdef registerNamespace(self, prefix, ns_uri):             # <<<<<<<<<<<<<< 
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"
 */

static PyObject *__pyx_k628p;

static char __pyx_k628[] = "empty prefix is not supported in XPath";

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) {
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_prefix);
Py_INCREF(__pyx_v_ns_uri);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":163
 * 
 *     cdef registerNamespace(self, prefix, ns_uri):
 *         if prefix is None:             # <<<<<<<<<<<<<< 
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)
 */
__pyx_1 = (__pyx_v_prefix == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":164
 *     cdef registerNamespace(self, prefix, ns_uri):
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"             # <<<<<<<<<<<<<< 
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_k628p, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 164; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":165
 *         if prefix is None:
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)             # <<<<<<<<<<<<<< 
 *         ns_uri_utf = self._to_utf(ns_uri)
 *         python.PyList_Append(self._global_namespaces, prefix_utf)
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self,__pyx_v_prefix); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 165; goto __pyx_L1;}
Py_DECREF(__pyx_v_prefix_utf);
__pyx_v_prefix_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":166
 *             raise TypeError, "empty prefix is not supported in XPath"
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(self._global_namespaces, prefix_utf)
 *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
 */
__pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_to_utf(__pyx_v_self,__pyx_v_ns_uri); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_uri_utf);
__pyx_v_ns_uri_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":167
 *         prefix_utf = self._to_utf(prefix)
 *         ns_uri_utf = self._to_utf(ns_uri)
 *         python.PyList_Append(self._global_namespaces, prefix_utf)             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
__pyx_3 = PyList_Append(__pyx_v_self->_global_namespaces,__pyx_v_prefix_utf); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 167; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":169
 *         python.PyList_Append(self._global_namespaces, prefix_utf)
 *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<< 
 * 
 *     cdef registerLocalNamespaces(self):
 */
xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),_cstr(__pyx_v_ns_uri_utf));

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseContext.registerNamespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":171
 *                                  _cstr(prefix_utf), _cstr(ns_uri_utf))
 * 
 *     cdef registerLocalNamespaces(self):             # <<<<<<<<<<<<<< 
 *         if self._namespaces is None:
 *             return
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerLocalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
PyObject *__pyx_r;
int __pyx_1;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":172
 * 
 *     cdef registerLocalNamespaces(self):
 *         if self._namespaces is None:             # <<<<<<<<<<<<<< 
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:
 */
__pyx_1 = (__pyx_v_self->_namespaces == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":173
 *     cdef registerLocalNamespaces(self):
 *         if self._namespaces is None:
 *             return             # <<<<<<<<<<<<<< 
 *         for prefix_utf, ns_uri_utf in self._namespaces:
 *             xpath.xmlXPathRegisterNs(
 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
if (PyList_CheckExact(__pyx_v_self->_namespaces)) { __pyx_2 = 0; __pyx_3 = __pyx_v_self->_namespaces; Py_INCREF(__pyx_3); }
else { __pyx_3 = PyObject_GetIter(__pyx_v_self->_namespaces); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 174; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
  if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_3);
    if (!__pyx_4) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
    __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
    Py_DECREF(__pyx_v_prefix_utf);
    __pyx_v_prefix_utf = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
    Py_DECREF(__pyx_v_ns_uri_utf);
    __pyx_v_ns_uri_utf = __pyx_6;
    __pyx_6 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  else {
    __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 174; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
    Py_DECREF(__pyx_v_prefix_utf);
    __pyx_v_prefix_utf = __pyx_6;
    __pyx_6 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 174; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":174
 *         if self._namespaces is None:
 *             return
 *         for prefix_utf, ns_uri_utf in self._namespaces:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
    Py_DECREF(__pyx_v_ns_uri_utf);
    __pyx_v_ns_uri_utf = __pyx_6;
    __pyx_6 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 174; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":176
 *         for prefix_utf, ns_uri_utf in self._namespaces:
 *             xpath.xmlXPathRegisterNs(
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<< 
 * 
 *     cdef registerGlobalNamespaces(self):
 */
  xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),_cstr(__pyx_v_ns_uri_utf));
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._BaseContext.registerLocalNamespaces");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":178
 *                 self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 * 
 *     cdef registerGlobalNamespaces(self):             # <<<<<<<<<<<<<< 
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_v_ns_prefixes;
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
Py_INCREF(__pyx_v_self);
__pyx_v_ns_prefixes = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":179
 * 
 *     cdef registerGlobalNamespaces(self):
 *         ns_prefixes = _find_all_extension_prefixes()             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:
 */
__pyx_1 = __pyx_f_4lxml_5etree__find_all_extension_prefixes(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 179; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_prefixes);
__pyx_v_ns_prefixes = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":180
 *     cdef registerGlobalNamespaces(self):
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:             # <<<<<<<<<<<<<< 
 *             for prefix_utf, ns_uri_utf in ns_prefixes:
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 */
__pyx_2 = (PyList_GET_SIZE(__pyx_v_ns_prefixes) > 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
  if (PyList_CheckExact(__pyx_v_ns_prefixes)) { __pyx_3 = 0; __pyx_1 = __pyx_v_ns_prefixes; Py_INCREF(__pyx_1); }
  else { __pyx_1 = PyObject_GetIter(__pyx_v_ns_prefixes); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
    if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_4 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_1);
      if (!__pyx_4) {
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
      Py_DECREF(__pyx_v_prefix_utf);
      __pyx_v_prefix_utf = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
      Py_DECREF(__pyx_v_ns_uri_utf);
      __pyx_v_ns_uri_utf = __pyx_6;
      __pyx_6 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    else {
      __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
      Py_DECREF(__pyx_v_prefix_utf);
      __pyx_v_prefix_utf = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":181
 *         ns_prefixes = _find_all_extension_prefixes()
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 */
      Py_DECREF(__pyx_v_ns_uri_utf);
      __pyx_v_ns_uri_utf = __pyx_6;
      __pyx_6 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 181; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":182
 *         if python.PyList_GET_SIZE(ns_prefixes) > 0:
 *             for prefix_utf, ns_uri_utf in ns_prefixes:
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)             # <<<<<<<<<<<<<< 
 *                 xpath.xmlXPathRegisterNs(
 *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 */
    __pyx_7 = PyList_Append(__pyx_v_self->_global_namespaces,__pyx_v_prefix_utf); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 182; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":184
 *                 python.PyList_Append(self._global_namespaces, prefix_utf)
 *                 xpath.xmlXPathRegisterNs(
 *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))             # <<<<<<<<<<<<<< 
 * 
 *     cdef unregisterGlobalNamespaces(self):
 */
    xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),_cstr(__pyx_v_ns_uri_utf));
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._BaseContext.registerGlobalNamespaces");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_prefixes);
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":186
 *                     self._xpathCtxt, _cstr(prefix_utf), _cstr(ns_uri_utf))
 * 
 *     cdef unregisterGlobalNamespaces(self):             # <<<<<<<<<<<<<< 
 *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:
 *             for prefix_utf in self._global_namespaces:
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalNamespaces(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_r;
int __pyx_1;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_prefix_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":187
 * 
 *     cdef unregisterGlobalNamespaces(self):
 *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:             # <<<<<<<<<<<<<< 
 *             for prefix_utf in self._global_namespaces:
 *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_self->_global_namespaces) > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":188
 *     cdef unregisterGlobalNamespaces(self):
 *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:
 *             for prefix_utf in self._global_namespaces:             # <<<<<<<<<<<<<< 
 *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                          _cstr(prefix_utf), NULL)
 */
  if (PyList_CheckExact(__pyx_v_self->_global_namespaces)) { __pyx_2 = 0; __pyx_3 = __pyx_v_self->_global_namespaces; Py_INCREF(__pyx_3); }
  else { __pyx_3 = PyObject_GetIter(__pyx_v_self->_global_namespaces); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 188; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":188
 *     cdef unregisterGlobalNamespaces(self):
 *         if python.PyList_GET_SIZE(self._global_namespaces) > 0:
 *             for prefix_utf in self._global_namespaces:             # <<<<<<<<<<<<<< 
 *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                          _cstr(prefix_utf), NULL)
 */
    if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_3);
      if (!__pyx_4) {
        break;
      }
    }
    Py_DECREF(__pyx_v_prefix_utf);
    __pyx_v_prefix_utf = __pyx_4;
    __pyx_4 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":190
 *             for prefix_utf in self._global_namespaces:
 *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                          _cstr(prefix_utf), NULL)             # <<<<<<<<<<<<<< 
 *             del self._global_namespaces[:]
 *     
 */
    xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),NULL);
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":191
 *                 xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                          _cstr(prefix_utf), NULL)
 *             del self._global_namespaces[:]             # <<<<<<<<<<<<<< 
 *     
 *     cdef void _unregisterNamespace(self, prefix_utf):
 */
  if (PySequence_DelSlice(__pyx_v_self->_global_namespaces, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 191; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._BaseContext.unregisterGlobalNamespaces");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":193
 *             del self._global_namespaces[:]
 *     
 *     cdef void _unregisterNamespace(self, prefix_utf):             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                  _cstr(prefix_utf), NULL)
 */

static  void __pyx_f_4lxml_5etree_12_BaseContext__unregisterNamespace(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self,PyObject *__pyx_v_prefix_utf) {
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_prefix_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":195
 *     cdef void _unregisterNamespace(self, prefix_utf):
 *         xpath.xmlXPathRegisterNs(self._xpathCtxt,
 *                                  _cstr(prefix_utf), NULL)             # <<<<<<<<<<<<<< 
 *     
 *     # extension functions
 */
xmlXPathRegisterNs(__pyx_v_self->_xpathCtxt,_cstr(__pyx_v_prefix_utf),NULL);

Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_prefix_utf);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":199
 *     # extension functions
 * 
 *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):             # <<<<<<<<<<<<<< 
 *         if self._extensions is None:
 *             self._extensions = {}
 */

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) {
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_ns_utf);
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_function);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":200
 * 
 *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):
 *         if self._extensions is None:             # <<<<<<<<<<<<<< 
 *             self._extensions = {}
 *         python.PyDict_SetItem(self._extensions, (ns_utf, name_utf), function)
 */
__pyx_1 = (__pyx_v_self->_extensions == Py_None);
if (__pyx_1) {
  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":201
 *     cdef void _addLocalExtensionFunction(self, ns_utf, name_utf, function):
 *         if self._extensions is None:
 *             self._extensions = {}             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(self._extensions, (ns_utf, name_utf), function)
 * 
 */
  Py_DECREF(__pyx_v_self->_extensions);
  __pyx_v_self->_extensions = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":202
 *         if self._extensions is None:
 *             self._extensions = {}
 *         python.PyDict_SetItem(self._extensions, (ns_utf, name_utf), function)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void registerGlobalFunctions(self, void* ctxt,
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; goto __pyx_L1;}
Py_INCREF(__pyx_v_ns_utf);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns_utf);
Py_INCREF(__pyx_v_name_utf);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_name_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":202
 *         if self._extensions is None:
 *             self._extensions = {}
 *         python.PyDict_SetItem(self._extensions, (ns_utf, name_utf), function)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void registerGlobalFunctions(self, void* ctxt,
 */
__pyx_3 = PyDict_SetItem(__pyx_v_self->_extensions,__pyx_2,__pyx_v_function); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 202; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("lxml.etree._BaseContext._addLocalExtensionFunction");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":204
 *         python.PyDict_SetItem(self._extensions, (ns_utf, name_utf), function)
 * 
 *     cdef void registerGlobalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<< 
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 */

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) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_ns_functions;
PyObject *__pyx_v_d;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_v_function;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
int __pyx_7;
Py_ssize_t __pyx_8;
PyObject *__pyx_9 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_functions = Py_None; Py_INCREF(Py_None);
__pyx_v_d = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_function = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
__pyx_2 = __pyx_f_4lxml_5etree__iter_ns_extension_functions(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;}
if (PyList_CheckExact(__pyx_2)) { __pyx_1 = 0; __pyx_3 = __pyx_2; Py_INCREF(__pyx_3); }
else { __pyx_3 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;} }
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
  if (PyList_CheckExact(__pyx_3)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_2 = PyList_GET_ITEM(__pyx_3, __pyx_1++); Py_INCREF(__pyx_2); }
  else {
    __pyx_2 = PyIter_Next(__pyx_3);
    if (!__pyx_2) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_2) && PyTuple_GET_SIZE(__pyx_2) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_2, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_2, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_functions);
    __pyx_v_ns_functions = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":207
 *                                     _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_functions);
    __pyx_v_ns_functions = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 207; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":209
 *         for ns_utf, ns_functions in _iter_ns_extension_functions():
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)             # <<<<<<<<<<<<<< 
 *             if dict_result is not NULL:
 *                 d = <object>dict_result
 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_function_cache,__pyx_v_ns_utf);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":210
 *             dict_result = python.PyDict_GetItem(
 *                 self._function_cache, ns_utf)
 *             if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *                 d = <object>dict_result
 *             else:
 */
  __pyx_6 = (__pyx_v_dict_result != NULL);
  if (__pyx_6) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":211
 *                 self._function_cache, ns_utf)
 *             if dict_result is not NULL:
 *                 d = <object>dict_result             # <<<<<<<<<<<<<< 
 *             else:
 *                 d = {}
 */
    __pyx_5 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_5);
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_5;
    __pyx_5 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":213
 *                 d = <object>dict_result
 *             else:
 *                 d = {}             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 */
    __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 213; goto __pyx_L1;}
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":215
 *                 d = {}
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)             # <<<<<<<<<<<<<< 
 *             for name_utf, function in ns_functions.iteritems():
 *                 python.PyDict_SetItem(d, name_utf, function)
 */
    __pyx_7 = PyDict_SetItem(__pyx_v_self->_function_cache,__pyx_v_ns_utf,__pyx_v_d); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 214; goto __pyx_L1;}
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_ns_functions, __pyx_n_iteritems); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}
  __pyx_5 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (PyList_CheckExact(__pyx_5)) { __pyx_8 = 0; __pyx_2 = __pyx_5; Py_INCREF(__pyx_2); }
  else { __pyx_2 = PyObject_GetIter(__pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;} }
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
    if (PyList_CheckExact(__pyx_2)) { if (__pyx_8 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_8++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_2);
      if (!__pyx_4) {
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
      __pyx_9 = PyTuple_GET_ITEM(__pyx_4, 0);
      Py_INCREF(__pyx_9);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_9;
      __pyx_9 = 0;
      __pyx_9 = PyTuple_GET_ITEM(__pyx_4, 1);
      Py_INCREF(__pyx_9);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
      Py_DECREF(__pyx_v_function);
      __pyx_v_function = __pyx_9;
      __pyx_9 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    else {
      __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_9 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_9;
      __pyx_9 = 0;
      __pyx_9 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":216
 *                 python.PyDict_SetItem(
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)
 */
      Py_DECREF(__pyx_v_function);
      __pyx_v_function = __pyx_9;
      __pyx_9 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 216; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":217
 *                     self._function_cache, ns_utf, d)
 *             for name_utf, function in ns_functions.iteritems():
 *                 python.PyDict_SetItem(d, name_utf, function)             # <<<<<<<<<<<<<< 
 *                 reg_func(ctxt, name_utf, ns_utf)
 * 
 */
    __pyx_7 = PyDict_SetItem(__pyx_v_d,__pyx_v_name_utf,__pyx_v_function); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 217; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":218
 *             for name_utf, function in ns_functions.iteritems():
 *                 python.PyDict_SetItem(d, name_utf, function)
 *                 reg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void registerLocalFunctions(self, void* ctxt,
 */
    __pyx_v_reg_func(__pyx_v_ctxt,__pyx_v_name_utf,__pyx_v_ns_utf);
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_9);
__Pyx_WriteUnraisable("lxml.etree._BaseContext.registerGlobalFunctions");
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_ns_functions);
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":220
 *                 reg_func(ctxt, name_utf, ns_utf)
 * 
 *     cdef void registerLocalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<< 
 *                                       _register_function reg_func):
 *         cdef python.PyObject* dict_result
 */

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) {
PyObject *__pyx_v_dict_result;
PyObject *__pyx_v_last_ns;
PyObject *__pyx_v_d;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_v_function;
int __pyx_1;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
PyObject *__pyx_8 = 0;
int __pyx_9;
Py_INCREF(__pyx_v_self);
__pyx_v_last_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_d = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_function = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":223
 *                                       _register_function reg_func):
 *         cdef python.PyObject* dict_result
 *         if self._extensions is None:             # <<<<<<<<<<<<<< 
 *             return # done
 *         last_ns = None
 */
__pyx_1 = (__pyx_v_self->_extensions == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":224
 *         cdef python.PyObject* dict_result
 *         if self._extensions is None:
 *             return # done             # <<<<<<<<<<<<<< 
 *         last_ns = None
 *         d = None
 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":225
 *         if self._extensions is None:
 *             return # done
 *         last_ns = None             # <<<<<<<<<<<<<< 
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_last_ns);
__pyx_v_last_ns = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":226
 *             return # done
 *         last_ns = None
 *         d = None             # <<<<<<<<<<<<<< 
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():
 *             if ns_utf is not last_ns or d is None:
 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_d);
__pyx_v_d = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
__pyx_3 = PyObject_GetAttr(__pyx_v_self->_extensions, __pyx_n_iteritems); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
__pyx_4 = PyObject_CallObject(__pyx_3, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (PyList_CheckExact(__pyx_4)) { __pyx_2 = 0; __pyx_3 = __pyx_4; Py_INCREF(__pyx_3); }
else { __pyx_3 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;} }
Py_DECREF(__pyx_4); __pyx_4 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
  if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); }
  else {
    __pyx_4 = PyIter_Next(__pyx_3);
    if (!__pyx_4) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
    __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
    Py_INCREF(__pyx_6);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
    if (PyTuple_CheckExact(__pyx_6) && PyTuple_GET_SIZE(__pyx_6) == 2) {
      __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 0);
      Py_INCREF(__pyx_8);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_8;
      __pyx_8 = 0;
      __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 1);
      Py_INCREF(__pyx_8);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_8;
      __pyx_8 = 0;
      Py_DECREF(__pyx_6); __pyx_6 = 0;
    }
    else {
      __pyx_7 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_8;
      __pyx_8 = 0;
      __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_8;
      __pyx_8 = 0;
      if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
    }
    __pyx_8 = PyTuple_GET_ITEM(__pyx_4, 1);
    Py_INCREF(__pyx_8);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
    Py_DECREF(__pyx_v_function);
    __pyx_v_function = __pyx_8;
    __pyx_8 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  else {
    __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
    if (PyTuple_CheckExact(__pyx_6) && PyTuple_GET_SIZE(__pyx_6) == 2) {
      __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 0);
      Py_INCREF(__pyx_8);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_8;
      __pyx_8 = 0;
      __pyx_8 = PyTuple_GET_ITEM(__pyx_6, 1);
      Py_INCREF(__pyx_8);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_8;
      __pyx_8 = 0;
      Py_DECREF(__pyx_6); __pyx_6 = 0;
    }
    else {
      __pyx_7 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_8;
      __pyx_8 = 0;
      __pyx_8 = __Pyx_UnpackItem(__pyx_7); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_8;
      __pyx_8 = 0;
      if (__Pyx_EndUnpack(__pyx_7) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_7); __pyx_7 = 0;
    }
    __pyx_8 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":227
 *         last_ns = None
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():             # <<<<<<<<<<<<<< 
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf
 */
    Py_DECREF(__pyx_v_function);
    __pyx_v_function = __pyx_8;
    __pyx_8 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 227; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":228
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():
 *             if ns_utf is not last_ns or d is None:             # <<<<<<<<<<<<<< 
 *                 last_ns = ns_utf
 *                 dict_result = python.PyDict_GetItem(
 */
  __pyx_1 = (__pyx_v_ns_utf != __pyx_v_last_ns);
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":228
 *         d = None
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():
 *             if ns_utf is not last_ns or d is None:             # <<<<<<<<<<<<<< 
 *                 last_ns = ns_utf
 *                 dict_result = python.PyDict_GetItem(
 */
    __pyx_1 = (__pyx_v_d == Py_None);
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":229
 *         for (ns_utf, name_utf), function in self._extensions.iteritems():
 *             if ns_utf is not last_ns or d is None:
 *                 last_ns = ns_utf             # <<<<<<<<<<<<<< 
 *                 dict_result = python.PyDict_GetItem(
 *                     self._function_cache, ns_utf)
 */
    Py_INCREF(__pyx_v_ns_utf);
    Py_DECREF(__pyx_v_last_ns);
    __pyx_v_last_ns = __pyx_v_ns_utf;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":231
 *                 last_ns = ns_utf
 *                 dict_result = python.PyDict_GetItem(
 *                     self._function_cache, ns_utf)             # <<<<<<<<<<<<<< 
 *                 if dict_result is not NULL:
 *                     d = <object>dict_result
 */
    __pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_function_cache,__pyx_v_ns_utf);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":232
 *                 dict_result = python.PyDict_GetItem(
 *                     self._function_cache, ns_utf)
 *                 if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *                     d = <object>dict_result
 *                 else:
 */
    __pyx_1 = (__pyx_v_dict_result != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":233
 *                     self._function_cache, ns_utf)
 *                 if dict_result is not NULL:
 *                     d = <object>dict_result             # <<<<<<<<<<<<<< 
 *                 else:
 *                     d = {}
 */
      __pyx_6 = (PyObject *)__pyx_v_dict_result;
      Py_INCREF(__pyx_6);
      Py_DECREF(__pyx_v_d);
      __pyx_v_d = __pyx_6;
      __pyx_6 = 0;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":235
 *                     d = <object>dict_result
 *                 else:
 *                     d = {}             # <<<<<<<<<<<<<< 
 *                     python.PyDict_SetItem(self._function_cache,
 *                                           ns_utf, d)
 */
      __pyx_7 = PyDict_New(); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 235; goto __pyx_L1;}
      Py_DECREF(__pyx_v_d);
      __pyx_v_d = __pyx_7;
      __pyx_7 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":237
 *                     d = {}
 *                     python.PyDict_SetItem(self._function_cache,
 *                                           ns_utf, d)             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(d, name_utf, function)
 *             reg_func(ctxt, name_utf, ns_utf)
 */
      __pyx_9 = PyDict_SetItem(__pyx_v_self->_function_cache,__pyx_v_ns_utf,__pyx_v_d); if (unlikely(__pyx_9 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 236; goto __pyx_L1;}
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":238
 *                     python.PyDict_SetItem(self._function_cache,
 *                                           ns_utf, d)
 *             python.PyDict_SetItem(d, name_utf, function)             # <<<<<<<<<<<<<< 
 *             reg_func(ctxt, name_utf, ns_utf)
 * 
 */
  __pyx_9 = PyDict_SetItem(__pyx_v_d,__pyx_v_name_utf,__pyx_v_function); if (unlikely(__pyx_9 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 238; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":239
 *                                           ns_utf, d)
 *             python.PyDict_SetItem(d, name_utf, function)
 *             reg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<< 
 * 
 *     cdef unregisterAllFunctions(self, void* ctxt,
 */
  __pyx_v_reg_func(__pyx_v_ctxt,__pyx_v_name_utf,__pyx_v_ns_utf);
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
Py_XDECREF(__pyx_8);
__Pyx_WriteUnraisable("lxml.etree._BaseContext.registerLocalFunctions");
__pyx_L0:;
Py_DECREF(__pyx_v_last_ns);
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":241
 *             reg_func(ctxt, name_utf, ns_utf)
 * 
 *     cdef unregisterAllFunctions(self, void* ctxt,             # <<<<<<<<<<<<<< 
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 */

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) {
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_functions;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
Py_INCREF(__pyx_v_self);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_functions = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self->_function_cache, __pyx_n_iteritems); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_1 = 0; __pyx_2 = __pyx_3; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
    Py_DECREF(__pyx_v_functions);
    __pyx_v_functions = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":243
 *     cdef unregisterAllFunctions(self, void* ctxt,
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)
 */
    Py_DECREF(__pyx_v_functions);
    __pyx_v_functions = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 243; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":244
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:             # <<<<<<<<<<<<<< 
 *                 unreg_func(ctxt, name_utf, ns_utf)
 * 
 */
  if (PyList_CheckExact(__pyx_v_functions)) { __pyx_6 = 0; __pyx_5 = __pyx_v_functions; Py_INCREF(__pyx_5); }
  else { __pyx_5 = PyObject_GetIter(__pyx_v_functions); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 244; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":244
 *                                       _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:             # <<<<<<<<<<<<<< 
 *                 unreg_func(ctxt, name_utf, ns_utf)
 * 
 */
    if (PyList_CheckExact(__pyx_5)) { if (__pyx_6 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_3 = PyList_GET_ITEM(__pyx_5, __pyx_6++); Py_INCREF(__pyx_3); }
    else {
      __pyx_3 = PyIter_Next(__pyx_5);
      if (!__pyx_3) {
        break;
      }
    }
    Py_DECREF(__pyx_v_name_utf);
    __pyx_v_name_utf = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":245
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:
 *                 unreg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<< 
 * 
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 */
    __pyx_v_unreg_func(__pyx_v_ctxt,__pyx_v_name_utf,__pyx_v_ns_utf);
  }
  Py_DECREF(__pyx_5); __pyx_5 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._BaseContext.unregisterAllFunctions");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_functions);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":247
 *                 unreg_func(ctxt, name_utf, ns_utf)
 * 
 *     cdef unregisterGlobalFunctions(self, void* ctxt,             # <<<<<<<<<<<<<< 
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 */

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) {
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_functions;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_ssize_t __pyx_6;
int __pyx_7;
Py_INCREF(__pyx_v_self);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_functions = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self->_function_cache, __pyx_n_iteritems); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_1 = 0; __pyx_2 = __pyx_3; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
    Py_DECREF(__pyx_v_functions);
    __pyx_v_functions = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
    Py_DECREF(__pyx_v_ns_utf);
    __pyx_v_ns_utf = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":249
 *     cdef unregisterGlobalFunctions(self, void* ctxt,
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():             # <<<<<<<<<<<<<< 
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 */
    Py_DECREF(__pyx_v_functions);
    __pyx_v_functions = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":250
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:             # <<<<<<<<<<<<<< 
 *                 if self._extensions is None or \
 *                        (ns_utf, name_utf) not in self._extensions:
 */
  if (PyList_CheckExact(__pyx_v_functions)) { __pyx_6 = 0; __pyx_5 = __pyx_v_functions; Py_INCREF(__pyx_5); }
  else { __pyx_5 = PyObject_GetIter(__pyx_v_functions); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 250; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":250
 *                                          _register_function unreg_func):
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:             # <<<<<<<<<<<<<< 
 *                 if self._extensions is None or \
 *                        (ns_utf, name_utf) not in self._extensions:
 */
    if (PyList_CheckExact(__pyx_5)) { if (__pyx_6 >= PyList_GET_SIZE(__pyx_5)) break; __pyx_3 = PyList_GET_ITEM(__pyx_5, __pyx_6++); Py_INCREF(__pyx_3); }
    else {
      __pyx_3 = PyIter_Next(__pyx_5);
      if (!__pyx_3) {
        break;
      }
    }
    Py_DECREF(__pyx_v_name_utf);
    __pyx_v_name_utf = __pyx_3;
    __pyx_3 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":251
 *         for ns_utf, functions in self._function_cache.iteritems():
 *             for name_utf in functions:
 *                 if self._extensions is None or \             # <<<<<<<<<<<<<< 
 *                        (ns_utf, name_utf) not in self._extensions:
 *                     unreg_func(ctxt, name_utf, ns_utf)
 */
    __pyx_7 = (__pyx_v_self->_extensions == Py_None);
    if (!__pyx_7) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":252
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 *                        (ns_utf, name_utf) not in self._extensions:             # <<<<<<<<<<<<<< 
 *                     unreg_func(ctxt, name_utf, ns_utf)
 * 
 */
      __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 252; goto __pyx_L1;}
      Py_INCREF(__pyx_v_ns_utf);
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_ns_utf);
      Py_INCREF(__pyx_v_name_utf);
      PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_name_utf);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":252
 *             for name_utf in functions:
 *                 if self._extensions is None or \
 *                        (ns_utf, name_utf) not in self._extensions:             # <<<<<<<<<<<<<< 
 *                     unreg_func(ctxt, name_utf, ns_utf)
 * 
 */
      __pyx_7 = (!PySequence_Contains(__pyx_v_self->_extensions, __pyx_4)); if (unlikely(__pyx_7 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 252; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    if (__pyx_7) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":253
 *                 if self._extensions is None or \
 *                        (ns_utf, name_utf) not in self._extensions:
 *                     unreg_func(ctxt, name_utf, ns_utf)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _find_cached_function(self, char* c_ns_uri, char* c_name):
 */
      __pyx_v_unreg_func(__pyx_v_ctxt,__pyx_v_name_utf,__pyx_v_ns_utf);
      goto __pyx_L6;
    }
    __pyx_L6:;
  }
  Py_DECREF(__pyx_5); __pyx_5 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._BaseContext.unregisterGlobalFunctions");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_functions);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":255
 *                     unreg_func(ctxt, name_utf, ns_utf)
 * 
 *     cdef _find_cached_function(self, char* c_ns_uri, char* c_name):             # <<<<<<<<<<<<<< 
 *         """Lookup an extension function in the cache and return it.
 * 
 */

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) {
PyObject *__pyx_v_c_dict;
PyObject *__pyx_v_dict_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":262
 *         cdef python.PyObject* c_dict
 *         cdef python.PyObject* dict_result
 *         if c_ns_uri is NULL:             # <<<<<<<<<<<<<< 
 *             c_dict = python.PyDict_GetItem(
 *                 self._function_cache, None)
 */
__pyx_1 = (__pyx_v_c_ns_uri == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":264
 *         if c_ns_uri is NULL:
 *             c_dict = python.PyDict_GetItem(
 *                 self._function_cache, None)             # <<<<<<<<<<<<<< 
 *         else:
 *             c_dict = python.PyDict_GetItemString(
 */
  __pyx_v_c_dict = PyDict_GetItem(__pyx_v_self->_function_cache,Py_None);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":267
 *         else:
 *             c_dict = python.PyDict_GetItemString(
 *                 self._function_cache, c_ns_uri)             # <<<<<<<<<<<<<< 
 * 
 *         if c_dict is not NULL:
 */
  __pyx_v_c_dict = PyDict_GetItemString(__pyx_v_self->_function_cache,__pyx_v_c_ns_uri);
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":269
 *                 self._function_cache, c_ns_uri)
 * 
 *         if c_dict is not NULL:             # <<<<<<<<<<<<<< 
 *             dict_result = python.PyDict_GetItemString(
 *                 <object>c_dict, c_name)
 */
__pyx_1 = (__pyx_v_c_dict != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":271
 *         if c_dict is not NULL:
 *             dict_result = python.PyDict_GetItemString(
 *                 <object>c_dict, c_name)             # <<<<<<<<<<<<<< 
 *             if dict_result is not NULL:
 *                 return <object>dict_result
 */
  __pyx_2 = (PyObject *)__pyx_v_c_dict;
  Py_INCREF(__pyx_2);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":271
 *         if c_dict is not NULL:
 *             dict_result = python.PyDict_GetItemString(
 *                 <object>c_dict, c_name)             # <<<<<<<<<<<<<< 
 *             if dict_result is not NULL:
 *                 return <object>dict_result
 */
  __pyx_v_dict_result = PyDict_GetItemString(__pyx_2,__pyx_v_c_name);
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":272
 *             dict_result = python.PyDict_GetItemString(
 *                 <object>c_dict, c_name)
 *             if dict_result is not NULL:             # <<<<<<<<<<<<<< 
 *                 return <object>dict_result
 *         return None
 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":273
 *                 <object>c_dict, c_name)
 *             if dict_result is not NULL:
 *                 return <object>dict_result             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */
    __pyx_2 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_2);
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":274
 *             if dict_result is not NULL:
 *                 return <object>dict_result
 *         return None             # <<<<<<<<<<<<<< 
 * 
 *     # Python access to the XPath context for extension functions
 */
Py_INCREF(Py_None);
__pyx_r = Py_None;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":279
 * 
 *     property context_node:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef xmlNode* c_node
 *             if self._xpathCtxt is NULL:
 */

static PyObject *__pyx_k629p;
static PyObject *__pyx_k630p;
static PyObject *__pyx_k631p;
static PyObject *__pyx_k632p;

static char __pyx_k629[] = "XPath context is only usable during the evaluation";
static char __pyx_k630[] = "no context node";
static char __pyx_k631[] = "document-external context nodes are not supported";
static char __pyx_k632[] = "document context is missing";

static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(PyObject *__pyx_v_self) {
xmlNode *__pyx_v_c_node;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":281
 *         def __get__(self):
 *             cdef xmlNode* c_node
 *             if self._xpathCtxt is NULL:             # <<<<<<<<<<<<<< 
 *                 raise XPathError, \
 *                       "XPath context is only usable during the evaluation"
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":282
 *             cdef xmlNode* c_node
 *             if self._xpathCtxt is NULL:
 *                 raise XPathError, \             # <<<<<<<<<<<<<< 
 *                       "XPath context is only usable during the evaluation"
 *             c_node = self._xpathCtxt.node
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 282; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":283
 *             if self._xpathCtxt is NULL:
 *                 raise XPathError, \
 *                       "XPath context is only usable during the evaluation"             # <<<<<<<<<<<<<< 
 *             c_node = self._xpathCtxt.node
 *             if c_node is NULL:
 */
  __Pyx_Raise(__pyx_2, __pyx_k629p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 282; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":284
 *                 raise XPathError, \
 *                       "XPath context is only usable during the evaluation"
 *             c_node = self._xpathCtxt.node             # <<<<<<<<<<<<<< 
 *             if c_node is NULL:
 *                 raise XPathError, "no context node"
 */
__pyx_v_c_node = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt->node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":285
 *                       "XPath context is only usable during the evaluation"
 *             c_node = self._xpathCtxt.node
 *             if c_node is NULL:             # <<<<<<<<<<<<<< 
 *                 raise XPathError, "no context node"
 *             if c_node.doc != self._xpathCtxt.doc:
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":286
 *             c_node = self._xpathCtxt.node
 *             if c_node is NULL:
 *                 raise XPathError, "no context node"             # <<<<<<<<<<<<<< 
 *             if c_node.doc != self._xpathCtxt.doc:
 *                 raise XPathError, \
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 286; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":286
 *             c_node = self._xpathCtxt.node
 *             if c_node is NULL:
 *                 raise XPathError, "no context node"             # <<<<<<<<<<<<<< 
 *             if c_node.doc != self._xpathCtxt.doc:
 *                 raise XPathError, \
 */
  __Pyx_Raise(__pyx_2, __pyx_k630p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 286; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":287
 *             if c_node is NULL:
 *                 raise XPathError, "no context node"
 *             if c_node.doc != self._xpathCtxt.doc:             # <<<<<<<<<<<<<< 
 *                 raise XPathError, \
 *                       "document-external context nodes are not supported"
 */
__pyx_1 = (__pyx_v_c_node->doc != ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt->doc);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":288
 *                 raise XPathError, "no context node"
 *             if c_node.doc != self._xpathCtxt.doc:
 *                 raise XPathError, \             # <<<<<<<<<<<<<< 
 *                       "document-external context nodes are not supported"
 *             if self._doc is None:
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":289
 *             if c_node.doc != self._xpathCtxt.doc:
 *                 raise XPathError, \
 *                       "document-external context nodes are not supported"             # <<<<<<<<<<<<<< 
 *             if self._doc is None:
 *                 raise XPathError, \
 */
  __Pyx_Raise(__pyx_2, __pyx_k631p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 288; goto __pyx_L1;}
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":290
 *                 raise XPathError, \
 *                       "document-external context nodes are not supported"
 *             if self._doc is None:             # <<<<<<<<<<<<<< 
 *                 raise XPathError, \
 *                       "document context is missing"
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":291
 *                       "document-external context nodes are not supported"
 *             if self._doc is None:
 *                 raise XPathError, \             # <<<<<<<<<<<<<< 
 *                       "document context is missing"
 *             return _elementFactory(self._doc, c_node)
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":292
 *             if self._doc is None:
 *                 raise XPathError, \
 *                       "document context is missing"             # <<<<<<<<<<<<<< 
 *             return _elementFactory(self._doc, c_node)
 * 
 */
  __Pyx_Raise(__pyx_2, __pyx_k632p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":293
 *                 raise XPathError, \
 *                       "document context is missing"
 *             return _elementFactory(self._doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 *     property eval_context:
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 293; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseContext.context_node.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":296
 * 
 *     property eval_context:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             if self._eval_context_dict is None:
 *                 self._eval_context_dict = {}
 */

static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":297
 *     property eval_context:
 *         def __get__(self):
 *             if self._eval_context_dict is None:             # <<<<<<<<<<<<<< 
 *                 self._eval_context_dict = {}
 *             return self._eval_context_dict
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict == Py_None);
if (__pyx_1) {
  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":298
 *         def __get__(self):
 *             if self._eval_context_dict is None:
 *                 self._eval_context_dict = {}             # <<<<<<<<<<<<<< 
 *             return self._eval_context_dict
 * 
 */
  Py_DECREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
  ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":299
 *             if self._eval_context_dict is None:
 *                 self._eval_context_dict = {}
 *             return self._eval_context_dict             # <<<<<<<<<<<<<< 
 * 
 *     # Python reference keeping during XPath function evaluation
 */
Py_INCREF(((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict);
__pyx_r = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_v_self)->_eval_context_dict;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._BaseContext.eval_context.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":303
 *     # Python reference keeping during XPath function evaluation
 * 
 *     cdef _release_temp_refs(self):             # <<<<<<<<<<<<<< 
 *         "Free temporarily referenced objects from this context."
 *         self._temp_refs.clear()
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":305
 *     cdef _release_temp_refs(self):
 *         "Free temporarily referenced objects from this context."
 *         self._temp_refs.clear()             # <<<<<<<<<<<<<< 
 *         
 *     cdef _hold(self, obj):
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->clear(__pyx_v_self->_temp_refs); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 305; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree._BaseContext._release_temp_refs");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":307
 *         self._temp_refs.clear()
 *         
 *     cdef _hold(self, obj):             # <<<<<<<<<<<<<< 
 *         """A way to temporarily hold references to nodes in the evaluator.
 * 
 */

static  PyObject *__pyx_f_4lxml_5etree_12_BaseContext__hold(struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_self,PyObject *__pyx_v_obj) {
PyObject *__pyx_v_o;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_obj);
__pyx_v_o = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":315
 *         """
 *         cdef _Element element
 *         if isinstance(obj, _Element):             # <<<<<<<<<<<<<< 
 *             self._temp_refs.add(obj)
 *             self._temp_refs.add((<_Element>obj)._doc)
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_obj,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 315; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":316
 *         cdef _Element element
 *         if isinstance(obj, _Element):
 *             self._temp_refs.add(obj)             # <<<<<<<<<<<<<< 
 *             self._temp_refs.add((<_Element>obj)._doc)
 *             return
 */
  __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 316; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":317
 *         if isinstance(obj, _Element):
 *             self._temp_refs.add(obj)
 *             self._temp_refs.add((<_Element>obj)._doc)             # <<<<<<<<<<<<<< 
 *             return
 *         elif _isString(obj) or not python.PySequence_Check(obj):
 */
  __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 317; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":318
 *             self._temp_refs.add(obj)
 *             self._temp_refs.add((<_Element>obj)._doc)
 *             return             # <<<<<<<<<<<<<< 
 *         elif _isString(obj) or not python.PySequence_Check(obj):
 *             return
 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":319
 *             self._temp_refs.add((<_Element>obj)._doc)
 *             return
 *         elif _isString(obj) or not python.PySequence_Check(obj):             # <<<<<<<<<<<<<< 
 *             return
 *         for o in obj:
 */
__pyx_1 = _isString(__pyx_v_obj);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":319
 *             self._temp_refs.add((<_Element>obj)._doc)
 *             return
 *         elif _isString(obj) or not python.PySequence_Check(obj):             # <<<<<<<<<<<<<< 
 *             return
 *         for o in obj:
 */
  __pyx_1 = (!PySequence_Check(__pyx_v_obj));
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":320
 *             return
 *         elif _isString(obj) or not python.PySequence_Check(obj):
 *             return             # <<<<<<<<<<<<<< 
 *         for o in obj:
 *             if isinstance(o, _Element):
 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":321
 *         elif _isString(obj) or not python.PySequence_Check(obj):
 *             return
 *         for o in obj:             # <<<<<<<<<<<<<< 
 *             if isinstance(o, _Element):
 *                 #print "Holding element:", <int>element._c_node
 */
if (PyList_CheckExact(__pyx_v_obj)) { __pyx_3 = 0; __pyx_4 = __pyx_v_obj; Py_INCREF(__pyx_4); }
else { __pyx_4 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 321; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":321
 *         elif _isString(obj) or not python.PySequence_Check(obj):
 *             return
 *         for o in obj:             # <<<<<<<<<<<<<< 
 *             if isinstance(o, _Element):
 *                 #print "Holding element:", <int>element._c_node
 */
  if (PyList_CheckExact(__pyx_4)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_5 = PyList_GET_ITEM(__pyx_4, __pyx_3++); Py_INCREF(__pyx_5); }
  else {
    __pyx_5 = PyIter_Next(__pyx_4);
    if (!__pyx_5) {
      break;
    }
  }
  Py_DECREF(__pyx_v_o);
  __pyx_v_o = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":322
 *             return
 *         for o in obj:
 *             if isinstance(o, _Element):             # <<<<<<<<<<<<<< 
 *                 #print "Holding element:", <int>element._c_node
 *                 self._temp_refs.add(o)
 */
  __pyx_1 = PyObject_IsInstance(__pyx_v_o,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 322; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":324
 *             if isinstance(o, _Element):
 *                 #print "Holding element:", <int>element._c_node
 *                 self._temp_refs.add(o)             # <<<<<<<<<<<<<< 
 *                 #print "Holding document:", <int>element._doc._c_doc
 *                 self._temp_refs.add((<_Element>o)._doc)
 */
    __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 324; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":326
 *                 self._temp_refs.add(o)
 *                 #print "Holding document:", <int>element._doc._c_doc
 *                 self._temp_refs.add((<_Element>o)._doc)             # <<<<<<<<<<<<<< 
 * 
 * def Extension(module, function_mapping=None, *, ns=None):
 */
    __pyx_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_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 326; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._BaseContext._hold");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_o);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_obj);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":328
 *                 self._temp_refs.add((<_Element>o)._doc)
 * 
 * def Extension(module, function_mapping=None, *, ns=None):             # <<<<<<<<<<<<<< 
 *     """Build a dictionary of extension functions from the functions
 *     defined in a module or the methods of an object.
 */


static PyObject *__pyx_pf_4lxml_5etree_Extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_Extension[] = "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    ";
static PyObject *__pyx_pf_4lxml_5etree_Extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_module = 0;
PyObject *__pyx_v_function_mapping = 0;
PyObject *__pyx_v_ns = 0;
PyObject *__pyx_v_functions;
PyObject *__pyx_v_function_name;
PyObject *__pyx_v_xpath_name;
PyObject *__pyx_v_name;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
PyObject *__pyx_8 = 0;
int __pyx_9;
static char *__pyx_argnames[] = {"module","function_mapping","ns",0};
__pyx_v_function_mapping = __pyx_k240;
__pyx_v_ns = __pyx_k241;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_module, &__pyx_v_function_mapping, &__pyx_v_ns))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_module);
Py_INCREF(__pyx_v_function_mapping);
Py_INCREF(__pyx_v_ns);
__pyx_v_functions = Py_None; Py_INCREF(Py_None);
__pyx_v_function_name = Py_None; Py_INCREF(Py_None);
__pyx_v_xpath_name = Py_None; Py_INCREF(Py_None);
__pyx_v_name = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":339
 *     functions.
 *     """
 *     functions = {}             # <<<<<<<<<<<<<< 
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 339; goto __pyx_L1;}
Py_DECREF(__pyx_v_functions);
__pyx_v_functions = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":340
 *     """
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):             # <<<<<<<<<<<<<< 
 *         for function_name, xpath_name in function_mapping.items():
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 */
__pyx_2 = PyDict_Check(__pyx_v_function_mapping);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_function_mapping, __pyx_n_items); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (PyList_CheckExact(__pyx_4)) { __pyx_3 = 0; __pyx_1 = __pyx_4; Py_INCREF(__pyx_1); }
  else { __pyx_1 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;} }
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
    if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_4 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_1);
      if (!__pyx_4) {
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
      Py_DECREF(__pyx_v_function_name);
      __pyx_v_function_name = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
      Py_DECREF(__pyx_v_xpath_name);
      __pyx_v_xpath_name = __pyx_6;
      __pyx_6 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    else {
      __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
      Py_DECREF(__pyx_v_function_name);
      __pyx_v_function_name = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":341
 *     functions = {}
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))
 */
      Py_DECREF(__pyx_v_xpath_name);
      __pyx_v_xpath_name = __pyx_6;
      __pyx_6 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 341; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":342
 *     if python.PyDict_Check(function_mapping):
 *         for function_name, xpath_name in function_mapping.items():
 *             python.PyDict_SetItem(functions, (ns, xpath_name),             # <<<<<<<<<<<<<< 
 *                                   getattr(module, function_name))
 *     else:
 */
    __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 342; goto __pyx_L1;}
    Py_INCREF(__pyx_v_ns);
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_ns);
    Py_INCREF(__pyx_v_xpath_name);
    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_xpath_name);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":343
 *         for function_name, xpath_name in function_mapping.items():
 *             python.PyDict_SetItem(functions, (ns, xpath_name),
 *                                   getattr(module, function_name))             # <<<<<<<<<<<<<< 
 *     else:
 *         if function_mapping is None:
 */
    __pyx_4 = PyObject_GetAttr(__pyx_v_module,__pyx_v_function_name); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 343; goto __pyx_L1;}
    __pyx_7 = PyDict_SetItem(__pyx_v_functions,__pyx_6,__pyx_4); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 342; goto __pyx_L1;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":345
 *                                   getattr(module, function_name))
 *     else:
 *         if function_mapping is None:             # <<<<<<<<<<<<<< 
 *             function_mapping = [ name for name in dir(module)
 *                                  if not name.startswith('_') ]
 */
  __pyx_2 = (__pyx_v_function_mapping == Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":346
 *     else:
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<< 
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:
 */
    __pyx_5 = PyList_New(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":346
 *     else:
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<< 
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:
 */
    __pyx_6 = PyObject_Dir(__pyx_v_module); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; goto __pyx_L1;}
    if (PyList_CheckExact(__pyx_6)) { __pyx_3 = 0; __pyx_4 = __pyx_6; Py_INCREF(__pyx_4); }
    else { __pyx_4 = PyObject_GetIter(__pyx_6); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; goto __pyx_L1;} }
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":346
 *     else:
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<< 
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:
 */
      if (PyList_CheckExact(__pyx_4)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_1 = PyList_GET_ITEM(__pyx_4, __pyx_3++); Py_INCREF(__pyx_1); }
      else {
        __pyx_1 = PyIter_Next(__pyx_4);
        if (!__pyx_1) {
          break;
        }
      }
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_1;
      __pyx_1 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":347
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)
 *                                  if not name.startswith('_') ]             # <<<<<<<<<<<<<< 
 *         for function_name in function_mapping:
 *             python.PyDict_SetItem(functions, (ns, function_name),
 */
      __pyx_6 = PyObject_GetAttr(__pyx_v_name, __pyx_n_startswith); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 347; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":347
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)
 *                                  if not name.startswith('_') ]             # <<<<<<<<<<<<<< 
 *         for function_name in function_mapping:
 *             python.PyDict_SetItem(functions, (ns, function_name),
 */
      __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 347; goto __pyx_L1;}
      Py_INCREF(__pyx_n__);
      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n__);
      __pyx_8 = PyObject_CallObject(__pyx_6, __pyx_1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 347; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_8); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 347; goto __pyx_L1;}
      Py_DECREF(__pyx_8); __pyx_8 = 0;
      __pyx_9 = (!__pyx_2);
      if (__pyx_9) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":346
 *     else:
 *         if function_mapping is None:
 *             function_mapping = [ name for name in dir(module)             # <<<<<<<<<<<<<< 
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:
 */
        __pyx_7 = PyList_Append(__pyx_5, __pyx_v_name); if (unlikely(__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 346; goto __pyx_L1;}
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_function_mapping);
    __pyx_v_function_mapping = __pyx_5;
    __pyx_5 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":348
 *             function_mapping = [ name for name in dir(module)
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, function_name),
 *                                   getattr(module, function_name))
 */
  if (PyList_CheckExact(__pyx_v_function_mapping)) { __pyx_3 = 0; __pyx_6 = __pyx_v_function_mapping; Py_INCREF(__pyx_6); }
  else { __pyx_6 = PyObject_GetIter(__pyx_v_function_mapping); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 348; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":348
 *             function_mapping = [ name for name in dir(module)
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:             # <<<<<<<<<<<<<< 
 *             python.PyDict_SetItem(functions, (ns, function_name),
 *                                   getattr(module, function_name))
 */
    if (PyList_CheckExact(__pyx_6)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_6)) break; __pyx_1 = PyList_GET_ITEM(__pyx_6, __pyx_3++); Py_INCREF(__pyx_1); }
    else {
      __pyx_1 = PyIter_Next(__pyx_6);
      if (!__pyx_1) {
        break;
      }
    }
    Py_DECREF(__pyx_v_function_name);
    __pyx_v_function_name = __pyx_1;
    __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":349
 *                                  if not name.startswith('_') ]
 *         for function_name in function_mapping:
 *             python.PyDict_SetItem(functions, (ns, function_name),             # <<<<<<<<<<<<<< 
 *                                   getattr(module, function_name))
 *     return functions
 */
    __pyx_8 = PyTuple_New(2); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 349; goto __pyx_L1;}
    Py_INCREF(__pyx_v_ns);
    PyTuple_SET_ITEM(__pyx_8, 0, __pyx_v_ns);
    Py_INCREF(__pyx_v_function_name);
    PyTuple_SET_ITEM(__pyx_8, 1, __pyx_v_function_name);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":350
 *         for function_name in function_mapping:
 *             python.PyDict_SetItem(functions, (ns, function_name),
 *                                   getattr(module, function_name))             # <<<<<<<<<<<<<< 
 *     return functions
 * 
 */
    __pyx_4 = PyObject_GetAttr(__pyx_v_module,__pyx_v_function_name); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 350; goto __pyx_L1;}
    __pyx_7 = PyDict_SetItem(__pyx_v_functions,__pyx_8,__pyx_4); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 349; goto __pyx_L1;}
    Py_DECREF(__pyx_8); __pyx_8 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_6); __pyx_6 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":351
 *             python.PyDict_SetItem(functions, (ns, function_name),
 *                                   getattr(module, function_name))
 *     return functions             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
Py_INCREF(__pyx_v_functions);
__pyx_r = __pyx_v_functions;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_8);
__Pyx_AddTraceback("lxml.etree.Extension");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_functions);
Py_DECREF(__pyx_v_function_name);
Py_DECREF(__pyx_v_xpath_name);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_module);
Py_DECREF(__pyx_v_function_mapping);
Py_DECREF(__pyx_v_ns);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":358
 * cdef class _ExsltRegExp:
 *     cdef object _compile_map
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         self._compile_map = {}
 * 
 */

static int __pyx_pf_4lxml_5etree_12_ExsltRegExp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_12_ExsltRegExp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF(__pyx_v_self);
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 359; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":359
 *     cdef object _compile_map
 *     def __init__(self):
 *         self._compile_map = {}             # <<<<<<<<<<<<<< 
 * 
 *     cdef _make_string(self, value):
 */
Py_DECREF(((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map);
((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map = __pyx_1;
__pyx_1 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":361
 *         self._compile_map = {}
 * 
 *     cdef _make_string(self, value):             # <<<<<<<<<<<<<< 
 *         cdef char* c_text
 *         if _isString(value):
 */

static PyObject *__pyx_k634p;

static char __pyx_k634[] = "";

static  PyObject *__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string(struct __pyx_obj_4lxml_5etree__ExsltRegExp *__pyx_v_self,PyObject *__pyx_v_value) {
char *__pyx_v_c_text;
PyObject *__pyx_v_firstnode;
PyObject *__pyx_v_s;
PyObject *__pyx_r;
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_firstnode = Py_None; Py_INCREF(Py_None);
__pyx_v_s = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":363
 *     cdef _make_string(self, value):
 *         cdef char* c_text
 *         if _isString(value):             # <<<<<<<<<<<<<< 
 *             return value
 *         elif python.PyList_Check(value):
 */
__pyx_1 = _isString(__pyx_v_value);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":364
 *         cdef char* c_text
 *         if _isString(value):
 *             return value             # <<<<<<<<<<<<<< 
 *         elif python.PyList_Check(value):
 *             # node set: take recursive text concatenation of first element
 */
  Py_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":365
 *         if _isString(value):
 *             return value
 *         elif python.PyList_Check(value):             # <<<<<<<<<<<<<< 
 *             # node set: take recursive text concatenation of first element
 *             if python.PyList_GET_SIZE(value) == 0:
 */
__pyx_2 = PyList_Check(__pyx_v_value);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":367
 *         elif python.PyList_Check(value):
 *             # node set: take recursive text concatenation of first element
 *             if python.PyList_GET_SIZE(value) == 0:             # <<<<<<<<<<<<<< 
 *                 return ''
 *             firstnode = value[0]
 */
  __pyx_2 = (PyList_GET_SIZE(__pyx_v_value) == 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":368
 *             # node set: take recursive text concatenation of first element
 *             if python.PyList_GET_SIZE(value) == 0:
 *                 return ''             # <<<<<<<<<<<<<< 
 *             firstnode = value[0]
 *             if _isString(firstnode):
 */
    Py_INCREF(__pyx_k634p);
    __pyx_r = __pyx_k634p;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":369
 *             if python.PyList_GET_SIZE(value) == 0:
 *                 return ''
 *             firstnode = value[0]             # <<<<<<<<<<<<<< 
 *             if _isString(firstnode):
 *                 return firstnode
 */
  if (PyList_CheckExact(__pyx_v_value) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_value)) {
    __pyx_4 = PyList_GET_ITEM(__pyx_v_value, 0); Py_INCREF(__pyx_4);
    } else if (PyTuple_CheckExact(__pyx_v_value) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_value)) {
    __pyx_4 = PyTuple_GET_ITEM(__pyx_v_value, 0); Py_INCREF(__pyx_4);
    } else {
    __pyx_3 = PyInt_FromLong(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 369; goto __pyx_L1;}
    __pyx_4 = PyObject_GetItem(__pyx_v_value, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 369; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  Py_DECREF(__pyx_v_firstnode);
  __pyx_v_firstnode = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":370
 *                 return ''
 *             firstnode = value[0]
 *             if _isString(firstnode):             # <<<<<<<<<<<<<< 
 *                 return firstnode
 *             elif isinstance(firstnode, _Element):
 */
  __pyx_1 = _isString(__pyx_v_firstnode);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":371
 *             firstnode = value[0]
 *             if _isString(firstnode):
 *                 return firstnode             # <<<<<<<<<<<<<< 
 *             elif isinstance(firstnode, _Element):
 *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
 */
    Py_INCREF(__pyx_v_firstnode);
    __pyx_r = __pyx_v_firstnode;
    goto __pyx_L0;
    goto __pyx_L4;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":372
 *             if _isString(firstnode):
 *                 return firstnode
 *             elif isinstance(firstnode, _Element):             # <<<<<<<<<<<<<< 
 *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
 *                 if c_text is NULL:
 */
  __pyx_2 = PyObject_IsInstance(__pyx_v_firstnode,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 372; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":373
 *                 return firstnode
 *             elif isinstance(firstnode, _Element):
 *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)             # <<<<<<<<<<<<<< 
 *                 if c_text is NULL:
 *                     python.PyErr_NoMemory()
 */
    __pyx_v_c_text = xmlNodeGetContent(((struct LxmlElement *)__pyx_v_firstnode)->_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":374
 *             elif isinstance(firstnode, _Element):
 *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
 *                 if c_text is NULL:             # <<<<<<<<<<<<<< 
 *                     python.PyErr_NoMemory()
 *                 try:
 */
    __pyx_2 = (__pyx_v_c_text == NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":375
 *                 c_text = tree.xmlNodeGetContent((<_Element>firstnode)._c_node)
 *                 if c_text is NULL:
 *                     python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *                 try:
 *                     s = funicode(c_text)
 */
      __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 375; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":376
 *                 if c_text is NULL:
 *                     python.PyErr_NoMemory()
 *                 try:             # <<<<<<<<<<<<<< 
 *                     s = funicode(c_text)
 *                 finally:
 */
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":377
 *                     python.PyErr_NoMemory()
 *                 try:
 *                     s = funicode(c_text)             # <<<<<<<<<<<<<< 
 *                 finally:
 *                     tree.xmlFree(c_text)
 */
      __pyx_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_text); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 377; goto __pyx_L7;}
      Py_DECREF(__pyx_v_s);
      __pyx_v_s = __pyx_4;
      __pyx_4 = 0;
    }
    /*finally:*/ {
      int __pyx_why;
      PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
      int __pyx_exc_lineno;
      __pyx_why = 0; goto __pyx_L8;
      __pyx_L7: {
        __pyx_why = 4;
        Py_XDECREF(__pyx_3); __pyx_3 = 0;
        Py_XDECREF(__pyx_4); __pyx_4 = 0;
        PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
        __pyx_exc_lineno = __pyx_lineno;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":379
 *                     s = funicode(c_text)
 *                 finally:
 *                     tree.xmlFree(c_text)             # <<<<<<<<<<<<<< 
 *                 return s
 *             else:
 */
      xmlFree(__pyx_v_c_text);
      switch (__pyx_why) {
        case 4: {
          PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
          __pyx_lineno = __pyx_exc_lineno;
          __pyx_exc_type = 0;
          __pyx_exc_value = 0;
          __pyx_exc_tb = 0;
          goto __pyx_L1;
        }
      }
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":380
 *                 finally:
 *                     tree.xmlFree(c_text)
 *                 return s             # <<<<<<<<<<<<<< 
 *             else:
 *                 return str(firstnode)
 */
    Py_INCREF(__pyx_v_s);
    __pyx_r = __pyx_v_s;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":382
 *                 return s
 *             else:
 *                 return str(firstnode)             # <<<<<<<<<<<<<< 
 *         else:
 *             return str(value)
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 382; goto __pyx_L1;}
    Py_INCREF(__pyx_v_firstnode);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_firstnode);
    __pyx_4 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 382; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_r = __pyx_4;
    __pyx_4 = 0;
    goto __pyx_L0;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":384
 *                 return str(firstnode)
 *         else:
 *             return str(value)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _compile(self, rexp, ignore_case):
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 384; goto __pyx_L1;}
  Py_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_value);
  __pyx_4 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 384; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp._make_string");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_firstnode);
Py_DECREF(__pyx_v_s);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":386
 *             return str(value)
 * 
 *     cdef _compile(self, rexp, ignore_case):             # <<<<<<<<<<<<<< 
 *         cdef python.PyObject* c_result
 *         rexp = self._make_string(rexp)
 */

static PyObject *__pyx_n_UNICODE;
static PyObject *__pyx_n_IGNORECASE;

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) {
PyObject *__pyx_v_c_result;
PyObject *__pyx_v_key;
PyObject *__pyx_v_py_flags;
PyObject *__pyx_v_rexp_compiled;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_rexp);
Py_INCREF(__pyx_v_ignore_case);
__pyx_v_key = Py_None; Py_INCREF(Py_None);
__pyx_v_py_flags = Py_None; Py_INCREF(Py_None);
__pyx_v_rexp_compiled = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":388
 *     cdef _compile(self, rexp, ignore_case):
 *         cdef python.PyObject* c_result
 *         rexp = self._make_string(rexp)             # <<<<<<<<<<<<<< 
 *         key = (rexp, ignore_case)
 *         c_result = python.PyDict_GetItem(self._compile_map, key)
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp *)__pyx_v_self->__pyx_vtab)->_make_string(__pyx_v_self,__pyx_v_rexp); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 388; goto __pyx_L1;}
Py_DECREF(__pyx_v_rexp);
__pyx_v_rexp = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":389
 *         cdef python.PyObject* c_result
 *         rexp = self._make_string(rexp)
 *         key = (rexp, ignore_case)             # <<<<<<<<<<<<<< 
 *         c_result = python.PyDict_GetItem(self._compile_map, key)
 *         if c_result is not NULL:
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 389; goto __pyx_L1;}
Py_INCREF(__pyx_v_rexp);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_rexp);
Py_INCREF(__pyx_v_ignore_case);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_ignore_case);
Py_DECREF(__pyx_v_key);
__pyx_v_key = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":390
 *         rexp = self._make_string(rexp)
 *         key = (rexp, ignore_case)
 *         c_result = python.PyDict_GetItem(self._compile_map, key)             # <<<<<<<<<<<<<< 
 *         if c_result is not NULL:
 *             return <object>c_result
 */
__pyx_v_c_result = PyDict_GetItem(__pyx_v_self->_compile_map,__pyx_v_key);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":391
 *         key = (rexp, ignore_case)
 *         c_result = python.PyDict_GetItem(self._compile_map, key)
 *         if c_result is not NULL:             # <<<<<<<<<<<<<< 
 *             return <object>c_result
 *         py_flags = re.UNICODE
 */
__pyx_2 = (__pyx_v_c_result != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":392
 *         c_result = python.PyDict_GetItem(self._compile_map, key)
 *         if c_result is not NULL:
 *             return <object>c_result             # <<<<<<<<<<<<<< 
 *         py_flags = re.UNICODE
 *         if ignore_case:
 */
  __pyx_1 = (PyObject *)__pyx_v_c_result;
  Py_INCREF(__pyx_1);
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":393
 *         if c_result is not NULL:
 *             return <object>c_result
 *         py_flags = re.UNICODE             # <<<<<<<<<<<<<< 
 *         if ignore_case:
 *             py_flags = py_flags | re.IGNORECASE
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_UNICODE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 393; goto __pyx_L1;}
Py_DECREF(__pyx_v_py_flags);
__pyx_v_py_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":394
 *             return <object>c_result
 *         py_flags = re.UNICODE
 *         if ignore_case:             # <<<<<<<<<<<<<< 
 *             py_flags = py_flags | re.IGNORECASE
 *         rexp_compiled = re.compile(rexp, py_flags)
 */
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_ignore_case); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 394; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":395
 *         py_flags = re.UNICODE
 *         if ignore_case:
 *             py_flags = py_flags | re.IGNORECASE             # <<<<<<<<<<<<<< 
 *         rexp_compiled = re.compile(rexp, py_flags)
 *         python.PyDict_SetItem(self._compile_map, key, rexp_compiled)
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_IGNORECASE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 395; goto __pyx_L1;}
  __pyx_3 = PyNumber_Or(__pyx_v_py_flags, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 395; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_py_flags);
  __pyx_v_py_flags = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":396
 *         if ignore_case:
 *             py_flags = py_flags | re.IGNORECASE
 *         rexp_compiled = re.compile(rexp, py_flags)             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(self._compile_map, key, rexp_compiled)
 *         return rexp_compiled
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":396
 *         if ignore_case:
 *             py_flags = py_flags | re.IGNORECASE
 *         rexp_compiled = re.compile(rexp, py_flags)             # <<<<<<<<<<<<<< 
 *         python.PyDict_SetItem(self._compile_map, key, rexp_compiled)
 *         return rexp_compiled
 */
__pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; goto __pyx_L1;}
Py_INCREF(__pyx_v_rexp);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_rexp);
Py_INCREF(__pyx_v_py_flags);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_py_flags);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 396; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_v_rexp_compiled);
__pyx_v_rexp_compiled = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":397
 *             py_flags = py_flags | re.IGNORECASE
 *         rexp_compiled = re.compile(rexp, py_flags)
 *         python.PyDict_SetItem(self._compile_map, key, rexp_compiled)             # <<<<<<<<<<<<<< 
 *         return rexp_compiled
 * 
 */
__pyx_5 = PyDict_SetItem(__pyx_v_self->_compile_map,__pyx_v_key,__pyx_v_rexp_compiled); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 397; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":398
 *         rexp_compiled = re.compile(rexp, py_flags)
 *         python.PyDict_SetItem(self._compile_map, key, rexp_compiled)
 *         return rexp_compiled             # <<<<<<<<<<<<<< 
 * 
 *     def test(self, ctxt, s, rexp, flags=''):
 */
Py_INCREF(__pyx_v_rexp_compiled);
__pyx_r = __pyx_v_rexp_compiled;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp._compile");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_py_flags);
Py_DECREF(__pyx_v_rexp_compiled);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_rexp);
Py_DECREF(__pyx_v_ignore_case);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":400
 *         return rexp_compiled
 * 
 *     def test(self, ctxt, s, rexp, flags=''):             # <<<<<<<<<<<<<< 
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 */

static PyObject *__pyx_n_i;
static PyObject *__pyx_n_search;


static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctxt = 0;
PyObject *__pyx_v_s = 0;
PyObject *__pyx_v_rexp = 0;
PyObject *__pyx_v_flags = 0;
PyObject *__pyx_v_rexpc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"ctxt","s","rexp","flags",0};
__pyx_v_flags = __pyx_k243;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ctxt, &__pyx_v_s, &__pyx_v_rexp, &__pyx_v_flags))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_ctxt);
Py_INCREF(__pyx_v_s);
Py_INCREF(__pyx_v_rexp);
Py_INCREF(__pyx_v_flags);
__pyx_v_rexpc = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":401
 * 
 *     def test(self, ctxt, s, rexp, flags=''):
 *         flags = self._make_string(flags)             # <<<<<<<<<<<<<< 
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 401; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":402
 *     def test(self, ctxt, s, rexp, flags=''):
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)             # <<<<<<<<<<<<<< 
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if rexpc.search(s) is None:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 402; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":403
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)             # <<<<<<<<<<<<<< 
 *         if rexpc.search(s) is None:
 *             return False
 */
__pyx_2 = (PySequence_Contains(__pyx_v_flags, __pyx_n_i)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; goto __pyx_L1;}
__pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; goto __pyx_L1;}
__pyx_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_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 403; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":404
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if rexpc.search(s) is None:             # <<<<<<<<<<<<<< 
 *             return False
 *         else:
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_search); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":404
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if rexpc.search(s) is None:             # <<<<<<<<<<<<<< 
 *             return False
 *         else:
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; goto __pyx_L1;}
Py_INCREF(__pyx_v_s);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 404; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":404
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if rexpc.search(s) is None:             # <<<<<<<<<<<<<< 
 *             return False
 *         else:
 */
__pyx_2 = (__pyx_4 == Py_None);
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":405
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if rexpc.search(s) is None:
 *             return False             # <<<<<<<<<<<<<< 
 *         else:
 *             return True
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":407
 *             return False
 *         else:
 *             return True             # <<<<<<<<<<<<<< 
 * 
 *     def match(self, ctxt, s, rexp, flags=''):
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp.test");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_rexpc);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ctxt);
Py_DECREF(__pyx_v_s);
Py_DECREF(__pyx_v_rexp);
Py_DECREF(__pyx_v_flags);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":409
 *             return True
 * 
 *     def match(self, ctxt, s, rexp, flags=''):             # <<<<<<<<<<<<<< 
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 */

static PyObject *__pyx_n_g;
static PyObject *__pyx_n_groups;
static PyObject *__pyx_n_matches;
static PyObject *__pyx_n_SubElement;

static PyObject *__pyx_k638p;
static PyObject *__pyx_k640p;

static char __pyx_k638[] = "";
static char __pyx_k640[] = "";

static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctxt = 0;
PyObject *__pyx_v_s = 0;
PyObject *__pyx_v_rexp = 0;
PyObject *__pyx_v_flags = 0;
PyObject *__pyx_v_rexpc;
PyObject *__pyx_v_results;
PyObject *__pyx_v_result;
PyObject *__pyx_v_result_list;
PyObject *__pyx_v_root;
PyObject *__pyx_v_join_groups;
PyObject *__pyx_v_s_match;
PyObject *__pyx_v_elem;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
PyObject *__pyx_6 = 0;
Py_ssize_t __pyx_7;
int __pyx_8;
static char *__pyx_argnames[] = {"ctxt","s","rexp","flags",0};
__pyx_v_flags = __pyx_k245;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ctxt, &__pyx_v_s, &__pyx_v_rexp, &__pyx_v_flags))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_ctxt);
Py_INCREF(__pyx_v_s);
Py_INCREF(__pyx_v_rexp);
Py_INCREF(__pyx_v_flags);
__pyx_v_rexpc = Py_None; Py_INCREF(Py_None);
__pyx_v_results = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);
__pyx_v_result_list = Py_None; Py_INCREF(Py_None);
__pyx_v_root = Py_None; Py_INCREF(Py_None);
__pyx_v_join_groups = Py_None; Py_INCREF(Py_None);
__pyx_v_s_match = Py_None; Py_INCREF(Py_None);
__pyx_v_elem = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":410
 * 
 *     def match(self, ctxt, s, rexp, flags=''):
 *         flags = self._make_string(flags)             # <<<<<<<<<<<<<< 
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 410; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":411
 *     def match(self, ctxt, s, rexp, flags=''):
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)             # <<<<<<<<<<<<<< 
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 411; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":412
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)             # <<<<<<<<<<<<<< 
 *         if 'g' in flags:
 *             results = rexpc.findall(s)
 */
__pyx_2 = (PySequence_Contains(__pyx_v_flags, __pyx_n_i)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 412; goto __pyx_L1;}
__pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 412; goto __pyx_L1;}
__pyx_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_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 412; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":413
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:             # <<<<<<<<<<<<<< 
 *             results = rexpc.findall(s)
 *             if not results:
 */
__pyx_2 = (PySequence_Contains(__pyx_v_flags, __pyx_n_g)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 413; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":414
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:
 *             results = rexpc.findall(s)             # <<<<<<<<<<<<<< 
 *             if not results:
 *                 return ()
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_findall); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":414
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:
 *             results = rexpc.findall(s)             # <<<<<<<<<<<<<< 
 *             if not results:
 *                 return ()
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; goto __pyx_L1;}
  Py_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 414; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_results);
  __pyx_v_results = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":415
 *         if 'g' in flags:
 *             results = rexpc.findall(s)
 *             if not results:             # <<<<<<<<<<<<<< 
 *                 return ()
 *         else:
 */
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_results); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 415; goto __pyx_L1;}
  __pyx_5 = (!__pyx_2);
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":416
 *             results = rexpc.findall(s)
 *             if not results:
 *                 return ()             # <<<<<<<<<<<<<< 
 *         else:
 *             result = rexpc.search(s)
 */
    __pyx_1 = PyTuple_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 416; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":418
 *                 return ()
 *         else:
 *             result = rexpc.search(s)             # <<<<<<<<<<<<<< 
 *             if not result:
 *                 return ()
 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_search); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":418
 *                 return ()
 *         else:
 *             result = rexpc.search(s)             # <<<<<<<<<<<<<< 
 *             if not result:
 *                 return ()
 */
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; goto __pyx_L1;}
  Py_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_s);
  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 418; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":419
 *         else:
 *             result = rexpc.search(s)
 *             if not result:             # <<<<<<<<<<<<<< 
 *                 return ()
 *             results = [ result.group() ]
 */
  __pyx_2 = __Pyx_PyObject_IsTrue(__pyx_v_result); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 419; goto __pyx_L1;}
  __pyx_5 = (!__pyx_2);
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":420
 *             result = rexpc.search(s)
 *             if not result:
 *                 return ()             # <<<<<<<<<<<<<< 
 *             results = [ result.group() ]
 *             results.extend( result.groups('') )
 */
    __pyx_3 = PyTuple_New(0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 420; goto __pyx_L1;}
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":421
 *             if not result:
 *                 return ()
 *             results = [ result.group() ]             # <<<<<<<<<<<<<< 
 *             results.extend( result.groups('') )
 *         result_list = []
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_result, __pyx_n_group); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 421; goto __pyx_L1;}
  __pyx_1 = PyObject_CallObject(__pyx_4, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 421; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyList_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 421; goto __pyx_L1;}
  PyList_SET_ITEM(__pyx_3, 0, __pyx_1);
  __pyx_1 = 0;
  Py_DECREF(__pyx_v_results);
  __pyx_v_results = __pyx_3;
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":422
 *                 return ()
 *             results = [ result.group() ]
 *             results.extend( result.groups('') )             # <<<<<<<<<<<<<< 
 *         result_list = []
 *         root = Element('matches')
 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_results, __pyx_n_extend); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":422
 *                 return ()
 *             results = [ result.group() ]
 *             results.extend( result.groups('') )             # <<<<<<<<<<<<<< 
 *         result_list = []
 *         root = Element('matches')
 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_result, __pyx_n_groups); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":422
 *                 return ()
 *             results = [ result.group() ]
 *             results.extend( result.groups('') )             # <<<<<<<<<<<<<< 
 *         result_list = []
 *         root = Element('matches')
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}
  Py_INCREF(__pyx_k638p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k638p);
  __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
  __pyx_6 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 422; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":423
 *             results = [ result.group() ]
 *             results.extend( result.groups('') )
 *         result_list = []             # <<<<<<<<<<<<<< 
 *         root = Element('matches')
 *         join_groups = ''.join
 */
__pyx_6 = PyList_New(0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 423; goto __pyx_L1;}
Py_DECREF(__pyx_v_result_list);
__pyx_v_result_list = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":424
 *             results.extend( result.groups('') )
 *         result_list = []
 *         root = Element('matches')             # <<<<<<<<<<<<<< 
 *         join_groups = ''.join
 *         for s_match in results:
 */
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Element); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 424; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":424
 *             results.extend( result.groups('') )
 *         result_list = []
 *         root = Element('matches')             # <<<<<<<<<<<<<< 
 *         join_groups = ''.join
 *         for s_match in results:
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 424; goto __pyx_L1;}
Py_INCREF(__pyx_n_matches);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_matches);
__pyx_3 = PyObject_CallObject(__pyx_4, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 424; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":425
 *         result_list = []
 *         root = Element('matches')
 *         join_groups = ''.join             # <<<<<<<<<<<<<< 
 *         for s_match in results:
 *             if python.PyTuple_CheckExact(s_match):
 */
__pyx_6 = PyObject_GetAttr(__pyx_k640p, __pyx_n_join); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 425; goto __pyx_L1;}
Py_DECREF(__pyx_v_join_groups);
__pyx_v_join_groups = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":426
 *         root = Element('matches')
 *         join_groups = ''.join
 *         for s_match in results:             # <<<<<<<<<<<<<< 
 *             if python.PyTuple_CheckExact(s_match):
 *                 s_match = join_groups(s_match)
 */
if (PyList_CheckExact(__pyx_v_results)) { __pyx_7 = 0; __pyx_4 = __pyx_v_results; Py_INCREF(__pyx_4); }
else { __pyx_4 = PyObject_GetIter(__pyx_v_results); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 426; goto __pyx_L1;} }
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":426
 *         root = Element('matches')
 *         join_groups = ''.join
 *         for s_match in results:             # <<<<<<<<<<<<<< 
 *             if python.PyTuple_CheckExact(s_match):
 *                 s_match = join_groups(s_match)
 */
  if (PyList_CheckExact(__pyx_4)) { if (__pyx_7 >= PyList_GET_SIZE(__pyx_4)) break; __pyx_1 = PyList_GET_ITEM(__pyx_4, __pyx_7++); Py_INCREF(__pyx_1); }
  else {
    __pyx_1 = PyIter_Next(__pyx_4);
    if (!__pyx_1) {
      break;
    }
  }
  Py_DECREF(__pyx_v_s_match);
  __pyx_v_s_match = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":427
 *         join_groups = ''.join
 *         for s_match in results:
 *             if python.PyTuple_CheckExact(s_match):             # <<<<<<<<<<<<<< 
 *                 s_match = join_groups(s_match)
 *             elem = SubElement(root, 'match')
 */
  __pyx_2 = PyTuple_CheckExact(__pyx_v_s_match);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":428
 *         for s_match in results:
 *             if python.PyTuple_CheckExact(s_match):
 *                 s_match = join_groups(s_match)             # <<<<<<<<<<<<<< 
 *             elem = SubElement(root, 'match')
 *             elem.text = s_match
 */
    __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; goto __pyx_L1;}
    Py_INCREF(__pyx_v_s_match);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_s_match);
    __pyx_6 = PyObject_CallObject(__pyx_v_join_groups, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 428; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_v_s_match);
    __pyx_v_s_match = __pyx_6;
    __pyx_6 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":429
 *             if python.PyTuple_CheckExact(s_match):
 *                 s_match = join_groups(s_match)
 *             elem = SubElement(root, 'match')             # <<<<<<<<<<<<<< 
 *             elem.text = s_match
 *             python.PyList_Append(result_list, elem)
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_SubElement); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":429
 *             if python.PyTuple_CheckExact(s_match):
 *                 s_match = join_groups(s_match)
 *             elem = SubElement(root, 'match')             # <<<<<<<<<<<<<< 
 *             elem.text = s_match
 *             python.PyList_Append(result_list, elem)
 */
  __pyx_3 = PyTuple_New(2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; goto __pyx_L1;}
  Py_INCREF(__pyx_v_root);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_root);
  Py_INCREF(__pyx_n_match);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_n_match);
  __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 429; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_elem);
  __pyx_v_elem = __pyx_6;
  __pyx_6 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":430
 *                 s_match = join_groups(s_match)
 *             elem = SubElement(root, 'match')
 *             elem.text = s_match             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(result_list, elem)
 *         return result_list
 */
  if (PyObject_SetAttr(__pyx_v_elem, __pyx_n_text, __pyx_v_s_match) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 430; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":431
 *             elem = SubElement(root, 'match')
 *             elem.text = s_match
 *             python.PyList_Append(result_list, elem)             # <<<<<<<<<<<<<< 
 *         return result_list
 * 
 */
  __pyx_8 = PyList_Append(__pyx_v_result_list,__pyx_v_elem); if (unlikely(__pyx_8 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 431; goto __pyx_L1;}
}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":432
 *             elem.text = s_match
 *             python.PyList_Append(result_list, elem)
 *         return result_list             # <<<<<<<<<<<<<< 
 * 
 *     def replace(self, ctxt, s, rexp, flags, replacement):
 */
Py_INCREF(__pyx_v_result_list);
__pyx_r = __pyx_v_result_list;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp.match");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_rexpc);
Py_DECREF(__pyx_v_results);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_result_list);
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_join_groups);
Py_DECREF(__pyx_v_s_match);
Py_DECREF(__pyx_v_elem);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ctxt);
Py_DECREF(__pyx_v_s);
Py_DECREF(__pyx_v_rexp);
Py_DECREF(__pyx_v_flags);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":434
 *         return result_list
 * 
 *     def replace(self, ctxt, s, rexp, flags, replacement):             # <<<<<<<<<<<<<< 
 *         replacement = self._make_string(replacement)
 *         flags = self._make_string(flags)
 */


static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ctxt = 0;
PyObject *__pyx_v_s = 0;
PyObject *__pyx_v_rexp = 0;
PyObject *__pyx_v_flags = 0;
PyObject *__pyx_v_replacement = 0;
PyObject *__pyx_v_rexpc;
PyObject *__pyx_v_count;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"ctxt","s","rexp","flags","replacement",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOOO", __pyx_argnames, &__pyx_v_ctxt, &__pyx_v_s, &__pyx_v_rexp, &__pyx_v_flags, &__pyx_v_replacement))) return NULL;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_ctxt);
Py_INCREF(__pyx_v_s);
Py_INCREF(__pyx_v_rexp);
Py_INCREF(__pyx_v_flags);
Py_INCREF(__pyx_v_replacement);
__pyx_v_rexpc = Py_None; Py_INCREF(Py_None);
__pyx_v_count = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":435
 * 
 *     def replace(self, ctxt, s, rexp, flags, replacement):
 *         replacement = self._make_string(replacement)             # <<<<<<<<<<<<<< 
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 435; goto __pyx_L1;}
Py_DECREF(__pyx_v_replacement);
__pyx_v_replacement = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":436
 *     def replace(self, ctxt, s, rexp, flags, replacement):
 *         replacement = self._make_string(replacement)
 *         flags = self._make_string(flags)             # <<<<<<<<<<<<<< 
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 436; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":437
 *         replacement = self._make_string(replacement)
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)             # <<<<<<<<<<<<<< 
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 437; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":438
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)             # <<<<<<<<<<<<<< 
 *         if 'g' in flags:
 *             count = 0
 */
__pyx_2 = (PySequence_Contains(__pyx_v_flags, __pyx_n_i)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 438; goto __pyx_L1;}
__pyx_1 = __Pyx_PyBool_FromLong(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 438; goto __pyx_L1;}
__pyx_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_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 438; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":439
 *         s = self._make_string(s)
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:             # <<<<<<<<<<<<<< 
 *             count = 0
 *         else:
 */
__pyx_2 = (PySequence_Contains(__pyx_v_flags, __pyx_n_g)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 439; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":440
 *         rexpc = self._compile(rexp, 'i' in flags)
 *         if 'g' in flags:
 *             count = 0             # <<<<<<<<<<<<<< 
 *         else:
 *             count = 1
 */
  Py_INCREF(__pyx_num_0);
  Py_DECREF(__pyx_v_count);
  __pyx_v_count = __pyx_num_0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":442
 *             count = 0
 *         else:
 *             count = 1             # <<<<<<<<<<<<<< 
 *         return rexpc.sub(replacement, s, count)
 * 
 */
  Py_INCREF(__pyx_num_1);
  Py_DECREF(__pyx_v_count);
  __pyx_v_count = __pyx_num_1;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":443
 *         else:
 *             count = 1
 *         return rexpc.sub(replacement, s, count)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _register_in_context(self, _BaseContext context):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_sub); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":443
 *         else:
 *             count = 1
 *         return rexpc.sub(replacement, s, count)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _register_in_context(self, _BaseContext context):
 */
__pyx_3 = PyTuple_New(3); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; goto __pyx_L1;}
Py_INCREF(__pyx_v_replacement);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_replacement);
Py_INCREF(__pyx_v_s);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_s);
Py_INCREF(__pyx_v_count);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_count);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 443; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp.replace");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_rexpc);
Py_DECREF(__pyx_v_count);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ctxt);
Py_DECREF(__pyx_v_s);
Py_DECREF(__pyx_v_rexp);
Py_DECREF(__pyx_v_flags);
Py_DECREF(__pyx_v_replacement);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":445
 *         return rexpc.sub(replacement, s, count)
 * 
 *     cdef _register_in_context(self, _BaseContext context):             # <<<<<<<<<<<<<< 
 *         ns = "http://exslt.org/regular-expressions"
 *         context._addLocalExtensionFunction(ns, "test",    self.test)
 */

static PyObject *__pyx_k644p;

static char __pyx_k644[] = "http://exslt.org/regular-expressions";

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) {
PyObject *__pyx_v_ns;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_context);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":446
 * 
 *     cdef _register_in_context(self, _BaseContext context):
 *         ns = "http://exslt.org/regular-expressions"             # <<<<<<<<<<<<<< 
 *         context._addLocalExtensionFunction(ns, "test",    self.test)
 *         context._addLocalExtensionFunction(ns, "match",   self.match)
 */
Py_INCREF(__pyx_k644p);
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_k644p;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":447
 *     cdef _register_in_context(self, _BaseContext context):
 *         ns = "http://exslt.org/regular-expressions"
 *         context._addLocalExtensionFunction(ns, "test",    self.test)             # <<<<<<<<<<<<<< 
 *         context._addLocalExtensionFunction(ns, "match",   self.match)
 *         context._addLocalExtensionFunction(ns, "replace", self.replace)
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_test); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 447; goto __pyx_L1;}
((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context,__pyx_v_ns,__pyx_n_test,__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":448
 *         ns = "http://exslt.org/regular-expressions"
 *         context._addLocalExtensionFunction(ns, "test",    self.test)
 *         context._addLocalExtensionFunction(ns, "match",   self.match)             # <<<<<<<<<<<<<< 
 *         context._addLocalExtensionFunction(ns, "replace", self.replace)
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_match); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 448; goto __pyx_L1;}
((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context,__pyx_v_ns,__pyx_n_match,__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":449
 *         context._addLocalExtensionFunction(ns, "test",    self.test)
 *         context._addLocalExtensionFunction(ns, "match",   self.match)
 *         context._addLocalExtensionFunction(ns, "replace", self.replace)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_replace); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 449; goto __pyx_L1;}
((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context,__pyx_v_ns,__pyx_n_replace,__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._ExsltRegExp._register_in_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":455
 * # helper functions
 * 
 * cdef xpath.xmlXPathObject* _wrapXPathObject(object obj) except NULL:             # <<<<<<<<<<<<<< 
 *     cdef xpath.xmlNodeSet* resultSet
 *     cdef _Element node
 */

static PyObject *__pyx_k648p;
static PyObject *__pyx_k649p;

static char __pyx_k648[] = "This is not a node: %s";
static char __pyx_k649[] = "Unknown return type: %s";

static  xmlXPathObject *__pyx_f_4lxml_5etree__wrapXPathObject(PyObject *__pyx_v_obj) {
xmlNodeSet *__pyx_v_resultSet;
struct LxmlElement *__pyx_v_node;
PyObject *__pyx_v_element;
xmlXPathObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
double __pyx_4;
Py_ssize_t __pyx_5;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
Py_INCREF(__pyx_v_obj);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":458
 *     cdef xpath.xmlNodeSet* resultSet
 *     cdef _Element node
 *     if python.PyUnicode_Check(obj):             # <<<<<<<<<<<<<< 
 *         obj = _utf8(obj)
 *     if python.PyString_Check(obj):
 */
__pyx_1 = PyUnicode_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":459
 *     cdef _Element node
 *     if python.PyUnicode_Check(obj):
 *         obj = _utf8(obj)             # <<<<<<<<<<<<<< 
 *     if python.PyString_Check(obj):
 *         return xpath.xmlXPathNewCString(_cstr(obj))
 */
  __pyx_2 = __pyx_f_4lxml_5etree__utf8(__pyx_v_obj); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 459; goto __pyx_L1;}
  Py_DECREF(__pyx_v_obj);
  __pyx_v_obj = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":460
 *     if python.PyUnicode_Check(obj):
 *         obj = _utf8(obj)
 *     if python.PyString_Check(obj):             # <<<<<<<<<<<<<< 
 *         return xpath.xmlXPathNewCString(_cstr(obj))
 *     if python.PyBool_Check(obj):
 */
__pyx_1 = PyString_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":461
 *         obj = _utf8(obj)
 *     if python.PyString_Check(obj):
 *         return xpath.xmlXPathNewCString(_cstr(obj))             # <<<<<<<<<<<<<< 
 *     if python.PyBool_Check(obj):
 *         return xpath.xmlXPathNewBoolean(obj)
 */
  __pyx_r = xmlXPathNewCString(_cstr(__pyx_v_obj));
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":462
 *     if python.PyString_Check(obj):
 *         return xpath.xmlXPathNewCString(_cstr(obj))
 *     if python.PyBool_Check(obj):             # <<<<<<<<<<<<<< 
 *         return xpath.xmlXPathNewBoolean(obj)
 *     if python.PyNumber_Check(obj):
 */
__pyx_3 = PyBool_Check(__pyx_v_obj);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":463
 *         return xpath.xmlXPathNewCString(_cstr(obj))
 *     if python.PyBool_Check(obj):
 *         return xpath.xmlXPathNewBoolean(obj)             # <<<<<<<<<<<<<< 
 *     if python.PyNumber_Check(obj):
 *         return xpath.xmlXPathNewFloat(obj)
 */
  __pyx_1 = PyInt_AsLong(__pyx_v_obj); if (unlikely((__pyx_1 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 463; goto __pyx_L1;}
  __pyx_r = xmlXPathNewBoolean(__pyx_1);
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":464
 *     if python.PyBool_Check(obj):
 *         return xpath.xmlXPathNewBoolean(obj)
 *     if python.PyNumber_Check(obj):             # <<<<<<<<<<<<<< 
 *         return xpath.xmlXPathNewFloat(obj)
 *     if obj is None:
 */
__pyx_3 = PyNumber_Check(__pyx_v_obj);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":465
 *         return xpath.xmlXPathNewBoolean(obj)
 *     if python.PyNumber_Check(obj):
 *         return xpath.xmlXPathNewFloat(obj)             # <<<<<<<<<<<<<< 
 *     if obj is None:
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 */
  __pyx_4 = PyFloat_AsDouble(__pyx_v_obj); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 465; goto __pyx_L1;}
  __pyx_r = xmlXPathNewFloat(__pyx_4);
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":466
 *     if python.PyNumber_Check(obj):
 *         return xpath.xmlXPathNewFloat(obj)
 *     if obj is None:             # <<<<<<<<<<<<<< 
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *     elif isinstance(obj, _Element):
 */
__pyx_3 = (__pyx_v_obj == Py_None);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":467
 *         return xpath.xmlXPathNewFloat(obj)
 *     if obj is None:
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)             # <<<<<<<<<<<<<< 
 *     elif isinstance(obj, _Element):
 *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);
  goto __pyx_L6;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":468
 *     if obj is None:
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *     elif isinstance(obj, _Element):             # <<<<<<<<<<<<<< 
 *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
 *     elif python.PySequence_Check(obj):
 */
__pyx_3 = PyObject_IsInstance(__pyx_v_obj,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 468; goto __pyx_L1;}
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":469
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *     elif isinstance(obj, _Element):
 *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)             # <<<<<<<<<<<<<< 
 *     elif python.PySequence_Check(obj):
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(((struct LxmlElement *)__pyx_v_obj)->_c_node);
  goto __pyx_L6;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":470
 *     elif isinstance(obj, _Element):
 *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
 *     elif python.PySequence_Check(obj):             # <<<<<<<<<<<<<< 
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *         for element in obj:
 */
__pyx_3 = PySequence_Check(__pyx_v_obj);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":471
 *         resultSet = xpath.xmlXPathNodeSetCreate((<_Element>obj)._c_node)
 *     elif python.PySequence_Check(obj):
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)             # <<<<<<<<<<<<<< 
 *         for element in obj:
 *             if isinstance(element, _Element):
 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":472
 *     elif python.PySequence_Check(obj):
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *         for element in obj:             # <<<<<<<<<<<<<< 
 *             if isinstance(element, _Element):
 *                 node = <_Element>element
 */
  if (PyList_CheckExact(__pyx_v_obj)) { __pyx_5 = 0; __pyx_2 = __pyx_v_obj; Py_INCREF(__pyx_2); }
  else { __pyx_2 = PyObject_GetIter(__pyx_v_obj); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 472; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":472
 *     elif python.PySequence_Check(obj):
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *         for element in obj:             # <<<<<<<<<<<<<< 
 *             if isinstance(element, _Element):
 *                 node = <_Element>element
 */
    if (PyList_CheckExact(__pyx_2)) { if (__pyx_5 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_6 = PyList_GET_ITEM(__pyx_2, __pyx_5++); Py_INCREF(__pyx_6); }
    else {
      __pyx_6 = PyIter_Next(__pyx_2);
      if (!__pyx_6) {
        break;
      }
    }
    Py_DECREF(__pyx_v_element);
    __pyx_v_element = __pyx_6;
    __pyx_6 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":473
 *         resultSet = xpath.xmlXPathNodeSetCreate(NULL)
 *         for element in obj:
 *             if isinstance(element, _Element):             # <<<<<<<<<<<<<< 
 *                 node = <_Element>element
 *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
 */
    __pyx_3 = PyObject_IsInstance(__pyx_v_element,((PyObject*)__pyx_ptype_4lxml_5etree__Element)); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 473; goto __pyx_L1;}
    if (__pyx_3) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":474
 *         for element in obj:
 *             if isinstance(element, _Element):
 *                 node = <_Element>element             # <<<<<<<<<<<<<< 
 *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
 *             else:
 */
      Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_element)));
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_v_element);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":475
 *             if isinstance(element, _Element):
 *                 node = <_Element>element
 *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)             # <<<<<<<<<<<<<< 
 *             else:
 *                 xpath.xmlXPathFreeNodeSet(resultSet)
 */
      xmlXPathNodeSetAdd(__pyx_v_resultSet,__pyx_v_node->_c_node);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":477
 *                 xpath.xmlXPathNodeSetAdd(resultSet, node._c_node)
 *             else:
 *                 xpath.xmlXPathFreeNodeSet(resultSet)             # <<<<<<<<<<<<<< 
 *                 raise XPathResultError, "This is not a node: %s" % element
 *     else:
 */
      xmlXPathFreeNodeSet(__pyx_v_resultSet);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":478
 *             else:
 *                 xpath.xmlXPathFreeNodeSet(resultSet)
 *                 raise XPathResultError, "This is not a node: %s" % element             # <<<<<<<<<<<<<< 
 *     else:
 *         raise XPathResultError, "Unknown return type: %s" % type(obj)
 */
      __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 478; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":478
 *             else:
 *                 xpath.xmlXPathFreeNodeSet(resultSet)
 *                 raise XPathResultError, "This is not a node: %s" % element             # <<<<<<<<<<<<<< 
 *     else:
 *         raise XPathResultError, "Unknown return type: %s" % type(obj)
 */
      __pyx_7 = PyNumber_Remainder(__pyx_k648p, __pyx_v_element); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 478; goto __pyx_L1;}
      __Pyx_Raise(__pyx_6, __pyx_7, 0);
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      Py_DECREF(__pyx_7); __pyx_7 = 0;
      {__pyx_filename = __pyx_f[12]; __pyx_lineno = 478; goto __pyx_L1;}
    }
    __pyx_L9:;
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":480
 *                 raise XPathResultError, "This is not a node: %s" % element
 *     else:
 *         raise XPathResultError, "Unknown return type: %s" % type(obj)             # <<<<<<<<<<<<<< 
 *     return xpath.xmlXPathWrapNodeSet(resultSet)
 * 
 */
  __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 480; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":480
 *                 raise XPathResultError, "This is not a node: %s" % element
 *     else:
 *         raise XPathResultError, "Unknown return type: %s" % type(obj)             # <<<<<<<<<<<<<< 
 *     return xpath.xmlXPathWrapNodeSet(resultSet)
 * 
 */
  __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 480; goto __pyx_L1;}
  Py_INCREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_7, 0, __pyx_v_obj);
  __pyx_2 = PyObject_CallObject(((PyObject*)&PyType_Type), __pyx_7); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 480; goto __pyx_L1;}
  Py_DECREF(__pyx_7); __pyx_7 = 0;
  __pyx_7 = PyNumber_Remainder(__pyx_k649p, __pyx_2); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 480; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_6, __pyx_7, 0);
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_7); __pyx_7 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 480; goto __pyx_L1;}
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":481
 *     else:
 *         raise XPathResultError, "Unknown return type: %s" % type(obj)
 *     return xpath.xmlXPathWrapNodeSet(resultSet)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,
 */
__pyx_r = xmlXPathWrapNodeSet(__pyx_v_resultSet);
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree._wrapXPathObject");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_obj);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":483
 *     return xpath.xmlXPathWrapNodeSet(resultSet)
 * 
 * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,             # <<<<<<<<<<<<<< 
 *                                _Document doc):
 *     if xpathObj.type == xpath.XPATH_UNDEFINED:
 */

static PyObject *__pyx_n_NotImplementedError;

static PyObject *__pyx_k650p;
static PyObject *__pyx_k651p;

static PyObject *__pyx_builtin_NotImplementedError;

static char __pyx_k650[] = "Undefined xpath result";
static char __pyx_k651[] = "Unknown xpath result %s";

static  PyObject *__pyx_f_4lxml_5etree__unwrapXPathObject(xmlXPathObject *__pyx_v_xpathObj,struct LxmlDocument *__pyx_v_doc) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":485
 * cdef object _unwrapXPathObject(xpath.xmlXPathObject* xpathObj,
 *                                _Document doc):
 *     if xpathObj.type == xpath.XPATH_UNDEFINED:             # <<<<<<<<<<<<<< 
 *         raise XPathResultError, "Undefined xpath result"
 *     elif xpathObj.type == xpath.XPATH_NODESET:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_UNDEFINED);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":486
 *                                _Document doc):
 *     if xpathObj.type == xpath.XPATH_UNDEFINED:
 *         raise XPathResultError, "Undefined xpath result"             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_NODESET:
 *         return _createNodeSetResult(xpathObj, doc)
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 486; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":486
 *                                _Document doc):
 *     if xpathObj.type == xpath.XPATH_UNDEFINED:
 *         raise XPathResultError, "Undefined xpath result"             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_NODESET:
 *         return _createNodeSetResult(xpathObj, doc)
 */
  __Pyx_Raise(__pyx_2, __pyx_k650p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 486; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":487
 *     if xpathObj.type == xpath.XPATH_UNDEFINED:
 *         raise XPathResultError, "Undefined xpath result"
 *     elif xpathObj.type == xpath.XPATH_NODESET:             # <<<<<<<<<<<<<< 
 *         return _createNodeSetResult(xpathObj, doc)
 *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_NODESET);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":488
 *         raise XPathResultError, "Undefined xpath result"
 *     elif xpathObj.type == xpath.XPATH_NODESET:
 *         return _createNodeSetResult(xpathObj, doc)             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
 *         return python.PyBool_FromLong(xpathObj.boolval)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__createNodeSetResult(__pyx_v_xpathObj,__pyx_v_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 488; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":489
 *     elif xpathObj.type == xpath.XPATH_NODESET:
 *         return _createNodeSetResult(xpathObj, doc)
 *     elif xpathObj.type == xpath.XPATH_BOOLEAN:             # <<<<<<<<<<<<<< 
 *         return python.PyBool_FromLong(xpathObj.boolval)
 *     elif xpathObj.type == xpath.XPATH_NUMBER:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_BOOLEAN);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":490
 *         return _createNodeSetResult(xpathObj, doc)
 *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
 *         return python.PyBool_FromLong(xpathObj.boolval)             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_NUMBER:
 *         return xpathObj.floatval
 */
  __pyx_2 = PyBool_FromLong(__pyx_v_xpathObj->boolval); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 490; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":491
 *     elif xpathObj.type == xpath.XPATH_BOOLEAN:
 *         return python.PyBool_FromLong(xpathObj.boolval)
 *     elif xpathObj.type == xpath.XPATH_NUMBER:             # <<<<<<<<<<<<<< 
 *         return xpathObj.floatval
 *     elif xpathObj.type == xpath.XPATH_STRING:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_NUMBER);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":492
 *         return python.PyBool_FromLong(xpathObj.boolval)
 *     elif xpathObj.type == xpath.XPATH_NUMBER:
 *         return xpathObj.floatval             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_STRING:
 *         return funicode(xpathObj.stringval)
 */
  __pyx_2 = PyFloat_FromDouble(__pyx_v_xpathObj->floatval); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 492; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":493
 *     elif xpathObj.type == xpath.XPATH_NUMBER:
 *         return xpathObj.floatval
 *     elif xpathObj.type == xpath.XPATH_STRING:             # <<<<<<<<<<<<<< 
 *         return funicode(xpathObj.stringval)
 *     elif xpathObj.type == xpath.XPATH_POINT:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_STRING);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":494
 *         return xpathObj.floatval
 *     elif xpathObj.type == xpath.XPATH_STRING:
 *         return funicode(xpathObj.stringval)             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_POINT:
 *         raise NotImplementedError
 */
  __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_xpathObj->stringval); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 494; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":495
 *     elif xpathObj.type == xpath.XPATH_STRING:
 *         return funicode(xpathObj.stringval)
 *     elif xpathObj.type == xpath.XPATH_POINT:             # <<<<<<<<<<<<<< 
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_RANGE:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_POINT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":496
 *         return funicode(xpathObj.stringval)
 *     elif xpathObj.type == xpath.XPATH_POINT:
 *         raise NotImplementedError             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_RANGE:
 *         raise NotImplementedError
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 496; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":497
 *     elif xpathObj.type == xpath.XPATH_POINT:
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_RANGE:             # <<<<<<<<<<<<<< 
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_RANGE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":498
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_RANGE:
 *         raise NotImplementedError             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
 *         raise NotImplementedError
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 498; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":499
 *     elif xpathObj.type == xpath.XPATH_RANGE:
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:             # <<<<<<<<<<<<<< 
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_USERS:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_LOCATIONSET);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":500
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
 *         raise NotImplementedError             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_USERS:
 *         raise NotImplementedError
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 500; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":501
 *     elif xpathObj.type == xpath.XPATH_LOCATIONSET:
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_USERS:             # <<<<<<<<<<<<<< 
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_USERS);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":502
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_USERS:
 *         raise NotImplementedError             # <<<<<<<<<<<<<< 
 *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
 *         raise NotImplementedError
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 502; goto __pyx_L1;}
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":503
 *     elif xpathObj.type == xpath.XPATH_USERS:
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:             # <<<<<<<<<<<<<< 
 *         raise NotImplementedError
 *     else:
 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_XSLT_TREE);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":504
 *         raise NotImplementedError
 *     elif xpathObj.type == xpath.XPATH_XSLT_TREE:
 *         raise NotImplementedError             # <<<<<<<<<<<<<< 
 *     else:
 *         raise XPathResultError, "Unknown xpath result %s" % str(xpathObj.type)
 */
  __Pyx_Raise(__pyx_builtin_NotImplementedError, 0, 0);
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 504; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":506
 *         raise NotImplementedError
 *     else:
 *         raise XPathResultError, "Unknown xpath result %s" % str(xpathObj.type)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _createNodeSetResult(xpath.xmlXPathObject* xpathObj, _Document doc):
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":506
 *         raise NotImplementedError
 *     else:
 *         raise XPathResultError, "Unknown xpath result %s" % str(xpathObj.type)             # <<<<<<<<<<<<<< 
 * 
 * cdef object _createNodeSetResult(xpath.xmlXPathObject* xpathObj, _Document doc):
 */
  __pyx_3 = PyInt_FromLong(__pyx_v_xpathObj->type); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyNumber_Remainder(__pyx_k651p, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_2, __pyx_4, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 506; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._unwrapXPathObject");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":508
 *         raise XPathResultError, "Unknown xpath result %s" % str(xpathObj.type)
 * 
 * cdef object _createNodeSetResult(xpath.xmlXPathObject* xpathObj, _Document doc):             # <<<<<<<<<<<<<< 
 *     cdef xmlNode* c_node
 *     cdef char* s
 */

static PyObject *__pyx_k652p;

static char __pyx_k652[] = "Not yet implemented result node type: %d";

static  PyObject *__pyx_f_4lxml_5etree__createNodeSetResult(xmlXPathObject *__pyx_v_xpathObj,struct LxmlDocument *__pyx_v_doc) {
xmlNode *__pyx_v_c_node;
char *__pyx_v_s;
int __pyx_v_i;
PyObject *__pyx_v_result;
PyObject *__pyx_v_value;
PyObject *__pyx_v_href;
PyObject *__pyx_v_prefix;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
int __pyx_3;
PyObject *__pyx_4 = 0;
int __pyx_5;
Py_INCREF(__pyx_v_doc);
__pyx_v_result = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_href = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":512
 *     cdef char* s
 *     cdef int i
 *     result = []             # <<<<<<<<<<<<<< 
 *     if xpathObj.nodesetval is NULL:
 *         return result
 */
__pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 512; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":513
 *     cdef int i
 *     result = []
 *     if xpathObj.nodesetval is NULL:             # <<<<<<<<<<<<<< 
 *         return result
 *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
 */
__pyx_2 = (__pyx_v_xpathObj->nodesetval == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":514
 *     result = []
 *     if xpathObj.nodesetval is NULL:
 *         return result             # <<<<<<<<<<<<<< 
 *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
 *         c_node = xpathObj.nodesetval.nodeTab[i]
 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":515
 *     if xpathObj.nodesetval is NULL:
 *         return result
 *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:             # <<<<<<<<<<<<<< 
 *         c_node = xpathObj.nodesetval.nodeTab[i]
 *         if _isElement(c_node):
 */
__pyx_3 = __pyx_v_xpathObj->nodesetval->nodeNr;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_3; __pyx_v_i++) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":516
 *         return result
 *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
 *         c_node = xpathObj.nodesetval.nodeTab[i]             # <<<<<<<<<<<<<< 
 *         if _isElement(c_node):
 *             if c_node.doc != doc._c_doc:
 */
  __pyx_v_c_node = (__pyx_v_xpathObj->nodesetval->nodeTab[__pyx_v_i]);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":517
 *     for i from 0 <= i < xpathObj.nodesetval.nodeNr:
 *         c_node = xpathObj.nodesetval.nodeTab[i]
 *         if _isElement(c_node):             # <<<<<<<<<<<<<< 
 *             if c_node.doc != doc._c_doc:
 *                 # XXX: works, but maybe not always the right thing to do?
 */
  __pyx_2 = _isElement(__pyx_v_c_node);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":518
 *         c_node = xpathObj.nodesetval.nodeTab[i]
 *         if _isElement(c_node):
 *             if c_node.doc != doc._c_doc:             # <<<<<<<<<<<<<< 
 *                 # XXX: works, but maybe not always the right thing to do?
 *                 # XPath: only runs when extensions create or copy trees
 */
    __pyx_2 = (__pyx_v_c_node->doc != __pyx_v_doc->_c_doc);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":523
 *                 #        -> we store Python refs to these, so that is OK
 *                 # XSLT: can it leak when merging trees from multiple sources?
 *                 c_node = tree.xmlDocCopyNode(c_node, doc._c_doc, 1)             # <<<<<<<<<<<<<< 
 *             value = _elementFactory(doc, c_node)
 *         elif c_node.type == tree.XML_TEXT_NODE:
 */
      __pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_doc->_c_doc,1);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":524
 *                 # XSLT: can it leak when merging trees from multiple sources?
 *                 c_node = tree.xmlDocCopyNode(c_node, doc._c_doc, 1)
 *             value = _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 *         elif c_node.type == tree.XML_TEXT_NODE:
 *             value = funicode(c_node.content)
 */
    __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 524; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":525
 *                 c_node = tree.xmlDocCopyNode(c_node, doc._c_doc, 1)
 *             value = _elementFactory(doc, c_node)
 *         elif c_node.type == tree.XML_TEXT_NODE:             # <<<<<<<<<<<<<< 
 *             value = funicode(c_node.content)
 *         elif c_node.type == tree.XML_ATTRIBUTE_NODE:
 */
  __pyx_2 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":526
 *             value = _elementFactory(doc, c_node)
 *         elif c_node.type == tree.XML_TEXT_NODE:
 *             value = funicode(c_node.content)             # <<<<<<<<<<<<<< 
 *         elif c_node.type == tree.XML_ATTRIBUTE_NODE:
 *             s = tree.xmlNodeGetContent(c_node)
 */
    __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_node->content); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 526; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":527
 *         elif c_node.type == tree.XML_TEXT_NODE:
 *             value = funicode(c_node.content)
 *         elif c_node.type == tree.XML_ATTRIBUTE_NODE:             # <<<<<<<<<<<<<< 
 *             s = tree.xmlNodeGetContent(c_node)
 *             value = funicode(s)
 */
  __pyx_2 = (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":528
 *             value = funicode(c_node.content)
 *         elif c_node.type == tree.XML_ATTRIBUTE_NODE:
 *             s = tree.xmlNodeGetContent(c_node)             # <<<<<<<<<<<<<< 
 *             value = funicode(s)
 *             tree.xmlFree(s)
 */
    __pyx_v_s = xmlNodeGetContent(__pyx_v_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":529
 *         elif c_node.type == tree.XML_ATTRIBUTE_NODE:
 *             s = tree.xmlNodeGetContent(c_node)
 *             value = funicode(s)             # <<<<<<<<<<<<<< 
 *             tree.xmlFree(s)
 *         elif c_node.type == tree.XML_NAMESPACE_DECL:
 */
    __pyx_1 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 529; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":530
 *             s = tree.xmlNodeGetContent(c_node)
 *             value = funicode(s)
 *             tree.xmlFree(s)             # <<<<<<<<<<<<<< 
 *         elif c_node.type == tree.XML_NAMESPACE_DECL:
 *             s = (<xmlNs*>c_node).href
 */
    xmlFree(__pyx_v_s);
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":531
 *             value = funicode(s)
 *             tree.xmlFree(s)
 *         elif c_node.type == tree.XML_NAMESPACE_DECL:             # <<<<<<<<<<<<<< 
 *             s = (<xmlNs*>c_node).href
 *             if s is NULL:
 */
  __pyx_2 = (__pyx_v_c_node->type == XML_NAMESPACE_DECL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":532
 *             tree.xmlFree(s)
 *         elif c_node.type == tree.XML_NAMESPACE_DECL:
 *             s = (<xmlNs*>c_node).href             # <<<<<<<<<<<<<< 
 *             if s is NULL:
 *                 href = None
 */
    __pyx_v_s = ((xmlNs *)__pyx_v_c_node)->href;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":533
 *         elif c_node.type == tree.XML_NAMESPACE_DECL:
 *             s = (<xmlNs*>c_node).href
 *             if s is NULL:             # <<<<<<<<<<<<<< 
 *                 href = None
 *             else:
 */
    __pyx_2 = (__pyx_v_s == NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":534
 *             s = (<xmlNs*>c_node).href
 *             if s is NULL:
 *                 href = None             # <<<<<<<<<<<<<< 
 *             else:
 *                 href = s
 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_href);
      __pyx_v_href = Py_None;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":536
 *                 href = None
 *             else:
 *                 href = s             # <<<<<<<<<<<<<< 
 *             s = (<xmlNs*>c_node).prefix
 *             if s is NULL:
 */
      __pyx_1 = PyString_FromString(__pyx_v_s); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 536; goto __pyx_L1;}
      Py_DECREF(__pyx_v_href);
      __pyx_v_href = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L7:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":537
 *             else:
 *                 href = s
 *             s = (<xmlNs*>c_node).prefix             # <<<<<<<<<<<<<< 
 *             if s is NULL:
 *                 prefix = None
 */
    __pyx_v_s = ((xmlNs *)__pyx_v_c_node)->prefix;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":538
 *                 href = s
 *             s = (<xmlNs*>c_node).prefix
 *             if s is NULL:             # <<<<<<<<<<<<<< 
 *                 prefix = None
 *             else:
 */
    __pyx_2 = (__pyx_v_s == NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":539
 *             s = (<xmlNs*>c_node).prefix
 *             if s is NULL:
 *                 prefix = None             # <<<<<<<<<<<<<< 
 *             else:
 *                 prefix = s
 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = Py_None;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":541
 *                 prefix = None
 *             else:
 *                 prefix = s             # <<<<<<<<<<<<<< 
 *             value = (prefix, href)
 *         elif c_node.type == tree.XML_DOCUMENT_NODE or \
 */
      __pyx_1 = PyString_FromString(__pyx_v_s); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 541; goto __pyx_L1;}
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L8:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":542
 *             else:
 *                 prefix = s
 *             value = (prefix, href)             # <<<<<<<<<<<<<< 
 *         elif c_node.type == tree.XML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_HTML_DOCUMENT_NODE or \
 */
    __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 542; goto __pyx_L1;}
    Py_INCREF(__pyx_v_prefix);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_prefix);
    Py_INCREF(__pyx_v_href);
    PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_href);
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":543
 *                 prefix = s
 *             value = (prefix, href)
 *         elif c_node.type == tree.XML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<< 
 *                  c_node.type == tree.XML_HTML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_XINCLUDE_START or \
 */
  __pyx_2 = (__pyx_v_c_node->type == XML_DOCUMENT_NODE);
  if (!__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":544
 *             value = (prefix, href)
 *         elif c_node.type == tree.XML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_HTML_DOCUMENT_NODE or \             # <<<<<<<<<<<<<< 
 *                  c_node.type == tree.XML_XINCLUDE_START or \
 *                  c_node.type == tree.XML_XINCLUDE_END:
 */
    __pyx_2 = (__pyx_v_c_node->type == XML_HTML_DOCUMENT_NODE);
    if (!__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":545
 *         elif c_node.type == tree.XML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_HTML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_XINCLUDE_START or \             # <<<<<<<<<<<<<< 
 *                  c_node.type == tree.XML_XINCLUDE_END:
 *             continue
 */
      __pyx_2 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
      if (!__pyx_2) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":546
 *                  c_node.type == tree.XML_HTML_DOCUMENT_NODE or \
 *                  c_node.type == tree.XML_XINCLUDE_START or \
 *                  c_node.type == tree.XML_XINCLUDE_END:             # <<<<<<<<<<<<<< 
 *             continue
 *         else:
 */
        __pyx_2 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
      }
    }
  }
  if (__pyx_2) {
    goto __pyx_L3;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":550
 *         else:
 *             raise NotImplementedError, \
 *                   "Not yet implemented result node type: %d" % c_node.type             # <<<<<<<<<<<<<< 
 *         python.PyList_Append(result, value)
 *     return result
 */
    __pyx_1 = PyInt_FromLong(__pyx_v_c_node->type); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 550; goto __pyx_L1;}
    __pyx_4 = PyNumber_Remainder(__pyx_k652p, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 550; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_Raise(__pyx_builtin_NotImplementedError, __pyx_4, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[12]; __pyx_lineno = 549; goto __pyx_L1;}
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":551
 *             raise NotImplementedError, \
 *                   "Not yet implemented result node type: %d" % c_node.type
 *         python.PyList_Append(result, value)             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
  __pyx_5 = PyList_Append(__pyx_v_result,__pyx_v_value); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 551; goto __pyx_L1;}
  __pyx_L3:;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":552
 *                   "Not yet implemented result node type: %d" % c_node.type
 *         python.PyList_Append(result, value)
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * cdef void _freeXPathObject(xpath.xmlXPathObject* xpathObj):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._createNodeSetResult");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_href);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":554
 *     return result
 * 
 * cdef void _freeXPathObject(xpath.xmlXPathObject* xpathObj):             # <<<<<<<<<<<<<< 
 *     """Free the XPath object, but *never* free the *content* of node sets.
 *     Python dealloc will do that for us.
 */

static  void __pyx_f_4lxml_5etree__freeXPathObject(xmlXPathObject *__pyx_v_xpathObj) {
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":558
 *     Python dealloc will do that for us.
 *     """
 *     if xpathObj.nodesetval is not NULL:             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
 *         xpathObj.nodesetval = NULL
 */
__pyx_1 = (__pyx_v_xpathObj->nodesetval != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":559
 *     """
 *     if xpathObj.nodesetval is not NULL:
 *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)             # <<<<<<<<<<<<<< 
 *         xpathObj.nodesetval = NULL
 *     xpath.xmlXPathFreeObject(xpathObj)
 */
  xmlXPathFreeNodeSet(__pyx_v_xpathObj->nodesetval);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":560
 *     if xpathObj.nodesetval is not NULL:
 *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
 *         xpathObj.nodesetval = NULL             # <<<<<<<<<<<<<< 
 *     xpath.xmlXPathFreeObject(xpathObj)
 * 
 */
  __pyx_v_xpathObj->nodesetval = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":561
 *         xpath.xmlXPathFreeNodeSet(xpathObj.nodesetval)
 *         xpathObj.nodesetval = NULL
 *     xpath.xmlXPathFreeObject(xpathObj)             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
xmlXPathFreeObject(__pyx_v_xpathObj);

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":566
 * # callbacks for XPath/XSLT extension functions
 * 
 * cdef void _extension_function_call(_BaseContext context, function,             # <<<<<<<<<<<<<< 
 *                                    xpath.xmlXPathParserContext* ctxt, int nargs):
 *     cdef _Document doc
 */

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) {
struct LxmlDocument *__pyx_v_doc;
xmlXPathObject *__pyx_v_obj;
int __pyx_v_i;
PyObject *__pyx_v_args;
PyObject *__pyx_v_o;
PyObject *__pyx_v_res;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
xmlXPathObject *__pyx_5;
Py_INCREF(__pyx_v_context);
Py_INCREF(__pyx_v_function);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_args = Py_None; Py_INCREF(Py_None);
__pyx_v_o = Py_None; Py_INCREF(Py_None);
__pyx_v_res = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":571
 *     cdef xpath.xmlXPathObject* obj
 *     cdef int i
 *     doc = context._doc             # <<<<<<<<<<<<<< 
 *     try:
 *         args = []
 */
Py_INCREF(((PyObject *)__pyx_v_context->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v_context->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":572
 *     cdef int i
 *     doc = context._doc
 *     try:             # <<<<<<<<<<<<<< 
 *         args = []
 *         for i from 0 <= i < nargs:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":573
 *     doc = context._doc
 *     try:
 *         args = []             # <<<<<<<<<<<<<< 
 *         for i from 0 <= i < nargs:
 *             obj = xpath.valuePop(ctxt)
 */
  __pyx_1 = PyList_New(0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 573; goto __pyx_L2;}
  Py_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":574
 *     try:
 *         args = []
 *         for i from 0 <= i < nargs:             # <<<<<<<<<<<<<< 
 *             obj = xpath.valuePop(ctxt)
 *             o = _unwrapXPathObject(obj, doc)
 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nargs; __pyx_v_i++) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":575
 *         args = []
 *         for i from 0 <= i < nargs:
 *             obj = xpath.valuePop(ctxt)             # <<<<<<<<<<<<<< 
 *             o = _unwrapXPathObject(obj, doc)
 *             _freeXPathObject(obj)
 */
    __pyx_v_obj = valuePop(__pyx_v_ctxt);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":576
 *         for i from 0 <= i < nargs:
 *             obj = xpath.valuePop(ctxt)
 *             o = _unwrapXPathObject(obj, doc)             # <<<<<<<<<<<<<< 
 *             _freeXPathObject(obj)
 *             python.PyList_Append(args, o)
 */
    __pyx_1 = __pyx_f_4lxml_5etree__unwrapXPathObject(__pyx_v_obj,__pyx_v_doc); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 576; goto __pyx_L2;}
    Py_DECREF(__pyx_v_o);
    __pyx_v_o = __pyx_1;
    __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":577
 *             obj = xpath.valuePop(ctxt)
 *             o = _unwrapXPathObject(obj, doc)
 *             _freeXPathObject(obj)             # <<<<<<<<<<<<<< 
 *             python.PyList_Append(args, o)
 *         python.PyList_Reverse(args)
 */
    __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_obj);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":578
 *             o = _unwrapXPathObject(obj, doc)
 *             _freeXPathObject(obj)
 *             python.PyList_Append(args, o)             # <<<<<<<<<<<<<< 
 *         python.PyList_Reverse(args)
 * 
 */
    __pyx_2 = PyList_Append(__pyx_v_args,__pyx_v_o); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 578; goto __pyx_L2;}
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":579
 *             _freeXPathObject(obj)
 *             python.PyList_Append(args, o)
 *         python.PyList_Reverse(args)             # <<<<<<<<<<<<<< 
 * 
 *         res = function(context, *args)
 */
  __pyx_2 = PyList_Reverse(__pyx_v_args); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 579; goto __pyx_L2;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":581
 *         python.PyList_Reverse(args)
 * 
 *         res = function(context, *args)             # <<<<<<<<<<<<<< 
 *         # wrap result for XPath consumption
 *         obj = _wrapXPathObject(res)
 */
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 581; goto __pyx_L2;}
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_context));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":581
 *         python.PyList_Reverse(args)
 * 
 *         res = function(context, *args)             # <<<<<<<<<<<<<< 
 *         # wrap result for XPath consumption
 *         obj = _wrapXPathObject(res)
 */
  __pyx_3 = PySequence_Tuple(__pyx_v_args); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 581; goto __pyx_L2;}
  __pyx_4 = PyNumber_Add(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 581; goto __pyx_L2;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_v_function, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 581; goto __pyx_L2;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":583
 *         res = function(context, *args)
 *         # wrap result for XPath consumption
 *         obj = _wrapXPathObject(res)             # <<<<<<<<<<<<<< 
 *         # prevent Python from deallocating elements handed to libxml2
 *         context._hold(res)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_res); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 583; goto __pyx_L2;}
  __pyx_v_obj = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":585
 *         obj = _wrapXPathObject(res)
 *         # prevent Python from deallocating elements handed to libxml2
 *         context._hold(res)             # <<<<<<<<<<<<<< 
 *         xpath.valuePush(ctxt, obj)
 *     except:
 */
  __pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_hold(__pyx_v_context,__pyx_v_res); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 585; goto __pyx_L2;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":586
 *         # prevent Python from deallocating elements handed to libxml2
 *         context._hold(res)
 *         xpath.valuePush(ctxt, obj)             # <<<<<<<<<<<<<< 
 *     except:
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
 */
  valuePush(__pyx_v_ctxt,__pyx_v_obj);
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":587
 *         context._hold(res)
 *         xpath.valuePush(ctxt, obj)
 *     except:             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
 *         context._exc._store_raised()
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._extension_function_call");
  if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 587; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":588
 *         xpath.valuePush(ctxt, obj)
 *     except:
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)             # <<<<<<<<<<<<<< 
 *         context._exc._store_raised()
 * 
 */
  xmlXPathErr(__pyx_v_ctxt,XPATH_EXPR_ERROR);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":589
 *     except:
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_EXPR_ERROR)
 *         context._exc._store_raised()             # <<<<<<<<<<<<<< 
 * 
 * # lookup the function by name and call it
 */
  ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->_exc->__pyx_vtab)->_store_raised(__pyx_v_context->_exc);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._extension_function_call");
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_args);
Py_DECREF(__pyx_v_o);
Py_DECREF(__pyx_v_res);
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_function);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":593
 * # lookup the function by name and call it
 * 
 * cdef void _xpath_function_call(xpath.xmlXPathParserContext* ctxt,             # <<<<<<<<<<<<<< 
 *                                int nargs) with gil:
 *     cdef xpath.xmlXPathContext* rctxt
 */

static PyObject *__pyx_k653p;
static PyObject *__pyx_k654p;

static char __pyx_k653[] = "{%s}%s";
static char __pyx_k654[] = "XPath function '%s' not found";

static  void __pyx_f_4lxml_5etree__xpath_function_call(xmlXPathParserContext *__pyx_v_ctxt,int __pyx_v_nargs) {
xmlXPathContext *__pyx_v_rctxt;
struct __pyx_obj_4lxml_5etree__BaseContext *__pyx_v_context;
PyObject *__pyx_v_function;
PyObject *__pyx_v_fref;
PyObject *__pyx_v_exception;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_function = Py_None; Py_INCREF(Py_None);
__pyx_v_fref = Py_None; Py_INCREF(Py_None);
__pyx_v_exception = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":597
 *     cdef xpath.xmlXPathContext* rctxt
 *     cdef _BaseContext context
 *     rctxt = ctxt.context             # <<<<<<<<<<<<<< 
 *     context = <_BaseContext>(rctxt.userData)
 *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
 */
__pyx_v_rctxt = __pyx_v_ctxt->context;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":598
 *     cdef _BaseContext context
 *     rctxt = ctxt.context
 *     context = <_BaseContext>(rctxt.userData)             # <<<<<<<<<<<<<< 
 *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
 *     if function is not None:
 */
__pyx_1 = (PyObject *)__pyx_v_rctxt->userData;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__BaseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":599
 *     rctxt = ctxt.context
 *     context = <_BaseContext>(rctxt.userData)
 *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)             # <<<<<<<<<<<<<< 
 *     if function is not None:
 *         _extension_function_call(context, function, ctxt, nargs)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 599; goto __pyx_L1;}
Py_DECREF(__pyx_v_function);
__pyx_v_function = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":600
 *     context = <_BaseContext>(rctxt.userData)
 *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
 *     if function is not None:             # <<<<<<<<<<<<<< 
 *         _extension_function_call(context, function, ctxt, nargs)
 *     else:
 */
__pyx_2 = (__pyx_v_function != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":601
 *     function = context._find_cached_function(rctxt.functionURI, rctxt.function)
 *     if function is not None:
 *         _extension_function_call(context, function, ctxt, nargs)             # <<<<<<<<<<<<<< 
 *     else:
 *         if rctxt.functionURI is not NULL:
 */
  __pyx_f_4lxml_5etree__extension_function_call(__pyx_v_context,__pyx_v_function,__pyx_v_ctxt,__pyx_v_nargs);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":603
 *         _extension_function_call(context, function, ctxt, nargs)
 *     else:
 *         if rctxt.functionURI is not NULL:             # <<<<<<<<<<<<<< 
 *             fref = "{%s}%s" % (rctxt.functionURI, rctxt.function)
 *         else:
 */
  __pyx_2 = (__pyx_v_rctxt->functionURI != NULL);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":604
 *     else:
 *         if rctxt.functionURI is not NULL:
 *             fref = "{%s}%s" % (rctxt.functionURI, rctxt.function)             # <<<<<<<<<<<<<< 
 *         else:
 *             fref = rctxt.function
 */
    __pyx_1 = PyString_FromString(__pyx_v_rctxt->functionURI); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 604; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":604
 *     else:
 *         if rctxt.functionURI is not NULL:
 *             fref = "{%s}%s" % (rctxt.functionURI, rctxt.function)             # <<<<<<<<<<<<<< 
 *         else:
 *             fref = rctxt.function
 */
    __pyx_3 = PyString_FromString(__pyx_v_rctxt->function); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 604; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 604; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
    __pyx_1 = 0;
    __pyx_3 = 0;
    __pyx_1 = PyNumber_Remainder(__pyx_k653p, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 604; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_fref);
    __pyx_v_fref = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":606
 *             fref = "{%s}%s" % (rctxt.functionURI, rctxt.function)
 *         else:
 *             fref = rctxt.function             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
 *         exception = XPathFunctionError("XPath function '%s' not found" % fref)
 */
    __pyx_3 = PyString_FromString(__pyx_v_rctxt->function); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 606; goto __pyx_L1;}
    Py_DECREF(__pyx_v_fref);
    __pyx_v_fref = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":607
 *         else:
 *             fref = rctxt.function
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)             # <<<<<<<<<<<<<< 
 *         exception = XPathFunctionError("XPath function '%s' not found" % fref)
 *         context._exc._store_exception(exception)
 */
  xmlXPathErr(__pyx_v_ctxt,XPATH_UNKNOWN_FUNC_ERROR);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":608
 *             fref = rctxt.function
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
 *         exception = XPathFunctionError("XPath function '%s' not found" % fref)             # <<<<<<<<<<<<<< 
 *         context._exc._store_exception(exception)
 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathFunctionError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 608; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":608
 *             fref = rctxt.function
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
 *         exception = XPathFunctionError("XPath function '%s' not found" % fref)             # <<<<<<<<<<<<<< 
 *         context._exc._store_exception(exception)
 */
  __pyx_1 = PyNumber_Remainder(__pyx_k654p, __pyx_v_fref); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 608; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 608; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_1);
  __pyx_1 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_4, __pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 608; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_exception);
  __pyx_v_exception = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":609
 *         xpath.xmlXPathErr(ctxt, xpath.XPATH_UNKNOWN_FUNC_ERROR)
 *         exception = XPathFunctionError("XPath function '%s' not found" % fref)
 *         context._exc._store_exception(exception)             # <<<<<<<<<<<<<< 
 */
  ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_context->_exc->__pyx_vtab)->_store_exception(__pyx_v_context->_exc,__pyx_v_exception);
}
__pyx_L2:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._xpath_function_call");
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_fref);
Py_DECREF(__pyx_v_exception);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":31
 * )
 * 
 * cdef int _register_xpath_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<< 
 *     if ns_utf is None:
 *         return xpath.xmlXPathRegisterFunc(
 */

static  int __pyx_f_4lxml_5etree__register_xpath_function(void *__pyx_v_ctxt,PyObject *__pyx_v_name_utf,PyObject *__pyx_v_ns_utf) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_ns_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":32
 * 
 * cdef int _register_xpath_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:             # <<<<<<<<<<<<<< 
 *         return xpath.xmlXPathRegisterFunc(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf),
 */
__pyx_1 = (__pyx_v_ns_utf == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":35
 *         return xpath.xmlXPathRegisterFunc(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf),
 *             _xpath_function_call)             # <<<<<<<<<<<<<< 
 *     else:
 *         return xpath.xmlXPathRegisterFuncNS(
 */
  __pyx_r = xmlXPathRegisterFunc(((xmlXPathContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),__pyx_f_4lxml_5etree__xpath_function_call);
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":39
 *         return xpath.xmlXPathRegisterFuncNS(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
 *             _xpath_function_call)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):
 */
  __pyx_r = xmlXPathRegisterFuncNS(((xmlXPathContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),__pyx_f_4lxml_5etree__xpath_function_call);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_ns_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":41
 *             _xpath_function_call)
 * 
 * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<< 
 *     if ns_utf is None:
 *         return xpath.xmlXPathRegisterFunc(
 */

static  int __pyx_f_4lxml_5etree__unregister_xpath_function(void *__pyx_v_ctxt,PyObject *__pyx_v_name_utf,PyObject *__pyx_v_ns_utf) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_ns_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":42
 * 
 * cdef int _unregister_xpath_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:             # <<<<<<<<<<<<<< 
 *         return xpath.xmlXPathRegisterFunc(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), NULL)
 */
__pyx_1 = (__pyx_v_ns_utf == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":44
 *     if ns_utf is None:
 *         return xpath.xmlXPathRegisterFunc(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), NULL)             # <<<<<<<<<<<<<< 
 *     else:
 *         return xpath.xmlXPathRegisterFuncNS(
 */
  __pyx_r = xmlXPathRegisterFunc(((xmlXPathContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),NULL);
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":47
 *     else:
 *         return xpath.xmlXPathRegisterFuncNS(
 *             <xpath.xmlXPathContext*>ctxt, _cstr(name_utf), _cstr(ns_utf), NULL)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  __pyx_r = xmlXPathRegisterFuncNS(((xmlXPathContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),NULL);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_ns_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":52
 * cdef class _XPathContext(_BaseContext):
 *     cdef object _variables
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):             # <<<<<<<<<<<<<< 
 *         self._variables = variables
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 */

static int __pyx_pf_4lxml_5etree_13_XPathContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_13_XPathContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_enable_regexp = 0;
PyObject *__pyx_v_variables = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions","enable_regexp","variables",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_enable_regexp, &__pyx_v_variables))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
Py_INCREF(__pyx_v_variables);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":53
 *     cdef object _variables
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 *         self._variables = variables             # <<<<<<<<<<<<<< 
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 * 
 */
Py_INCREF(__pyx_v_variables);
Py_DECREF(((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_v_self)->_variables);
((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_v_self)->_variables = __pyx_v_variables;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":54
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 *         self._variables = variables
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseContext), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 54; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":54
 *     def __init__(self, namespaces, extensions, enable_regexp, variables):
 *         self._variables = variables
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 */
__pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 54; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_enable_regexp);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 54; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._XPathContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_enable_regexp);
Py_DECREF(__pyx_v_variables);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":56
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<< 
 *         self._set_xpath_context(xpathCtxt)
 *         self._setupDict(xpathCtxt)
 */

static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_set_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self,xmlXPathContext *__pyx_v_xpathCtxt) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":57
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._set_xpath_context(xpathCtxt)             # <<<<<<<<<<<<<< 
 *         self._setupDict(xpathCtxt)
 *         self.registerLocalNamespaces()
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":58
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._set_xpath_context(xpathCtxt)
 *         self._setupDict(xpathCtxt)             # <<<<<<<<<<<<<< 
 *         self.registerLocalNamespaces()
 *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
 */
((struct __pyx_vtabstruct_4lxml_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->_setupDict(__pyx_v_self,__pyx_v_xpathCtxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":59
 *         self._set_xpath_context(xpathCtxt)
 *         self._setupDict(xpathCtxt)
 *         self.registerLocalNamespaces()             # <<<<<<<<<<<<<< 
 *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 59; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":60
 *         self._setupDict(xpathCtxt)
 *         self.registerLocalNamespaces()
 *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)             # <<<<<<<<<<<<<< 
 * 
 *     cdef register_context(self, _Document doc):
 */
((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);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathContext.set_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":62
 *         self.registerLocalFunctions(xpathCtxt, _register_xpath_function)
 * 
 *     cdef register_context(self, _Document doc):             # <<<<<<<<<<<<<< 
 *         self._register_context(doc)
 *         self.registerGlobalNamespaces()
 */

static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_register_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self,struct LxmlDocument *__pyx_v_doc) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":63
 * 
 *     cdef register_context(self, _Document doc):
 *         self._register_context(doc)             # <<<<<<<<<<<<<< 
 *         self.registerGlobalNamespaces()
 *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":64
 *     cdef register_context(self, _Document doc):
 *         self._register_context(doc)
 *         self.registerGlobalNamespaces()             # <<<<<<<<<<<<<< 
 *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
 *         if self._variables is not None:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 64; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":65
 *         self._register_context(doc)
 *         self.registerGlobalNamespaces()
 *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)             # <<<<<<<<<<<<<< 
 *         if self._variables is not None:
 *             self.registerVariables(self._variables)
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":66
 *         self.registerGlobalNamespaces()
 *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
 *         if self._variables is not None:             # <<<<<<<<<<<<<< 
 *             self.registerVariables(self._variables)
 * 
 */
__pyx_2 = (__pyx_v_self->_variables != Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":67
 *         self.registerGlobalFunctions(self._xpathCtxt, _register_xpath_function)
 *         if self._variables is not None:
 *             self.registerVariables(self._variables)             # <<<<<<<<<<<<<< 
 * 
 *     cdef unregister_context(self):
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 67; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathContext.register_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":69
 *             self.registerVariables(self._variables)
 * 
 *     cdef unregister_context(self):             # <<<<<<<<<<<<<< 
 *         self.unregisterGlobalFunctions(
 *             self._xpathCtxt, _unregister_xpath_function)
 */

static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_unregister_context(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":71
 *     cdef unregister_context(self):
 *         self.unregisterGlobalFunctions(
 *             self._xpathCtxt, _unregister_xpath_function)             # <<<<<<<<<<<<<< 
 *         self.unregisterGlobalNamespaces()
 *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 70; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":72
 *         self.unregisterGlobalFunctions(
 *             self._xpathCtxt, _unregister_xpath_function)
 *         self.unregisterGlobalNamespaces()             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
 *         self._cleanup_context()
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":73
 *             self._xpathCtxt, _unregister_xpath_function)
 *         self.unregisterGlobalNamespaces()
 *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)             # <<<<<<<<<<<<<< 
 *         self._cleanup_context()
 * 
 */
xmlXPathRegisteredVariablesCleanup(__pyx_v_self->__pyx_base._xpathCtxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":74
 *         self.unregisterGlobalNamespaces()
 *         xpath.xmlXPathRegisteredVariablesCleanup(self._xpathCtxt)
 *         self._cleanup_context()             # <<<<<<<<<<<<<< 
 * 
 *     cdef registerVariables(self, variable_dict):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 74; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathContext.unregister_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":76
 *         self._cleanup_context()
 * 
 *     cdef registerVariables(self, variable_dict):             # <<<<<<<<<<<<<< 
 *         for name, value in variable_dict.items():
 *             name_utf = self._to_utf(name)
 */

static  PyObject *__pyx_f_4lxml_5etree_13_XPathContext_registerVariables(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self,PyObject *__pyx_v_variable_dict) {
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
xmlXPathObject *__pyx_6;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_variable_dict);
__pyx_v_name = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_variable_dict, __pyx_n_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_1 = 0; __pyx_2 = __pyx_3; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":77
 * 
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():             # <<<<<<<<<<<<<< 
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 77; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":78
 *     cdef registerVariables(self, variable_dict):
 *         for name, value in variable_dict.items():
 *             name_utf = self._to_utf(name)             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathRegisterVariable(
 *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 */
  __pyx_5 = ((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_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 78; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_5;
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":80
 *             name_utf = self._to_utf(name)
 *             xpath.xmlXPathRegisterVariable(
 *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<< 
 * 
 *     cdef registerVariable(self, name, value):
 */
  __pyx_6 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 80; goto __pyx_L1;}
  xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt,_cstr(__pyx_v_name_utf),__pyx_6);
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._XPathContext.registerVariables");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_variable_dict);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":82
 *                 self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 * 
 *     cdef registerVariable(self, name, value):             # <<<<<<<<<<<<<< 
 *         name_utf = self._to_utf(name)
 *         xpath.xmlXPathRegisterVariable(
 */

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) {
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
xmlXPathObject *__pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_value);
__pyx_v_name_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":83
 * 
 *     cdef registerVariable(self, name, value):
 *         name_utf = self._to_utf(name)             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathRegisterVariable(
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 83; goto __pyx_L1;}
Py_DECREF(__pyx_v_name_utf);
__pyx_v_name_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":85
 *         name_utf = self._to_utf(name)
 *         xpath.xmlXPathRegisterVariable(
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _registerVariable(self, name_utf, value):
 */
__pyx_2 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 85; goto __pyx_L1;}
xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt,_cstr(__pyx_v_name_utf),__pyx_2);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathContext.registerVariable");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_name);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":87
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 * 
 *     cdef void _registerVariable(self, name_utf, value):             # <<<<<<<<<<<<<< 
 *         xpath.xmlXPathRegisterVariable(
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 */

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) {
xmlXPathObject *__pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":89
 *     cdef void _registerVariable(self, name_utf, value):
 *         xpath.xmlXPathRegisterVariable(
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):
 */
__pyx_1 = __pyx_f_4lxml_5etree__wrapXPathObject(__pyx_v_value); if (unlikely(__pyx_1 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 89; goto __pyx_L1;}
xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt,_cstr(__pyx_v_name_utf),__pyx_1);

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree._XPathContext._registerVariable");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_value);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":91
 *             self._xpathCtxt, _cstr(name_utf), _wrapXPathObject(value))
 * 
 *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<< 
 *         __GLOBAL_PARSER_CONTEXT.initXPathParserDict(xpathCtxt)
 * 
 */

static  void __pyx_f_4lxml_5etree_13_XPathContext__setupDict(struct __pyx_obj_4lxml_5etree__XPathContext *__pyx_v_self,xmlXPathContext *__pyx_v_xpathCtxt) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":92
 * 
 *     cdef void _setupDict(self, xpath.xmlXPathContext* xpathCtxt):
 *         __GLOBAL_PARSER_CONTEXT.initXPathParserDict(xpathCtxt)             # <<<<<<<<<<<<<< 
 * 
 * cdef bint _XPATH_VERSION_WARNING_REQUIRED
 */
((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);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":106
 *     cdef _ErrorLog _error_log
 * 
 *     def __init__(self, namespaces, extensions, enable_regexp):             # <<<<<<<<<<<<<< 
 *         global _XPATH_VERSION_WARNING_REQUIRED
 *         if _XPATH_VERSION_WARNING_REQUIRED:
 */

static PyObject *__pyx_k656p;
static PyObject *__pyx_k657p;

static char __pyx_k656[] = "This version of libxml2 has a known XPath bug. ";
static char __pyx_k657[] = "Use it at your own risk.";

static int __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_enable_regexp = 0;
PyObject *__pyx_v_warnings;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions","enable_regexp",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_enable_regexp))) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
__pyx_v_warnings = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":108
 *     def __init__(self, namespaces, extensions, enable_regexp):
 *         global _XPATH_VERSION_WARNING_REQUIRED
 *         if _XPATH_VERSION_WARNING_REQUIRED:             # <<<<<<<<<<<<<< 
 *             _XPATH_VERSION_WARNING_REQUIRED = 0
 *             import warnings
 */
__pyx_1 = __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":109
 *         global _XPATH_VERSION_WARNING_REQUIRED
 *         if _XPATH_VERSION_WARNING_REQUIRED:
 *             _XPATH_VERSION_WARNING_REQUIRED = 0             # <<<<<<<<<<<<<< 
 *             import warnings
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \
 */
  __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":110
 *         if _XPATH_VERSION_WARNING_REQUIRED:
 *             _XPATH_VERSION_WARNING_REQUIRED = 0
 *             import warnings             # <<<<<<<<<<<<<< 
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \
 *                           "Use it at your own risk.")
 */
  __pyx_2 = __Pyx_Import(__pyx_n_warnings, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_v_warnings);
  __pyx_v_warnings = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":111
 *             _XPATH_VERSION_WARNING_REQUIRED = 0
 *             import warnings
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \             # <<<<<<<<<<<<<< 
 *                           "Use it at your own risk.")
 *         self._error_log = _ErrorLog()
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_warnings, __pyx_n_warn); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 111; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":112
 *             import warnings
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \
 *                           "Use it at your own risk.")             # <<<<<<<<<<<<<< 
 *         self._error_log = _ErrorLog()
 *         self._context = _XPathContext(namespaces, extensions,
 */
  __pyx_3 = PyNumber_Add(__pyx_k656p, __pyx_k657p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 111; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 111; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
  __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":113
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \
 *                           "Use it at your own risk.")
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         self._context = _XPathContext(namespaces, extensions,
 *                                       enable_regexp, None)
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 113; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 113; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":113
 *             warnings.warn("This version of libxml2 has a known XPath bug. " + \
 *                           "Use it at your own risk.")
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         self._context = _XPathContext(namespaces, extensions,
 *                                       enable_regexp, None)
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log));
((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":115
 *         self._error_log = _ErrorLog()
 *         self._context = _XPathContext(namespaces, extensions,
 *                                       enable_regexp, None)             # <<<<<<<<<<<<<< 
 * 
 *     property error_log:
 */
__pyx_4 = PyTuple_New(4); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 114; goto __pyx_L1;}
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_enable_regexp);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 3, Py_None);
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__XPathContext), __pyx_4); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__XPathContext)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 114; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":114
 *                           "Use it at your own risk.")
 *         self._error_log = _ErrorLog()
 *         self._context = _XPathContext(namespaces, extensions,             # <<<<<<<<<<<<<< 
 *                                       enable_regexp, None)
 * 
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context));
((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)__pyx_3);
__pyx_3 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_warnings);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_enable_regexp);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":118
 * 
 *     property error_log:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return self._error_log.copy()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":119
 *     property error_log:
 *         def __get__(self):
 *             return self._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":121
 *             return self._error_log.copy()
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._xpathCtxt is not NULL:
 *             xpath.xmlXPathFreeContext(self._xpathCtxt)
 */

static void __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":122
 * 
 *     def __dealloc__(self):
 *         if self._xpathCtxt is not NULL:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathFreeContext(self._xpathCtxt)
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":123
 *     def __dealloc__(self):
 *         if self._xpathCtxt is not NULL:
 *             xpath.xmlXPathFreeContext(self._xpathCtxt)             # <<<<<<<<<<<<<< 
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 */
  xmlXPathFreeContext(((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":125
 *             xpath.xmlXPathFreeContext(self._xpathCtxt)
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):             # <<<<<<<<<<<<<< 
 *         self._xpathCtxt = xpathCtxt
 *         self._context.set_context(xpathCtxt)
 */

static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase_set_context(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self,xmlXPathContext *__pyx_v_xpathCtxt) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":126
 * 
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._xpathCtxt = xpathCtxt             # <<<<<<<<<<<<<< 
 *         self._context.set_context(xpathCtxt)
 * 
 */
__pyx_v_self->_xpathCtxt = __pyx_v_xpathCtxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":127
 *     cdef set_context(self, xpath.xmlXPathContext* xpathCtxt):
 *         self._xpathCtxt = xpathCtxt
 *         self._context.set_context(xpathCtxt)             # <<<<<<<<<<<<<< 
 * 
 *     def evaluate(self, _eval_arg, **_variables):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 127; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.set_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":129
 *         self._context.set_context(xpathCtxt)
 * 
 *     def evaluate(self, _eval_arg, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an XPath expression.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_19_XPathEvaluatorBase_evaluate[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__eval_arg = 0;
PyObject *__pyx_v__variables = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"_eval_arg",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v__eval_arg))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__eval_arg);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":138
 *         are currently not supported for variables.
 *         """
 *         return self(_eval_arg, **_variables)             # <<<<<<<<<<<<<< 
 * 
 *     cdef bint _checkAbsolutePath(self, char* path):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 138; goto __pyx_L1;}
Py_INCREF(__pyx_v__eval_arg);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__eval_arg);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":138
 *         are currently not supported for variables.
 *         """
 *         return self(_eval_arg, **_variables)             # <<<<<<<<<<<<<< 
 * 
 *     cdef bint _checkAbsolutePath(self, char* path):
 */
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_v_self, __pyx_1, __pyx_v__variables); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 138; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase.evaluate");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__eval_arg);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":140
 *         return self(_eval_arg, **_variables)
 * 
 *     cdef bint _checkAbsolutePath(self, char* path):             # <<<<<<<<<<<<<< 
 *         cdef char c
 *         if path is NULL:
 */

static  int __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__checkAbsolutePath(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self,char *__pyx_v_path) {
char __pyx_v_c;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":142
 *     cdef bint _checkAbsolutePath(self, char* path):
 *         cdef char c
 *         if path is NULL:             # <<<<<<<<<<<<<< 
 *             return 0
 *         c = path[0]
 */
__pyx_1 = (__pyx_v_path == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":143
 *         cdef char c
 *         if path is NULL:
 *             return 0             # <<<<<<<<<<<<<< 
 *         c = path[0]
 *         while c == c' ' or c == c'\t':
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":144
 *         if path is NULL:
 *             return 0
 *         c = path[0]             # <<<<<<<<<<<<<< 
 *         while c == c' ' or c == c'\t':
 *             path = path + 1
 */
__pyx_v_c = (__pyx_v_path[0]);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":145
 *             return 0
 *         c = path[0]
 *         while c == c' ' or c == c'\t':             # <<<<<<<<<<<<<< 
 *             path = path + 1
 *             c = path[0]
 */
while (1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":145
 *             return 0
 *         c = path[0]
 *         while c == c' ' or c == c'\t':             # <<<<<<<<<<<<<< 
 *             path = path + 1
 *             c = path[0]
 */
  __pyx_1 = (__pyx_v_c == ' ');
  if (!__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":145
 *             return 0
 *         c = path[0]
 *         while c == c' ' or c == c'\t':             # <<<<<<<<<<<<<< 
 *             path = path + 1
 *             c = path[0]
 */
    __pyx_1 = (__pyx_v_c == '\t');
  }
  if (!__pyx_1) break;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":146
 *         c = path[0]
 *         while c == c' ' or c == c'\t':
 *             path = path + 1             # <<<<<<<<<<<<<< 
 *             c = path[0]
 *         return c == c'/'
 */
  __pyx_v_path = (__pyx_v_path + 1);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":147
 *         while c == c' ' or c == c'\t':
 *             path = path + 1
 *             c = path[0]             # <<<<<<<<<<<<<< 
 *         return c == c'/'
 * 
 */
  __pyx_v_c = (__pyx_v_path[0]);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":148
 *             path = path + 1
 *             c = path[0]
 *         return c == c'/'             # <<<<<<<<<<<<<< 
 * 
 *     cdef int _lock(self) except -1:
 */
__pyx_r = (__pyx_v_c == '/');
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":150
 *         return c == c'/'
 * 
 *     cdef int _lock(self) except -1:             # <<<<<<<<<<<<<< 
 *         cdef int result
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:
 */

static PyObject *__pyx_k658p;

static char __pyx_k658[] = "parser locking failed";

static  int __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
int __pyx_v_result;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":152
 *     cdef int _lock(self) except -1:
 *         cdef int result
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":152
 *     cdef int _lock(self) except -1:
 *         cdef int result
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 */
  __pyx_1 = (__pyx_v_self->_eval_lock != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":153
 *         cdef int result
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 result = python.PyThread_acquire_lock(
 *                     self._eval_lock, python.WAIT_LOCK)
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":155
 *             with nogil:
 *                 result = python.PyThread_acquire_lock(
 *                     self._eval_lock, python.WAIT_LOCK)             # <<<<<<<<<<<<<< 
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"
 */
      __pyx_v_result = PyThread_acquire_lock(__pyx_v_self->_eval_lock,WAIT_LOCK);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":156
 *                 result = python.PyThread_acquire_lock(
 *                     self._eval_lock, python.WAIT_LOCK)
 *             if result == 0:             # <<<<<<<<<<<<<< 
 *                 raise ParserError, "parser locking failed"
 *         return 0
 */
  __pyx_1 = (__pyx_v_result == 0);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":157
 *                     self._eval_lock, python.WAIT_LOCK)
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 157; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":157
 *                     self._eval_lock, python.WAIT_LOCK)
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"             # <<<<<<<<<<<<<< 
 *         return 0
 * 
 */
    __Pyx_Raise(__pyx_2, __pyx_k658p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 157; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":158
 *             if result == 0:
 *                 raise ParserError, "parser locking failed"
 *         return 0             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _unlock(self):
 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._lock");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":160
 *         return 0
 * 
 *     cdef void _unlock(self):             # <<<<<<<<<<<<<< 
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:
 *             python.PyThread_release_lock(self._eval_lock)
 */

static  void __pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":161
 * 
 *     cdef void _unlock(self):
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<< 
 *             python.PyThread_release_lock(self._eval_lock)
 * 
 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":161
 * 
 *     cdef void _unlock(self):
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:             # <<<<<<<<<<<<<< 
 *             python.PyThread_release_lock(self._eval_lock)
 * 
 */
  __pyx_1 = (__pyx_v_self->_eval_lock != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":162
 *     cdef void _unlock(self):
 *         if config.ENABLE_THREADING and self._eval_lock != NULL:
 *             python.PyThread_release_lock(self._eval_lock)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _raise_parse_error(self):
 */
  PyThread_release_lock(__pyx_v_self->_eval_lock);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":164
 *             python.PyThread_release_lock(self._eval_lock)
 * 
 *     cdef _raise_parse_error(self):             # <<<<<<<<<<<<<< 
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 */

static PyObject *__pyx_k659p;

static char __pyx_k659[] = "Error in xpath expression";

static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_parse_error(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_entries;
PyObject *__pyx_v_message;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
Py_INCREF(__pyx_v_self);
__pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":166
 *     cdef _raise_parse_error(self):
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<< 
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_n_filter_types); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 166; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":166
 *     cdef _raise_parse_error(self):
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<< 
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 166; goto __pyx_L1;}
Py_INCREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__BaseErrorLog)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entries));
__pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":167
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 *         if entries:             # <<<<<<<<<<<<<< 
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 */
__pyx_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 167; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":168
 *         entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 *         if entries:
 *             message = entries._buildExceptionMessage(None)             # <<<<<<<<<<<<<< 
 *             if message is not None:
 *                 raise XPathSyntaxError, message
 */
  __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_entries->__pyx_vtab)->_buildExceptionMessage(__pyx_v_entries,Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 168; goto __pyx_L1;}
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":169
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:             # <<<<<<<<<<<<<< 
 *                 raise XPathSyntaxError, message
 *         raise XPathSyntaxError, self._error_log._buildExceptionMessage(
 */
  __pyx_4 = (__pyx_v_message != Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":170
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 *                 raise XPathSyntaxError, message             # <<<<<<<<<<<<<< 
 *         raise XPathSyntaxError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")
 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathSyntaxError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 170; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":170
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 *                 raise XPathSyntaxError, message             # <<<<<<<<<<<<<< 
 *         raise XPathSyntaxError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")
 */
    __Pyx_Raise(__pyx_2, __pyx_v_message, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 170; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":171
 *             if message is not None:
 *                 raise XPathSyntaxError, message
 *         raise XPathSyntaxError, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<< 
 *             "Error in xpath expression")
 * 
 */
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XPathSyntaxError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 171; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":172
 *                 raise XPathSyntaxError, message
 *         raise XPathSyntaxError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")             # <<<<<<<<<<<<<< 
 * 
 *     cdef _raise_eval_error(self):
 */
__pyx_1 = ((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),__pyx_k659p); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 171; goto __pyx_L1;}
__Pyx_Raise(__pyx_3, __pyx_1, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[13]; __pyx_lineno = 171; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._raise_parse_error");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_entries);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":174
 *             "Error in xpath expression")
 * 
 *     cdef _raise_eval_error(self):             # <<<<<<<<<<<<<< 
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
 */

static PyObject *__pyx_k660p;

static char __pyx_k660[] = "Error in xpath expression";

static  PyObject *__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_eval_error(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *__pyx_v_entries;
PyObject *__pyx_v_message;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
Py_INCREF(__pyx_v_self);
__pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":176
 *     cdef _raise_eval_error(self):
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)             # <<<<<<<<<<<<<< 
 *         if not entries:
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_n_filter_types); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 176; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":176
 *     cdef _raise_eval_error(self):
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)             # <<<<<<<<<<<<<< 
 *         if not entries:
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 176; goto __pyx_L1;}
Py_INCREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__BaseErrorLog)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entries));
__pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":177
 *         cdef _BaseErrorLog entries
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
 *         if not entries:             # <<<<<<<<<<<<<< 
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 *         if entries:
 */
__pyx_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 177; goto __pyx_L1;}
__pyx_5 = (!__pyx_4);
if (__pyx_5) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":178
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
 *         if not entries:
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<< 
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self->_error_log), __pyx_n_filter_types); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 178; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":178
 *         entries = self._error_log.filter_types(_XPATH_EVAL_ERRORS)
 *         if not entries:
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)             # <<<<<<<<<<<<<< 
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 178; goto __pyx_L1;}
  Py_INCREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 178; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__BaseErrorLog)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 178; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entries));
  __pyx_v_entries = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_3);
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":179
 *         if not entries:
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 *         if entries:             # <<<<<<<<<<<<<< 
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 */
__pyx_4 = __Pyx_PyObject_IsTrue(((PyObject *)__pyx_v_entries)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 179; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":180
 *             entries = self._error_log.filter_types(_XPATH_SYNTAX_ERRORS)
 *         if entries:
 *             message = entries._buildExceptionMessage(None)             # <<<<<<<<<<<<<< 
 *             if message is not None:
 *                 raise XPathEvalError, message
 */
  __pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog *)__pyx_v_entries->__pyx_vtab)->_buildExceptionMessage(__pyx_v_entries,Py_None); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 180; goto __pyx_L1;}
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":181
 *         if entries:
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:             # <<<<<<<<<<<<<< 
 *                 raise XPathEvalError, message
 *         raise XPathEvalError, self._error_log._buildExceptionMessage(
 */
  __pyx_5 = (__pyx_v_message != Py_None);
  if (__pyx_5) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":182
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 *                 raise XPathEvalError, message             # <<<<<<<<<<<<<< 
 *         raise XPathEvalError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")
 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathEvalError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 182; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":182
 *             message = entries._buildExceptionMessage(None)
 *             if message is not None:
 *                 raise XPathEvalError, message             # <<<<<<<<<<<<<< 
 *         raise XPathEvalError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")
 */
    __Pyx_Raise(__pyx_2, __pyx_v_message, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 182; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":183
 *             if message is not None:
 *                 raise XPathEvalError, message
 *         raise XPathEvalError, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<< 
 *             "Error in xpath expression")
 * 
 */
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XPathEvalError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 183; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":184
 *                 raise XPathEvalError, message
 *         raise XPathEvalError, self._error_log._buildExceptionMessage(
 *             "Error in xpath expression")             # <<<<<<<<<<<<<< 
 * 
 *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
 */
__pyx_1 = ((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),__pyx_k660p); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 183; goto __pyx_L1;}
__Pyx_Raise(__pyx_3, __pyx_1, 0);
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[13]; __pyx_lineno = 183; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._raise_eval_error");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_entries);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":186
 *             "Error in xpath expression")
 * 
 *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):             # <<<<<<<<<<<<<< 
 *         if self._context._exc._has_raised():
 *             if xpathObj is not NULL:
 */

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) {
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_doc);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":187
 * 
 *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
 *         if self._context._exc._has_raised():             # <<<<<<<<<<<<<< 
 *             if xpathObj is not NULL:
 *                 _freeXPathObject(xpathObj)
 */
__pyx_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);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":188
 *     cdef object _handle_result(self, xpath.xmlXPathObject* xpathObj, _Document doc):
 *         if self._context._exc._has_raised():
 *             if xpathObj is not NULL:             # <<<<<<<<<<<<<< 
 *                 _freeXPathObject(xpathObj)
 *                 xpathObj = NULL
 */
  __pyx_1 = (__pyx_v_xpathObj != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":189
 *         if self._context._exc._has_raised():
 *             if xpathObj is not NULL:
 *                 _freeXPathObject(xpathObj)             # <<<<<<<<<<<<<< 
 *                 xpathObj = NULL
 *             self._context._release_temp_refs()
 */
    __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_xpathObj);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":190
 *             if xpathObj is not NULL:
 *                 _freeXPathObject(xpathObj)
 *                 xpathObj = NULL             # <<<<<<<<<<<<<< 
 *             self._context._release_temp_refs()
 *             self._context._exc._raise_if_stored()
 */
    __pyx_v_xpathObj = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":191
 *                 _freeXPathObject(xpathObj)
 *                 xpathObj = NULL
 *             self._context._release_temp_refs()             # <<<<<<<<<<<<<< 
 *             self._context._exc._raise_if_stored()
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 191; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":192
 *                 xpathObj = NULL
 *             self._context._release_temp_refs()
 *             self._context._exc._raise_if_stored()             # <<<<<<<<<<<<<< 
 * 
 *         if xpathObj is NULL:
 */
  __pyx_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_3 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 192; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":194
 *             self._context._exc._raise_if_stored()
 * 
 *         if xpathObj is NULL:             # <<<<<<<<<<<<<< 
 *             self._context._release_temp_refs()
 *             self._raise_eval_error()
 */
__pyx_1 = (__pyx_v_xpathObj == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":195
 * 
 *         if xpathObj is NULL:
 *             self._context._release_temp_refs()             # <<<<<<<<<<<<<< 
 *             self._raise_eval_error()
 * 
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 195; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":196
 *         if xpathObj is NULL:
 *             self._context._release_temp_refs()
 *             self._raise_eval_error()             # <<<<<<<<<<<<<< 
 * 
 *         try:
 */
  __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase *)__pyx_v_self->__pyx_vtab)->_raise_eval_error(__pyx_v_self); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 196; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":198
 *             self._raise_eval_error()
 * 
 *         try:             # <<<<<<<<<<<<<< 
 *             result = _unwrapXPathObject(xpathObj, doc)
 *         finally:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":199
 * 
 *         try:
 *             result = _unwrapXPathObject(xpathObj, doc)             # <<<<<<<<<<<<<< 
 *         finally:
 *             _freeXPathObject(xpathObj)
 */
  __pyx_2 = __pyx_f_4lxml_5etree__unwrapXPathObject(__pyx_v_xpathObj,__pyx_v_doc); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 199; goto __pyx_L6;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L7;
  __pyx_L6: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":201
 *             result = _unwrapXPathObject(xpathObj, doc)
 *         finally:
 *             _freeXPathObject(xpathObj)             # <<<<<<<<<<<<<< 
 *             self._context._release_temp_refs()
 * 
 */
  __pyx_f_4lxml_5etree__freeXPathObject(__pyx_v_xpathObj);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":202
 *         finally:
 *             _freeXPathObject(xpathObj)
 *             self._context._release_temp_refs()             # <<<<<<<<<<<<<< 
 * 
 *         return result
 */
  __pyx_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_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; goto __pyx_L8;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L9;
  __pyx_L8:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L9:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":204
 *             self._context._release_temp_refs()
 * 
 *         return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._XPathEvaluatorBase._handle_result");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":218
 *     """
 *     cdef _Element _element
 *     def __init__(self, _Element element not None, *, namespaces=None,             # <<<<<<<<<<<<<< 
 *                  extensions=None, regexp=True):
 *         cdef xpath.xmlXPathContext* xpathCtxt
 */

static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
xmlXPathContext *__pyx_v_xpathCtxt;
struct LxmlDocument *__pyx_v_doc;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"element","namespaces","extensions","regexp",0};
__pyx_v_namespaces = __pyx_k247;
__pyx_v_extensions = __pyx_k248;
__pyx_v_regexp = __pyx_k249;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_element, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_regexp))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_4lxml_5etree__Element, 0, "element"))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 218; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":223
 *         cdef int ns_register_status
 *         cdef _Document doc
 *         self._element = element             # <<<<<<<<<<<<<< 
 *         doc = element._doc
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element));
((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element = __pyx_v_element;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":224
 *         cdef _Document doc
 *         self._element = element
 *         doc = element._doc             # <<<<<<<<<<<<<< 
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
 */
Py_INCREF(((PyObject *)__pyx_v_element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v_element->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":225
 *         self._element = element
 *         doc = element._doc
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)             # <<<<<<<<<<<<<< 
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
 *         if xpathCtxt is NULL:
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__XPathEvaluatorBase), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 225; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":225
 *         self._element = element
 *         doc = element._doc
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)             # <<<<<<<<<<<<<< 
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
 *         if xpathCtxt is NULL:
 */
__pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 225; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_regexp);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":226
 *         doc = element._doc
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)             # <<<<<<<<<<<<<< 
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()
 */
__pyx_v_xpathCtxt = xmlXPathNewContext(__pyx_v_doc->_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":227
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
 *         if xpathCtxt is NULL:             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 *         self.set_context(xpathCtxt)
 */
__pyx_4 = (__pyx_v_xpathCtxt == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":228
 *         xpathCtxt = xpath.xmlXPathNewContext(doc._c_doc)
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *         self.set_context(xpathCtxt)
 * 
 */
  __pyx_1 = PyErr_NoMemory(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 228; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":229
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()
 *         self.set_context(xpathCtxt)             # <<<<<<<<<<<<<< 
 * 
 *     def registerNamespace(self, prefix, uri):
 */
__pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":231
 *         self.set_context(xpathCtxt)
 * 
 *     def registerNamespace(self, prefix, uri):             # <<<<<<<<<<<<<< 
 *         """Register a namespace with the XPath context.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator_registerNamespace[] = "Register a namespace with the XPath context.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 0;
PyObject *__pyx_v_uri = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"prefix","uri",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_uri))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_prefix);
Py_INCREF(__pyx_v_uri);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":234
 *         """Register a namespace with the XPath context.
 *         """
 *         self._context.addNamespace(prefix, uri)             # <<<<<<<<<<<<<< 
 * 
 *     def registerNamespaces(self, namespaces):
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 234; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.registerNamespace");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":236
 *         self._context.addNamespace(prefix, uri)
 * 
 *     def registerNamespaces(self, namespaces):             # <<<<<<<<<<<<<< 
 *         """Register a prefix -> uri dict.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_v_namespaces); /*proto*/
static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator_registerNamespaces[] = "Register a prefix -> uri dict.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_v_namespaces) {
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_uri;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_uri = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_n_items); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_1 = 0; __pyx_2 = __pyx_3; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
    Py_DECREF(__pyx_v_uri);
    __pyx_v_uri = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":239
 *         """Register a prefix -> uri dict.
 *         """
 *         for prefix, uri in namespaces.items():             # <<<<<<<<<<<<<< 
 *             self._context.addNamespace(prefix, uri)
 * 
 */
    Py_DECREF(__pyx_v_uri);
    __pyx_v_uri = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":240
 *         """
 *         for prefix, uri in namespaces.items():
 *             self._context.addNamespace(prefix, uri)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, _path, **_variables):
 */
  __pyx_5 = ((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_5)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 240; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.registerNamespaces");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":242
 *             self._context.addNamespace(prefix, uri)
 * 
 *     def __call__(self, _path, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an XPath expression on the document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_21XPathElementEvaluator___call__[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v__variables = 0;
xmlXPathObject *__pyx_v_xpathObj;
struct LxmlDocument *__pyx_v_doc;
char *__pyx_v_c_path;
PyObject *__pyx_v_path;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"_path",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v__path))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v__path);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_path = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":254
 *         cdef _Document doc
 *         cdef char* c_path
 *         path = _utf8(_path)             # <<<<<<<<<<<<<< 
 *         doc = self._element._doc
 * 
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v__path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 254; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":255
 *         cdef char* c_path
 *         path = _utf8(_path)
 *         doc = self._element._doc             # <<<<<<<<<<<<<< 
 * 
 *         self._lock()
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":257
 *         doc = self._element._doc
 * 
 *         self._lock()             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         self._xpathCtxt.node = self._element._c_node
 */
__pyx_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_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 257; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":258
 * 
 *         self._lock()
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         self._xpathCtxt.node = self._element._c_node
 *         try:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":259
 *         self._lock()
 *         self._error_log.connect()
 *         self._xpathCtxt.node = self._element._c_node             # <<<<<<<<<<<<<< 
 *         try:
 *             self._context.register_context(doc)
 */
((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;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":260
 *         self._error_log.connect()
 *         self._xpathCtxt.node = self._element._c_node
 *         try:             # <<<<<<<<<<<<<< 
 *             self._context.register_context(doc)
 *             self._context.registerVariables(_variables)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":261
 *         self._xpathCtxt.node = self._element._c_node
 *         try:
 *             self._context.register_context(doc)             # <<<<<<<<<<<<<< 
 *             self._context.registerVariables(_variables)
 *             c_path = _cstr(path)
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 261; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":262
 *         try:
 *             self._context.register_context(doc)
 *             self._context.registerVariables(_variables)             # <<<<<<<<<<<<<< 
 *             c_path = _cstr(path)
 *             with nogil:
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 262; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":263
 *             self._context.register_context(doc)
 *             self._context.registerVariables(_variables)
 *             c_path = _cstr(path)             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 xpathObj = xpath.xmlXPathEvalExpression(
 */
  __pyx_v_c_path = _cstr(__pyx_v_path);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":264
 *             self._context.registerVariables(_variables)
 *             c_path = _cstr(path)
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 xpathObj = xpath.xmlXPathEvalExpression(
 *                     c_path, self._xpathCtxt)
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":266
 *             with nogil:
 *                 xpathObj = xpath.xmlXPathEvalExpression(
 *                     c_path, self._xpathCtxt)             # <<<<<<<<<<<<<< 
 *             result = self._handle_result(xpathObj, doc)
 *         finally:
 */
      __pyx_v_xpathObj = xmlXPathEvalExpression(__pyx_v_c_path,((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._xpathCtxt);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":267
 *                 xpathObj = xpath.xmlXPathEvalExpression(
 *                     c_path, self._xpathCtxt)
 *             result = self._handle_result(xpathObj, doc)             # <<<<<<<<<<<<<< 
 *         finally:
 *             self._error_log.disconnect()
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 267; goto __pyx_L3;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":269
 *             result = self._handle_result(xpathObj, doc)
 *         finally:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             self._context.unregister_context()
 *             self._unlock()
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":270
 *         finally:
 *             self._error_log.disconnect()
 *             self._context.unregister_context()             # <<<<<<<<<<<<<< 
 *             self._unlock()
 * 
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 270; goto __pyx_L8;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":271
 *             self._error_log.disconnect()
 *             self._context.unregister_context()
 *             self._unlock()             # <<<<<<<<<<<<<< 
 * 
 *         return result
 */
  ((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));
  goto __pyx_L9;
  __pyx_L8:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L9:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":273
 *             self._unlock()
 * 
 *         return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XPathElementEvaluator.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":283
 *     the 'regexp' boolean keyword (defaults to True).
 *     """
 *     def __init__(self, _ElementTree etree not None, *, namespaces=None,             # <<<<<<<<<<<<<< 
 *                  extensions=None, regexp=True):
 *         XPathElementEvaluator.__init__(
 */

static PyObject *__pyx_n_regexp;


static int __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementTree *__pyx_v_etree = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"etree","namespaces","extensions","regexp",0};
__pyx_v_namespaces = __pyx_k250;
__pyx_v_extensions = __pyx_k251;
__pyx_v_regexp = __pyx_k252;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_etree, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_regexp))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_etree), __pyx_ptype_4lxml_5etree__ElementTree, 0, "etree"))) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 283; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":285
 *     def __init__(self, _ElementTree etree not None, *, namespaces=None,
 *                  extensions=None, regexp=True):
 *         XPathElementEvaluator.__init__(             # <<<<<<<<<<<<<< 
 *             self, etree._context_node, namespaces=namespaces, 
 *             extensions=extensions, regexp=regexp)
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":286
 *                  extensions=None, regexp=True):
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 * 
 */
__pyx_2 = PyTuple_New(2); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_etree->_context_node));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_etree->_context_node));
__pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":286
 *                  extensions=None, regexp=True):
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 * 
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":287
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces, 
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, _path, **_variables):
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":287
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces, 
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, _path, **_variables):
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":289
 *             extensions=extensions, regexp=regexp)
 * 
 *     def __call__(self, _path, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an XPath expression on the document.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_22XPathDocumentEvaluator___call__[] = "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        ";
static PyObject *__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v__variables = 0;
xmlXPathObject *__pyx_v_xpathObj;
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_v_doc;
char *__pyx_v_c_path;
PyObject *__pyx_v_path;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"_path",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v__path))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v__path);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_path = Py_None; Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":299
 *         cdef _Document doc
 *         cdef char* c_path
 *         path = _utf8(_path)             # <<<<<<<<<<<<<< 
 *         doc = self._element._doc
 * 
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v__path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 299; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":300
 *         cdef char* c_path
 *         path = _utf8(_path)
 *         doc = self._element._doc             # <<<<<<<<<<<<<< 
 * 
 *         self._lock()
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":302
 *         doc = self._element._doc
 * 
 *         self._lock()             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         try:
 */
__pyx_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_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 302; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":303
 * 
 *         self._lock()
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         try:
 *             self._context.register_context(doc)
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":304
 *         self._lock()
 *         self._error_log.connect()
 *         try:             # <<<<<<<<<<<<<< 
 *             self._context.register_context(doc)
 *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":305
 *         self._error_log.connect()
 *         try:
 *             self._context.register_context(doc)             # <<<<<<<<<<<<<< 
 *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
 *             try:
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 305; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":306
 *         try:
 *             self._context.register_context(doc)
 *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)             # <<<<<<<<<<<<<< 
 *             try:
 *                 self._context.registerVariables(_variables)
 */
  __pyx_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_3 == NULL)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 306; goto __pyx_L3;}
  __pyx_v_c_doc = __pyx_3;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":307
 *             self._context.register_context(doc)
 *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
 *             try:             # <<<<<<<<<<<<<< 
 *                 self._context.registerVariables(_variables)
 *                 c_path = _cstr(path)
 */
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":308
 *             c_doc = _fakeRootDoc(doc._c_doc, self._element._c_node)
 *             try:
 *                 self._context.registerVariables(_variables)             # <<<<<<<<<<<<<< 
 *                 c_path = _cstr(path)
 *                 with nogil:
 */
    __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 308; goto __pyx_L6;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":309
 *             try:
 *                 self._context.registerVariables(_variables)
 *                 c_path = _cstr(path)             # <<<<<<<<<<<<<< 
 *                 with nogil:
 *                     self._xpathCtxt.doc  = c_doc
 */
    __pyx_v_c_path = _cstr(__pyx_v_path);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":310
 *                 self._context.registerVariables(_variables)
 *                 c_path = _cstr(path)
 *                 with nogil:             # <<<<<<<<<<<<<< 
 *                     self._xpathCtxt.doc  = c_doc
 *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
 */
    /*with nogil:*/ {
      PyThreadState *_save;
      Py_UNBLOCK_THREADS
      /*try:*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":311
 *                 c_path = _cstr(path)
 *                 with nogil:
 *                     self._xpathCtxt.doc  = c_doc             # <<<<<<<<<<<<<< 
 *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
 *                     xpathObj = xpath.xmlXPathEvalExpression(
 */
        ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt->doc = __pyx_v_c_doc;

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":312
 *                 with nogil:
 *                     self._xpathCtxt.doc  = c_doc
 *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)             # <<<<<<<<<<<<<< 
 *                     xpathObj = xpath.xmlXPathEvalExpression(
 *                         c_path, self._xpathCtxt)
 */
        ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt->node = xmlDocGetRootElement(__pyx_v_c_doc);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":314
 *                     self._xpathCtxt.node = tree.xmlDocGetRootElement(c_doc)
 *                     xpathObj = xpath.xmlXPathEvalExpression(
 *                         c_path, self._xpathCtxt)             # <<<<<<<<<<<<<< 
 *                 result = self._handle_result(xpathObj, doc)
 *             finally:
 */
        __pyx_v_xpathObj = xmlXPathEvalExpression(__pyx_v_c_path,((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt);
      }
      /*finally:*/ {
        Py_BLOCK_THREADS
      }
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":315
 *                     xpathObj = xpath.xmlXPathEvalExpression(
 *                         c_path, self._xpathCtxt)
 *                 result = self._handle_result(xpathObj, doc)             # <<<<<<<<<<<<<< 
 *             finally:
 *                 _destroyFakeDoc(doc._c_doc, c_doc)
 */
    __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 315; goto __pyx_L6;}
    Py_DECREF(__pyx_v_result);
    __pyx_v_result = __pyx_1;
    __pyx_1 = 0;
  }
  /*finally:*/ {
    int __pyx_why;
    PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
    int __pyx_exc_lineno;
    __pyx_why = 0; goto __pyx_L7;
    __pyx_L6: {
      __pyx_why = 4;
      Py_XDECREF(__pyx_1); __pyx_1 = 0;
      PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
      __pyx_exc_lineno = __pyx_lineno;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":317
 *                 result = self._handle_result(xpathObj, doc)
 *             finally:
 *                 _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 *                 self._context.unregister_context()
 *         finally:
 */
    __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":318
 *             finally:
 *                 _destroyFakeDoc(doc._c_doc, c_doc)
 *                 self._context.unregister_context()             # <<<<<<<<<<<<<< 
 *         finally:
 *             self._error_log.disconnect()
 */
    __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 318; goto __pyx_L11;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    goto __pyx_L12;
    __pyx_L11:;
    if (__pyx_why == 4) {
      Py_XDECREF(__pyx_exc_type);
      Py_XDECREF(__pyx_exc_value);
      Py_XDECREF(__pyx_exc_tb);
    }
    goto __pyx_L3;
    __pyx_L12:;
    switch (__pyx_why) {
      case 4: {
        PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
        __pyx_lineno = __pyx_exc_lineno;
        __pyx_exc_type = 0;
        __pyx_exc_value = 0;
        __pyx_exc_tb = 0;
        goto __pyx_L3;
      }
    }
  }
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":320
 *                 self._context.unregister_context()
 *         finally:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             self._unlock()
 * 
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":321
 *         finally:
 *             self._error_log.disconnect()
 *             self._unlock()             # <<<<<<<<<<<<<< 
 * 
 *         return result
 */
  ((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));
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":323
 *             self._unlock()
 * 
 *         return result             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XPathDocumentEvaluator.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":326
 * 
 * 
 * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<< 
 *                    regexp=True):
 *     """Creates an XPath evaluator for an ElementTree or an Element.
 */


static PyObject *__pyx_pf_4lxml_5etree_XPathEvaluator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_XPathEvaluator[] = "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 \'namespace\'\n    keyword argument.  EXSLT regular expression support can be disabled with\n    the \'regexp\' boolean keyword (defaults to True).\n    ";
static PyObject *__pyx_pf_4lxml_5etree_XPathEvaluator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree_or_element = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"etree_or_element","namespaces","extensions","regexp",0};
__pyx_v_namespaces = __pyx_k253;
__pyx_v_extensions = __pyx_k254;
__pyx_v_regexp = __pyx_k255;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_etree_or_element, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_regexp))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return NULL;
}
Py_INCREF(__pyx_v_etree_or_element);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":337
 *     the 'regexp' boolean keyword (defaults to True).
 *     """
 *     if isinstance(etree_or_element, _ElementTree):             # <<<<<<<<<<<<<< 
 *         return XPathDocumentEvaluator(
 *             etree_or_element, namespaces=namespaces,
 */
__pyx_1 = PyObject_IsInstance(__pyx_v_etree_or_element,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree)); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 337; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":339
 *     if isinstance(etree_or_element, _ElementTree):
 *         return XPathDocumentEvaluator(
 *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 *     else:
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}
  Py_INCREF(__pyx_v_etree_or_element);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_etree_or_element);
  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":339
 *     if isinstance(etree_or_element, _ElementTree):
 *         return XPathDocumentEvaluator(
 *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 *     else:
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":340
 *         return XPathDocumentEvaluator(
 *             etree_or_element, namespaces=namespaces,
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 *     else:
 *         return XPathElementEvaluator(
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":340
 *         return XPathDocumentEvaluator(
 *             etree_or_element, namespaces=namespaces,
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 *     else:
 *         return XPathElementEvaluator(
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}
  __pyx_4 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator), __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":343
 *     else:
 *         return XPathElementEvaluator(
 *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}
  Py_INCREF(__pyx_v_etree_or_element);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_etree_or_element);
  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":343
 *     else:
 *         return XPathElementEvaluator(
 *             etree_or_element, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *             extensions=extensions, regexp=regexp)
 * 
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":344
 *         return XPathElementEvaluator(
 *             etree_or_element, namespaces=namespaces,
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":344
 *         return XPathElementEvaluator(
 *             etree_or_element, namespaces=namespaces,
 *             extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  if (PyDict_SetItem(__pyx_3, __pyx_n_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}
  __pyx_4 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XPathElementEvaluator), __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 342; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.XPathEvaluator");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_etree_or_element);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":359
 *     cdef readonly object path
 * 
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 */

static int __pyx_pf_4lxml_5etree_5XPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_5XPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
xmlXPathContext *__pyx_v_xpathCtxt;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"path","namespaces","extensions","regexp",0};
__pyx_v_namespaces = __pyx_k256;
__pyx_v_extensions = __pyx_k257;
__pyx_v_regexp = __pyx_k258;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_path, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_regexp))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":361
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)             # <<<<<<<<<<<<<< 
 *         self.path = path
 *         path = _utf8(path)
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__XPathEvaluatorBase), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":361
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)             # <<<<<<<<<<<<<< 
 *         self.path = path
 *         path = _utf8(path)
 */
__pyx_2 = PyTuple_New(4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_regexp);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":362
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 *         self.path = path             # <<<<<<<<<<<<<< 
 *         path = _utf8(path)
 *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
 */
Py_INCREF(__pyx_v_path);
Py_DECREF(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path);
((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path = __pyx_v_path;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":363
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 *         self.path = path
 *         path = _utf8(path)             # <<<<<<<<<<<<<< 
 *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
 *         if xpathCtxt is NULL:
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 363; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":364
 *         self.path = path
 *         path = _utf8(path)
 *         xpathCtxt = xpath.xmlXPathNewContext(NULL)             # <<<<<<<<<<<<<< 
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()
 */
__pyx_v_xpathCtxt = xmlXPathNewContext(NULL);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":365
 *         path = _utf8(path)
 *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
 *         if xpathCtxt is NULL:             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 *         self.set_context(xpathCtxt)
 */
__pyx_4 = (__pyx_v_xpathCtxt == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":366
 *         xpathCtxt = xpath.xmlXPathNewContext(NULL)
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *         self.set_context(xpathCtxt)
 *         self._error_log.connect()
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 366; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":367
 *         if xpathCtxt is NULL:
 *             python.PyErr_NoMemory()
 *         self.set_context(xpathCtxt)             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
 */
__pyx_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_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 367; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":368
 *             python.PyErr_NoMemory()
 *         self.set_context(xpathCtxt)
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
 *         self._error_log.disconnect()
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":369
 *         self.set_context(xpathCtxt)
 *         self._error_log.connect()
 *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))             # <<<<<<<<<<<<<< 
 *         self._error_log.disconnect()
 *         if self._xpath is NULL:
 */
((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath = xmlXPathCtxtCompile(__pyx_v_xpathCtxt,_cstr(__pyx_v_path));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":370
 *         self._error_log.connect()
 *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *         if self._xpath is NULL:
 *             self._raise_parse_error()
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":371
 *         self._xpath = xpath.xmlXPathCtxtCompile(xpathCtxt, _cstr(path))
 *         self._error_log.disconnect()
 *         if self._xpath is NULL:             # <<<<<<<<<<<<<< 
 *             self._raise_parse_error()
 * 
 */
__pyx_4 = (((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":372
 *         self._error_log.disconnect()
 *         if self._xpath is NULL:
 *             self._raise_parse_error()             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, _etree_or_element, **_variables):
 */
  __pyx_1 = ((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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 372; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XPath.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":374
 *             self._raise_parse_error()
 * 
 *     def __call__(self, _etree_or_element, **_variables):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathObject*  xpathObj
 *         cdef _Document document
 */

static PyObject *__pyx_pf_4lxml_5etree_5XPath___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_5XPath___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__etree_or_element = 0;
PyObject *__pyx_v__variables = 0;
xmlXPathObject *__pyx_v_xpathObj;
struct LxmlDocument *__pyx_v_document;
struct LxmlElement *__pyx_v_element;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"_etree_or_element",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v__etree_or_element))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__variables);
  return NULL;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v__etree_or_element);
__pyx_v_document = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":380
 *         cdef _XPathContext context
 * 
 *         document = _documentOrRaise(_etree_or_element)             # <<<<<<<<<<<<<< 
 *         element  = _rootNodeOrRaise(_etree_or_element)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__etree_or_element)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_document));
__pyx_v_document = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":381
 * 
 *         document = _documentOrRaise(_etree_or_element)
 *         element  = _rootNodeOrRaise(_etree_or_element)             # <<<<<<<<<<<<<< 
 * 
 *         self._lock()
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__etree_or_element)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 381; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_element));
__pyx_v_element = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":383
 *         element  = _rootNodeOrRaise(_etree_or_element)
 * 
 *         self._lock()             # <<<<<<<<<<<<<< 
 *         self._error_log.connect()
 *         self._xpathCtxt.doc  = document._c_doc
 */
__pyx_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_2 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 383; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":384
 * 
 *         self._lock()
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         self._xpathCtxt.doc  = document._c_doc
 *         self._xpathCtxt.node = element._c_node
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":385
 *         self._lock()
 *         self._error_log.connect()
 *         self._xpathCtxt.doc  = document._c_doc             # <<<<<<<<<<<<<< 
 *         self._xpathCtxt.node = element._c_node
 * 
 */
((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt->doc = __pyx_v_document->_c_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":386
 *         self._error_log.connect()
 *         self._xpathCtxt.doc  = document._c_doc
 *         self._xpathCtxt.node = element._c_node             # <<<<<<<<<<<<<< 
 * 
 *         try:
 */
((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt->node = __pyx_v_element->_c_node;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":388
 *         self._xpathCtxt.node = element._c_node
 * 
 *         try:             # <<<<<<<<<<<<<< 
 *             self._context.register_context(document)
 *             self._context.registerVariables(_variables)
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":389
 * 
 *         try:
 *             self._context.register_context(document)             # <<<<<<<<<<<<<< 
 *             self._context.registerVariables(_variables)
 *             with nogil:
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 389; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":390
 *         try:
 *             self._context.register_context(document)
 *             self._context.registerVariables(_variables)             # <<<<<<<<<<<<<< 
 *             with nogil:
 *                 xpathObj = xpath.xmlXPathCompiledEval(
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 390; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":391
 *             self._context.register_context(document)
 *             self._context.registerVariables(_variables)
 *             with nogil:             # <<<<<<<<<<<<<< 
 *                 xpathObj = xpath.xmlXPathCompiledEval(
 *                     self._xpath, self._xpathCtxt)
 */
  /*with nogil:*/ {
    PyThreadState *_save;
    Py_UNBLOCK_THREADS
    /*try:*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":393
 *             with nogil:
 *                 xpathObj = xpath.xmlXPathCompiledEval(
 *                     self._xpath, self._xpathCtxt)             # <<<<<<<<<<<<<< 
 *             result = self._handle_result(xpathObj, document)
 *         finally:
 */
      __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);
    }
    /*finally:*/ {
      Py_BLOCK_THREADS
    }
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":394
 *                 xpathObj = xpath.xmlXPathCompiledEval(
 *                     self._xpath, self._xpathCtxt)
 *             result = self._handle_result(xpathObj, document)             # <<<<<<<<<<<<<< 
 *         finally:
 *             self._error_log.disconnect()
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L3;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":396
 *             result = self._handle_result(xpathObj, document)
 *         finally:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             self._context.unregister_context()
 *             self._unlock()
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":397
 *         finally:
 *             self._error_log.disconnect()
 *             self._context.unregister_context()             # <<<<<<<<<<<<<< 
 *             self._unlock()
 *         return result
 */
  __pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 397; goto __pyx_L8;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":398
 *             self._error_log.disconnect()
 *             self._context.unregister_context()
 *             self._unlock()             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
  ((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));
  goto __pyx_L9;
  __pyx_L8:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L9:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":399
 *             self._context.unregister_context()
 *             self._unlock()
 *         return result             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XPath.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_document);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__etree_or_element);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":401
 *         return result
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._xpath is not NULL:
 *             xpath.xmlXPathFreeCompExpr(self._xpath)
 */

static void __pyx_pf_4lxml_5etree_5XPath___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_5XPath___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":402
 * 
 *     def __dealloc__(self):
 *         if self._xpath is not NULL:             # <<<<<<<<<<<<<< 
 *             xpath.xmlXPathFreeCompExpr(self._xpath)
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":403
 *     def __dealloc__(self):
 *         if self._xpath is not NULL:
 *             xpath.xmlXPathFreeCompExpr(self._xpath)             # <<<<<<<<<<<<<< 
 * 
 *     def __repr__(self):
 */
  xmlXPathFreeCompExpr(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->_xpath);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":405
 *             xpath.xmlXPathFreeCompExpr(self._xpath)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<< 
 *         return self.path
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_5XPath___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_5XPath___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":406
 * 
 *     def __repr__(self):
 *         return self.path             # <<<<<<<<<<<<<< 
 * 
 * 
 */
Py_INCREF(((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path);
__pyx_r = ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_v_self)->path;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":421
 *     argument. All namespaces must be passed as part of the path string.
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,
 */


static int __pyx_pf_4lxml_5etree_7ETXPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_7ETXPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
PyObject *__pyx_v_namespaces;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"path","extensions","regexp",0};
__pyx_v_extensions = __pyx_k261;
__pyx_v_regexp = __pyx_k262;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_path, &__pyx_v_extensions, &__pyx_v_regexp))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":422
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<< 
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}
if (PyTuple_CheckExact(__pyx_1) && PyTuple_GET_SIZE(__pyx_1) == 2) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 0);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":422
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<< 
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)
 */
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = PyTuple_GET_ITEM(__pyx_1, 1);
  Py_INCREF(__pyx_3);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":422
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<< 
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)
 */
  Py_DECREF(__pyx_v_namespaces);
  __pyx_v_namespaces = __pyx_3;
  __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
else {
  __pyx_2 = PyObject_GetIter(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":422
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<< 
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)
 */
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":422
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)             # <<<<<<<<<<<<<< 
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)
 */
  Py_DECREF(__pyx_v_namespaces);
  __pyx_v_namespaces = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":423
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                        extensions=extensions, regexp=regexp)
 * 
 */
__pyx_3 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree_XPath), __pyx_n___init__); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":423
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                        extensions=extensions, regexp=regexp)
 * 
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_path);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":423
 *     def __init__(self, path, *, extensions=None, regexp=True):
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,             # <<<<<<<<<<<<<< 
 *                        extensions=extensions, regexp=regexp)
 * 
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_namespaces, __pyx_v_namespaces) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":424
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _nsextract_path(self, path):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":424
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,
 *                        extensions=extensions, regexp=regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _nsextract_path(self, path):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_regexp, __pyx_v_regexp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(__pyx_3, __pyx_1, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 423; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.ETXPath.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_namespaces);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":426
 *                        extensions=extensions, regexp=regexp)
 * 
 *     cdef _nsextract_path(self, path):             # <<<<<<<<<<<<<< 
 *         # replace {namespaces} by new prefixes
 *         cdef int i
 */

static PyObject *__pyx_k673p;
static PyObject *__pyx_k677p;

static char __pyx_k673[] = "";
static char __pyx_k674[] = "__xpp%02d";
static char __pyx_k675[] = "UTF-8";
static char __pyx_k676[] = "strict";
static char __pyx_k677[] = ":";
static char __pyx_k678[] = "UTF-8";
static char __pyx_k679[] = "strict";

static  PyObject *__pyx_f_4lxml_5etree_7ETXPath__nsextract_path(struct __pyx_obj_4lxml_5etree_ETXPath *__pyx_v_self,PyObject *__pyx_v_path) {
int __pyx_v_i;
PyObject *__pyx_v_path_utf;
PyObject *__pyx_v_stripped_path;
PyObject *__pyx_v_namespaces;
PyObject *__pyx_v_namespace_defs;
PyObject *__pyx_v_namespace_def;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_namespace;
PyObject *__pyx_v_prefix_str;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
int __pyx_4;
int __pyx_5;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_path_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_stripped_path = Py_None; Py_INCREF(Py_None);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);
__pyx_v_namespace_defs = Py_None; Py_INCREF(Py_None);
__pyx_v_namespace_def = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_namespace = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix_str = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":429
 *         # replace {namespaces} by new prefixes
 *         cdef int i
 *         path_utf = _utf8(path)             # <<<<<<<<<<<<<< 
 *         stripped_path = _replace_strings('', path_utf) # remove string literals
 *         namespaces = {}
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_path); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 429; goto __pyx_L1;}
Py_DECREF(__pyx_v_path_utf);
__pyx_v_path_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":430
 *         cdef int i
 *         path_utf = _utf8(path)
 *         stripped_path = _replace_strings('', path_utf) # remove string literals             # <<<<<<<<<<<<<< 
 *         namespaces = {}
 *         namespace_defs = []
 */
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 430; goto __pyx_L1;}
Py_INCREF(__pyx_k673p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k673p);
Py_INCREF(__pyx_v_path_utf);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_path_utf);
__pyx_2 = PyObject_CallObject(__pyx_v_4lxml_5etree__replace_strings, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 430; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_stripped_path);
__pyx_v_stripped_path = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":431
 *         path_utf = _utf8(path)
 *         stripped_path = _replace_strings('', path_utf) # remove string literals
 *         namespaces = {}             # <<<<<<<<<<<<<< 
 *         namespace_defs = []
 *         i = 1
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 431; goto __pyx_L1;}
Py_DECREF(__pyx_v_namespaces);
__pyx_v_namespaces = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":432
 *         stripped_path = _replace_strings('', path_utf) # remove string literals
 *         namespaces = {}
 *         namespace_defs = []             # <<<<<<<<<<<<<< 
 *         i = 1
 *         for namespace_def in _find_namespaces(stripped_path):
 */
__pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 432; goto __pyx_L1;}
Py_DECREF(__pyx_v_namespace_defs);
__pyx_v_namespace_defs = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":433
 *         namespaces = {}
 *         namespace_defs = []
 *         i = 1             # <<<<<<<<<<<<<< 
 *         for namespace_def in _find_namespaces(stripped_path):
 *             if namespace_def not in namespace_defs:
 */
__pyx_v_i = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":434
 *         namespace_defs = []
 *         i = 1
 *         for namespace_def in _find_namespaces(stripped_path):             # <<<<<<<<<<<<<< 
 *             if namespace_def not in namespace_defs:
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 434; goto __pyx_L1;}
Py_INCREF(__pyx_v_stripped_path);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_stripped_path);
__pyx_2 = PyObject_CallObject(__pyx_v_4lxml_5etree__find_namespaces, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 434; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyList_CheckExact(__pyx_2)) { __pyx_3 = 0; __pyx_1 = __pyx_2; Py_INCREF(__pyx_1); }
else { __pyx_1 = PyObject_GetIter(__pyx_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 434; goto __pyx_L1;} }
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":434
 *         namespace_defs = []
 *         i = 1
 *         for namespace_def in _find_namespaces(stripped_path):             # <<<<<<<<<<<<<< 
 *             if namespace_def not in namespace_defs:
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
 */
  if (PyList_CheckExact(__pyx_1)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_1)) break; __pyx_2 = PyList_GET_ITEM(__pyx_1, __pyx_3++); Py_INCREF(__pyx_2); }
  else {
    __pyx_2 = PyIter_Next(__pyx_1);
    if (!__pyx_2) {
      break;
    }
  }
  Py_DECREF(__pyx_v_namespace_def);
  __pyx_v_namespace_def = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":435
 *         i = 1
 *         for namespace_def in _find_namespaces(stripped_path):
 *             if namespace_def not in namespace_defs:             # <<<<<<<<<<<<<< 
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
 *                 i = i+1
 */
  __pyx_4 = (!PySequence_Contains(__pyx_v_namespace_defs, __pyx_v_namespace_def)); if (unlikely(__pyx_4 < 0)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 435; goto __pyx_L1;}
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":436
 *         for namespace_def in _find_namespaces(stripped_path):
 *             if namespace_def not in namespace_defs:
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)             # <<<<<<<<<<<<<< 
 *                 i = i+1
 *                 python.PyList_Append(namespace_defs, namespace_def)
 */
    __pyx_2 = PyString_FromFormat(__pyx_k674,__pyx_v_i); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 436; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":437
 *             if namespace_def not in namespace_defs:
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
 *                 i = i+1             # <<<<<<<<<<<<<< 
 *                 python.PyList_Append(namespace_defs, namespace_def)
 *                 namespace = namespace_def[1:-1] # remove '{}'
 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":438
 *                 prefix = python.PyString_FromFormat("__xpp%02d", i)
 *                 i = i+1
 *                 python.PyList_Append(namespace_defs, namespace_def)             # <<<<<<<<<<<<<< 
 *                 namespace = namespace_def[1:-1] # remove '{}'
 *                 namespace = python.PyUnicode_FromEncodedObject(
 */
    __pyx_5 = PyList_Append(__pyx_v_namespace_defs,__pyx_v_namespace_def); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 438; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":439
 *                 i = i+1
 *                 python.PyList_Append(namespace_defs, namespace_def)
 *                 namespace = namespace_def[1:-1] # remove '{}'             # <<<<<<<<<<<<<< 
 *                 namespace = python.PyUnicode_FromEncodedObject(
 *                     namespace, 'UTF-8', 'strict')
 */
    __pyx_2 = PySequence_GetSlice(__pyx_v_namespace_def, 1, -1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 439; goto __pyx_L1;}
    Py_DECREF(__pyx_v_namespace);
    __pyx_v_namespace = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":441
 *                 namespace = namespace_def[1:-1] # remove '{}'
 *                 namespace = python.PyUnicode_FromEncodedObject(
 *                     namespace, 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *                 python.PyDict_SetItem(namespaces, prefix, namespace)
 *                 prefix_str = prefix + ':'
 */
    __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_namespace,__pyx_k675,__pyx_k676); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 440; goto __pyx_L1;}
    Py_DECREF(__pyx_v_namespace);
    __pyx_v_namespace = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":442
 *                 namespace = python.PyUnicode_FromEncodedObject(
 *                     namespace, 'UTF-8', 'strict')
 *                 python.PyDict_SetItem(namespaces, prefix, namespace)             # <<<<<<<<<<<<<< 
 *                 prefix_str = prefix + ':'
 *                 # FIXME: this also replaces {namespaces} within strings!
 */
    __pyx_5 = PyDict_SetItem(__pyx_v_namespaces,__pyx_v_prefix,__pyx_v_namespace); if (unlikely(__pyx_5 == -1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 442; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":443
 *                     namespace, 'UTF-8', 'strict')
 *                 python.PyDict_SetItem(namespaces, prefix, namespace)
 *                 prefix_str = prefix + ':'             # <<<<<<<<<<<<<< 
 *                 # FIXME: this also replaces {namespaces} within strings!
 *                 path_utf = path_utf.replace(namespace_def, prefix_str)
 */
    __pyx_2 = PyNumber_Add(__pyx_v_prefix, __pyx_k677p); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 443; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix_str);
    __pyx_v_prefix_str = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":445
 *                 prefix_str = prefix + ':'
 *                 # FIXME: this also replaces {namespaces} within strings!
 *                 path_utf = path_utf.replace(namespace_def, prefix_str)             # <<<<<<<<<<<<<< 
 *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')
 *         return path, namespaces
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_path_utf, __pyx_n_replace); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 445; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":445
 *                 prefix_str = prefix + ':'
 *                 # FIXME: this also replaces {namespaces} within strings!
 *                 path_utf = path_utf.replace(namespace_def, prefix_str)             # <<<<<<<<<<<<<< 
 *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')
 *         return path, namespaces
 */
    __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 445; goto __pyx_L1;}
    Py_INCREF(__pyx_v_namespace_def);
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_namespace_def);
    Py_INCREF(__pyx_v_prefix_str);
    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_prefix_str);
    __pyx_7 = PyObject_CallObject(__pyx_2, __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 445; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_v_path_utf);
    __pyx_v_path_utf = __pyx_7;
    __pyx_7 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":446
 *                 # FIXME: this also replaces {namespaces} within strings!
 *                 path_utf = path_utf.replace(namespace_def, prefix_str)
 *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')             # <<<<<<<<<<<<<< 
 *         return path, namespaces
 */
__pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_path_utf,__pyx_k678,__pyx_k679); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 446; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":447
 *                 path_utf = path_utf.replace(namespace_def, prefix_str)
 *         path = python.PyUnicode_FromEncodedObject(path_utf, 'UTF-8', 'strict')
 *         return path, namespaces             # <<<<<<<<<<<<<< 
 */
__pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 447; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_path);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_namespaces);
__pyx_r = __pyx_6;
__pyx_6 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.ETXPath._nsextract_path");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_path_utf);
Py_DECREF(__pyx_v_stripped_path);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_namespace_defs);
Py_DECREF(__pyx_v_namespace_def);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_namespace);
Py_DECREF(__pyx_v_prefix_str);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":54
 *     cdef _BaseParser _parser
 * 
 *     cdef _XSLTResolverContext _copy(self):             # <<<<<<<<<<<<<< 
 *         cdef _XSLTResolverContext context
 *         context = _XSLTResolverContext()
 */

static  struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy(struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_self) {
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":56
 *     cdef _XSLTResolverContext _copy(self):
 *         cdef _XSLTResolverContext context
 *         context = _XSLTResolverContext()             # <<<<<<<<<<<<<< 
 *         _initXSLTResolverContext(context, self._parser)
 *         context._c_style_doc = self._c_style_doc
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResolverContext), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 56; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__XSLTResolverContext)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 56; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":57
 *         cdef _XSLTResolverContext context
 *         context = _XSLTResolverContext()
 *         _initXSLTResolverContext(context, self._parser)             # <<<<<<<<<<<<<< 
 *         context._c_style_doc = self._c_style_doc
 *         return context
 */
__pyx_1 = __pyx_f_4lxml_5etree__initXSLTResolverContext(__pyx_v_context,__pyx_v_self->_parser); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 57; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":58
 *         context = _XSLTResolverContext()
 *         _initXSLTResolverContext(context, self._parser)
 *         context._c_style_doc = self._c_style_doc             # <<<<<<<<<<<<<< 
 *         return context
 * 
 */
__pyx_v_context->_c_style_doc = __pyx_v_self->_c_style_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":59
 *         _initXSLTResolverContext(context, self._parser)
 *         context._c_style_doc = self._c_style_doc
 *         return context             # <<<<<<<<<<<<<< 
 * 
 * cdef _initXSLTResolverContext(_XSLTResolverContext context,
 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = __pyx_v_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XSLTResolverContext._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":61
 *         return context
 * 
 * cdef _initXSLTResolverContext(_XSLTResolverContext context,             # <<<<<<<<<<<<<< 
 *                               _BaseParser parser):
 *     _initResolverContext(context, parser.resolvers)
 */

static PyObject *__pyx_n_resolvers;

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) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_context);
Py_INCREF(__pyx_v_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":63
 * cdef _initXSLTResolverContext(_XSLTResolverContext context,
 *                               _BaseParser parser):
 *     _initResolverContext(context, parser.resolvers)             # <<<<<<<<<<<<<< 
 *     context._parser = parser
 *     context._c_style_doc = NULL
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_parser), __pyx_n_resolvers); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 63; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 63; goto __pyx_L1;}
__pyx_2 = __pyx_f_4lxml_5etree__initResolverContext(((struct __pyx_obj_4lxml_5etree__ResolverContext *)__pyx_v_context),((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)__pyx_1)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":64
 *                               _BaseParser parser):
 *     _initResolverContext(context, parser.resolvers)
 *     context._parser = parser             # <<<<<<<<<<<<<< 
 *     context._c_style_doc = NULL
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_parser));
Py_DECREF(((PyObject *)__pyx_v_context->_parser));
__pyx_v_context->_parser = __pyx_v_parser;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":65
 *     _initResolverContext(context, parser.resolvers)
 *     context._parser = parser
 *     context._c_style_doc = NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _xslt_resolve_from_python(char* c_uri, void* c_context,
 */
__pyx_v_context->_c_style_doc = NULL;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._initXSLTResolverContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":67
 *     context._c_style_doc = NULL
 * 
 * cdef xmlDoc* _xslt_resolve_from_python(char* c_uri, void* c_context,             # <<<<<<<<<<<<<< 
 *                                        int parse_options, int* error) with gil:
 *     # call the Python document loaders
 */

static char __pyx_k680[] = "string://";
static char __pyx_k681[] = "string://";
static char __pyx_k682[] = "<string>";

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) {
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__ResolverRegistry *__pyx_v_resolvers;
struct __pyx_obj_4lxml_5etree__InputDocument *__pyx_v_doc_ref;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_v_uri;
xmlDoc *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
xmlDoc *__pyx_6;
xmlDoc *__pyx_7;
xmlDoc *__pyx_8;
xmlDoc *__pyx_9;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_uri = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":75
 *     cdef xmlDoc* c_doc
 * 
 *     error[0] = 0             # <<<<<<<<<<<<<< 
 *     context = <_XSLTResolverContext>c_context
 * 
 */
(__pyx_v_error[0]) = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":76
 * 
 *     error[0] = 0
 *     context = <_XSLTResolverContext>c_context             # <<<<<<<<<<<<<< 
 * 
 *     # shortcut if we resolve the stylesheet itself
 */
__pyx_1 = (PyObject *)__pyx_v_c_context;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":79
 * 
 *     # shortcut if we resolve the stylesheet itself
 *     c_doc = context._c_style_doc             # <<<<<<<<<<<<<< 
 *     if c_doc is not NULL and c_doc.URL is not NULL:
 *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
 */
__pyx_v_c_doc = __pyx_v_context->_c_style_doc;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":80
 *     # shortcut if we resolve the stylesheet itself
 *     c_doc = context._c_style_doc
 *     if c_doc is not NULL and c_doc.URL is not NULL:             # <<<<<<<<<<<<<< 
 *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
 *             return _copyDoc(c_doc, 1)
 */
__pyx_2 = (__pyx_v_c_doc != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":80
 *     # shortcut if we resolve the stylesheet itself
 *     c_doc = context._c_style_doc
 *     if c_doc is not NULL and c_doc.URL is not NULL:             # <<<<<<<<<<<<<< 
 *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
 *             return _copyDoc(c_doc, 1)
 */
  __pyx_2 = (__pyx_v_c_doc->URL != NULL);
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":81
 *     c_doc = context._c_style_doc
 *     if c_doc is not NULL and c_doc.URL is not NULL:
 *         if cstd.strcmp(c_uri, c_doc.URL) == 0:             # <<<<<<<<<<<<<< 
 *             return _copyDoc(c_doc, 1)
 * 
 */
  __pyx_2 = (strcmp(__pyx_v_c_uri,__pyx_v_c_doc->URL) == 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":82
 *     if c_doc is not NULL and c_doc.URL is not NULL:
 *         if cstd.strcmp(c_uri, c_doc.URL) == 0:
 *             return _copyDoc(c_doc, 1)             # <<<<<<<<<<<<<< 
 * 
 *     # delegate to the Python resolvers
 */
    __pyx_3 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc,1); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 82; goto __pyx_L1;}
    __pyx_r = __pyx_3;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":85
 * 
 *     # delegate to the Python resolvers
 *     try:             # <<<<<<<<<<<<<< 
 *         resolvers = context._resolvers
 *         if cstd.strncmp('string://', c_uri, 9) == 0:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":86
 *     # delegate to the Python resolvers
 *     try:
 *         resolvers = context._resolvers             # <<<<<<<<<<<<<< 
 *         if cstd.strncmp('string://', c_uri, 9) == 0:
 *             uri = funicode(c_uri + 9)
 */
  Py_INCREF(((PyObject *)__pyx_v_context->__pyx_base._resolvers));
  Py_DECREF(((PyObject *)__pyx_v_resolvers));
  __pyx_v_resolvers = __pyx_v_context->__pyx_base._resolvers;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":87
 *     try:
 *         resolvers = context._resolvers
 *         if cstd.strncmp('string://', c_uri, 9) == 0:             # <<<<<<<<<<<<<< 
 *             uri = funicode(c_uri + 9)
 *             if cstd.strncmp('string://', context._c_style_doc.URL, 9) != 0 and \
 */
  __pyx_2 = (strncmp(__pyx_k680,__pyx_v_c_uri,9) == 0);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":88
 *         resolvers = context._resolvers
 *         if cstd.strncmp('string://', c_uri, 9) == 0:
 *             uri = funicode(c_uri + 9)             # <<<<<<<<<<<<<< 
 *             if cstd.strncmp('string://', context._c_style_doc.URL, 9) != 0 and \
 *                     cstd.strcmp('<string>', context._c_style_doc.URL) != 0:
 */
    __pyx_1 = __pyx_f_4lxml_5etree_funicode((__pyx_v_c_uri + 9)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 88; goto __pyx_L4;}
    Py_DECREF(__pyx_v_uri);
    __pyx_v_uri = __pyx_1;
    __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":89
 *         if cstd.strncmp('string://', c_uri, 9) == 0:
 *             uri = funicode(c_uri + 9)
 *             if cstd.strncmp('string://', context._c_style_doc.URL, 9) != 0 and \             # <<<<<<<<<<<<<< 
 *                     cstd.strcmp('<string>', context._c_style_doc.URL) != 0:
 *                 # stylesheet URL known => make the target URL absolute
 */
    __pyx_2 = (strncmp(__pyx_k681,__pyx_v_context->_c_style_doc->URL,9) != 0);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":90
 *             uri = funicode(c_uri + 9)
 *             if cstd.strncmp('string://', context._c_style_doc.URL, 9) != 0 and \
 *                     cstd.strcmp('<string>', context._c_style_doc.URL) != 0:             # <<<<<<<<<<<<<< 
 *                 # stylesheet URL known => make the target URL absolute
 *                 uri = os_path_join(context._c_style_doc.URL, uri)
 */
      __pyx_2 = (strcmp(__pyx_k682,__pyx_v_context->_c_style_doc->URL) != 0);
    }
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":92
 *                     cstd.strcmp('<string>', context._c_style_doc.URL) != 0:
 *                 # stylesheet URL known => make the target URL absolute
 *                 uri = os_path_join(context._c_style_doc.URL, uri)             # <<<<<<<<<<<<<< 
 *         else:
 *             uri = funicode(c_uri)
 */
      __pyx_1 = PyString_FromString(__pyx_v_context->_c_style_doc->URL); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 92; goto __pyx_L4;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":92
 *                     cstd.strcmp('<string>', context._c_style_doc.URL) != 0:
 *                 # stylesheet URL known => make the target URL absolute
 *                 uri = os_path_join(context._c_style_doc.URL, uri)             # <<<<<<<<<<<<<< 
 *         else:
 *             uri = funicode(c_uri)
 */
      __pyx_4 = PyTuple_New(2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 92; goto __pyx_L4;}
      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
      Py_INCREF(__pyx_v_uri);
      PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_uri);
      __pyx_1 = 0;
      __pyx_1 = PyObject_CallObject(__pyx_v_4lxml_5etree_os_path_join, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 92; goto __pyx_L4;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_v_uri);
      __pyx_v_uri = __pyx_1;
      __pyx_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":94
 *                 uri = os_path_join(context._c_style_doc.URL, uri)
 *         else:
 *             uri = funicode(c_uri)             # <<<<<<<<<<<<<< 
 *         doc_ref = resolvers.resolve(uri, None, context)
 * 
 */
    __pyx_4 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_uri); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 94; goto __pyx_L4;}
    Py_DECREF(__pyx_v_uri);
    __pyx_v_uri = __pyx_4;
    __pyx_4 = 0;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":95
 *         else:
 *             uri = funicode(c_uri)
 *         doc_ref = resolvers.resolve(uri, None, context)             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = NULL
 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_resolvers), __pyx_n_resolve); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 95; goto __pyx_L4;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":95
 *         else:
 *             uri = funicode(c_uri)
 *         doc_ref = resolvers.resolve(uri, None, context)             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = NULL
 */
  __pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 95; goto __pyx_L4;}
  Py_INCREF(__pyx_v_uri);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_uri);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_4, 1, Py_None);
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_4, 2, ((PyObject *)__pyx_v_context));
  __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 95; goto __pyx_L4;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree__InputDocument)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 95; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_doc_ref));
  __pyx_v_doc_ref = ((struct __pyx_obj_4lxml_5etree__InputDocument *)__pyx_5);
  __pyx_5 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":97
 *         doc_ref = resolvers.resolve(uri, None, context)
 * 
 *         c_doc = NULL             # <<<<<<<<<<<<<< 
 *         if doc_ref is not None:
 *             if doc_ref._type == PARSER_DATA_STRING:
 */
  __pyx_v_c_doc = NULL;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":98
 * 
 *         c_doc = NULL
 *         if doc_ref is not None:             # <<<<<<<<<<<<<< 
 *             if doc_ref._type == PARSER_DATA_STRING:
 *                 c_doc = _parseDoc(
 */
  __pyx_2 = (((PyObject *)__pyx_v_doc_ref) != Py_None);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":99
 *         c_doc = NULL
 *         if doc_ref is not None:
 *             if doc_ref._type == PARSER_DATA_STRING:             # <<<<<<<<<<<<<< 
 *                 c_doc = _parseDoc(
 *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
 */
    __pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_STRING);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":101
 *             if doc_ref._type == PARSER_DATA_STRING:
 *                 c_doc = _parseDoc(
 *                     doc_ref._data_bytes, doc_ref._filename, context._parser)             # <<<<<<<<<<<<<< 
 *             elif doc_ref._type == PARSER_DATA_FILENAME:
 *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
 */
      __pyx_6 = __pyx_f_4lxml_5etree__parseDoc(__pyx_v_doc_ref->_data_bytes,__pyx_v_doc_ref->_filename,__pyx_v_context->_parser); if (unlikely(__pyx_6 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 100; goto __pyx_L4;}
      __pyx_v_c_doc = __pyx_6;
      goto __pyx_L9;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":102
 *                 c_doc = _parseDoc(
 *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_FILENAME:             # <<<<<<<<<<<<<< 
 *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_FILE:
 */
    __pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILENAME);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":103
 *                     doc_ref._data_bytes, doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_FILENAME:
 *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)             # <<<<<<<<<<<<<< 
 *             elif doc_ref._type == PARSER_DATA_FILE:
 *                 c_doc = _parseDocFromFilelike(
 */
      __pyx_7 = __pyx_f_4lxml_5etree__parseDocFromFile(__pyx_v_doc_ref->_filename,__pyx_v_context->_parser); if (unlikely(__pyx_7 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 103; goto __pyx_L4;}
      __pyx_v_c_doc = __pyx_7;
      goto __pyx_L9;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":104
 *             elif doc_ref._type == PARSER_DATA_FILENAME:
 *                 c_doc = _parseDocFromFile(doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_FILE:             # <<<<<<<<<<<<<< 
 *                 c_doc = _parseDocFromFilelike(
 *                     doc_ref._file, doc_ref._filename, context._parser)
 */
    __pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_FILE);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":106
 *             elif doc_ref._type == PARSER_DATA_FILE:
 *                 c_doc = _parseDocFromFilelike(
 *                     doc_ref._file, doc_ref._filename, context._parser)             # <<<<<<<<<<<<<< 
 *             elif doc_ref._type == PARSER_DATA_EMPTY:
 *                 c_doc = _newDoc()
 */
      __pyx_8 = __pyx_f_4lxml_5etree__parseDocFromFilelike(__pyx_v_doc_ref->_file,__pyx_v_doc_ref->_filename,__pyx_v_context->_parser); if (unlikely(__pyx_8 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 105; goto __pyx_L4;}
      __pyx_v_c_doc = __pyx_8;
      goto __pyx_L9;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":107
 *                 c_doc = _parseDocFromFilelike(
 *                     doc_ref._file, doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_EMPTY:             # <<<<<<<<<<<<<< 
 *                 c_doc = _newDoc()
 *             if c_doc is not NULL and c_doc.URL is NULL:
 */
    __pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_4lxml_5etree_PARSER_DATA_EMPTY);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":108
 *                     doc_ref._file, doc_ref._filename, context._parser)
 *             elif doc_ref._type == PARSER_DATA_EMPTY:
 *                 c_doc = _newDoc()             # <<<<<<<<<<<<<< 
 *             if c_doc is not NULL and c_doc.URL is NULL:
 *                 c_doc.URL = tree.xmlStrdup(c_uri)
 */
      __pyx_9 = __pyx_f_4lxml_5etree__newDoc(); if (unlikely(__pyx_9 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 108; goto __pyx_L4;}
      __pyx_v_c_doc = __pyx_9;
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":109
 *             elif doc_ref._type == PARSER_DATA_EMPTY:
 *                 c_doc = _newDoc()
 *             if c_doc is not NULL and c_doc.URL is NULL:             # <<<<<<<<<<<<<< 
 *                 c_doc.URL = tree.xmlStrdup(c_uri)
 *         return c_doc
 */
    __pyx_2 = (__pyx_v_c_doc != NULL);
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":109
 *             elif doc_ref._type == PARSER_DATA_EMPTY:
 *                 c_doc = _newDoc()
 *             if c_doc is not NULL and c_doc.URL is NULL:             # <<<<<<<<<<<<<< 
 *                 c_doc.URL = tree.xmlStrdup(c_uri)
 *         return c_doc
 */
      __pyx_2 = (__pyx_v_c_doc->URL == NULL);
    }
    if (__pyx_2) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":110
 *                 c_doc = _newDoc()
 *             if c_doc is not NULL and c_doc.URL is NULL:
 *                 c_doc.URL = tree.xmlStrdup(c_uri)             # <<<<<<<<<<<<<< 
 *         return c_doc
 *     except:
 */
      __pyx_v_c_doc->URL = xmlStrdup(__pyx_v_c_uri);
      goto __pyx_L10;
    }
    __pyx_L10:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":111
 *             if c_doc is not NULL and c_doc.URL is NULL:
 *                 c_doc.URL = tree.xmlStrdup(c_uri)
 *         return c_doc             # <<<<<<<<<<<<<< 
 *     except:
 *         context._store_raised()
 */
  __pyx_r = __pyx_v_c_doc;
  goto __pyx_L0;
}
goto __pyx_L5;
__pyx_L4:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":112
 *                 c_doc.URL = tree.xmlStrdup(c_uri)
 *         return c_doc
 *     except:             # <<<<<<<<<<<<<< 
 *         context._store_raised()
 *         error[0] = 1
 */
/*except:*/ {
  __Pyx_AddTraceback("lxml.etree._xslt_resolve_from_python");
  if (__Pyx_GetException(&__pyx_1, &__pyx_4, &__pyx_5) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 112; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":113
 *         return c_doc
 *     except:
 *         context._store_raised()             # <<<<<<<<<<<<<< 
 *         error[0] = 1
 *         return NULL
 */
  ((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));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":114
 *     except:
 *         context._store_raised()
 *         error[0] = 1             # <<<<<<<<<<<<<< 
 *         return NULL
 * 
 */
  (__pyx_v_error[0]) = 1;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":115
 *         context._store_raised()
 *         error[0] = 1
 *         return NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,
 */
  __pyx_r = NULL;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("lxml.etree._xslt_resolve_from_python");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_resolvers);
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_uri);
PyGILState_Release(_save);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":117
 *         return NULL
 * 
 * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,             # <<<<<<<<<<<<<< 
 *                                          xslt.xsltLoadType c_type) with gil:
 *     message = "Cannot resolve URI %s" % c_uri
 */

static PyObject *__pyx_k683p;

static char __pyx_k683[] = "Cannot resolve URI %s";

static  void __pyx_f_4lxml_5etree__xslt_store_resolver_exception(char *__pyx_v_c_uri,void *__pyx_v_context,xsltLoadType __pyx_v_c_type) {
PyObject *__pyx_v_message;
PyObject *__pyx_v_exception;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyGILState_STATE _save = PyGILState_Ensure();
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_exception = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":119
 * cdef void _xslt_store_resolver_exception(char* c_uri, void* context,
 *                                          xslt.xsltLoadType c_type) with gil:
 *     message = "Cannot resolve URI %s" % c_uri             # <<<<<<<<<<<<<< 
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:
 *         exception = XSLTApplyError(message)
 */
__pyx_1 = PyString_FromString(__pyx_v_c_uri); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k683p, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 119; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_message);
__pyx_v_message = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":120
 *                                          xslt.xsltLoadType c_type) with gil:
 *     message = "Cannot resolve URI %s" % c_uri
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:             # <<<<<<<<<<<<<< 
 *         exception = XSLTApplyError(message)
 *     else:
 */
__pyx_3 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":121
 *     message = "Cannot resolve URI %s" % c_uri
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:
 *         exception = XSLTApplyError(message)             # <<<<<<<<<<<<<< 
 *     else:
 *         exception = XSLTParseError(message)
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTApplyError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 121; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":121
 *     message = "Cannot resolve URI %s" % c_uri
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:
 *         exception = XSLTApplyError(message)             # <<<<<<<<<<<<<< 
 *     else:
 *         exception = XSLTParseError(message)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_message);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_exception);
  __pyx_v_exception = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":123
 *         exception = XSLTApplyError(message)
 *     else:
 *         exception = XSLTParseError(message)             # <<<<<<<<<<<<<< 
 *     (<_XSLTResolverContext>context)._store_exception(exception)
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 123; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":123
 *         exception = XSLTApplyError(message)
 *     else:
 *         exception = XSLTParseError(message)             # <<<<<<<<<<<<<< 
 *     (<_XSLTResolverContext>context)._store_exception(exception)
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_INCREF(__pyx_v_message);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_message);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_exception);
  __pyx_v_exception = __pyx_4;
  __pyx_4 = 0;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":124
 *     else:
 *         exception = XSLTParseError(message)
 *     (<_XSLTResolverContext>context)._store_exception(exception)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _xslt_doc_loader(char* c_uri, tree.xmlDict* c_dict,
 */
__pyx_1 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":124
 *     else:
 *         exception = XSLTParseError(message)
 *     (<_XSLTResolverContext>context)._store_exception(exception)             # <<<<<<<<<<<<<< 
 * 
 * cdef xmlDoc* _xslt_doc_loader(char* c_uri, tree.xmlDict* c_dict,
 */
((struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext *)((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_1)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_1),__pyx_v_exception);
Py_DECREF(__pyx_1); __pyx_1 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("lxml.etree._xslt_store_resolver_exception");
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_exception);
PyGILState_Release(_save);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":126
 *     (<_XSLTResolverContext>context)._store_exception(exception)
 * 
 * cdef xmlDoc* _xslt_doc_loader(char* c_uri, tree.xmlDict* c_dict,             # <<<<<<<<<<<<<< 
 *                               int parse_options, void* c_ctxt,
 *                               xslt.xsltLoadType c_type) nogil:
 */

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) {
xmlDoc *__pyx_v_c_doc;
void *__pyx_v_c_pcontext;
int __pyx_v_error;
xmlDoc *__pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":136
 *     cdef int error
 *     # find resolver contexts of stylesheet and transformed doc
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:             # <<<<<<<<<<<<<< 
 *         # transformation time
 *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private
 */
__pyx_1 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":138
 *     if c_type == xslt.XSLT_LOAD_DOCUMENT:
 *         # transformation time
 *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private             # <<<<<<<<<<<<<< 
 *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:
 *         # include/import resolution while parsing
 */
  __pyx_v_c_pcontext = ((xsltTransformContext *)__pyx_v_c_ctxt)->_private;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":139
 *         # transformation time
 *         c_pcontext = (<xslt.xsltTransformContext*>c_ctxt)._private
 *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:             # <<<<<<<<<<<<<< 
 *         # include/import resolution while parsing
 *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private
 */
__pyx_1 = (__pyx_v_c_type == XSLT_LOAD_STYLESHEET);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":141
 *     elif c_type == xslt.XSLT_LOAD_STYLESHEET:
 *         # include/import resolution while parsing
 *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private             # <<<<<<<<<<<<<< 
 *     else:
 *         c_pcontext = NULL
 */
  __pyx_v_c_pcontext = ((xsltStylesheet *)__pyx_v_c_ctxt)->doc->_private;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":143
 *         c_pcontext = (<xslt.xsltStylesheet*>c_ctxt).doc._private
 *     else:
 *         c_pcontext = NULL             # <<<<<<<<<<<<<< 
 * 
 *     if c_pcontext is NULL:
 */
  __pyx_v_c_pcontext = NULL;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":145
 *         c_pcontext = NULL
 * 
 *     if c_pcontext is NULL:             # <<<<<<<<<<<<<< 
 *         # can't call Python without context, fall back to default loader
 *         return XSLT_DOC_DEFAULT_LOADER(
 */
__pyx_1 = (__pyx_v_c_pcontext == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":148
 *         # can't call Python without context, fall back to default loader
 *         return XSLT_DOC_DEFAULT_LOADER(
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)             # <<<<<<<<<<<<<< 
 * 
 *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)
 */
  __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);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":150
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)
 * 
 *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)             # <<<<<<<<<<<<<< 
 *     if c_doc is NULL and not error:
 *         c_doc = XSLT_DOC_DEFAULT_LOADER(
 */
__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));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":151
 * 
 *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)
 *     if c_doc is NULL and not error:             # <<<<<<<<<<<<<< 
 *         c_doc = XSLT_DOC_DEFAULT_LOADER(
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)
 */
__pyx_1 = (__pyx_v_c_doc == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":151
 * 
 *     c_doc = _xslt_resolve_from_python(c_uri, c_pcontext, parse_options, &error)
 *     if c_doc is NULL and not error:             # <<<<<<<<<<<<<< 
 *         c_doc = XSLT_DOC_DEFAULT_LOADER(
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)
 */
  __pyx_1 = (!__pyx_v_error);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":153
 *     if c_doc is NULL and not error:
 *         c_doc = XSLT_DOC_DEFAULT_LOADER(
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)             # <<<<<<<<<<<<<< 
 *         if c_doc is NULL:
 *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
 */
  __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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":154
 *         c_doc = XSLT_DOC_DEFAULT_LOADER(
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)
 *         if c_doc is NULL:             # <<<<<<<<<<<<<< 
 *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
 * 
 */
  __pyx_1 = (__pyx_v_c_doc == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":155
 *             c_uri, c_dict, parse_options, c_ctxt, c_type)
 *         if c_doc is NULL:
 *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)             # <<<<<<<<<<<<<< 
 * 
 *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
 */
    __pyx_f_4lxml_5etree__xslt_store_resolver_exception(__pyx_v_c_uri,__pyx_v_c_pcontext,__pyx_v_c_type);
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":157
 *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
 * 
 *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:             # <<<<<<<<<<<<<< 
 *         c_doc._private = c_pcontext
 *     return c_doc
 */
__pyx_1 = (__pyx_v_c_doc != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":157
 *             _xslt_store_resolver_exception(c_uri, c_pcontext, c_type)
 * 
 *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:             # <<<<<<<<<<<<<< 
 *         c_doc._private = c_pcontext
 *     return c_doc
 */
  __pyx_1 = (__pyx_v_c_type == XSLT_LOAD_STYLESHEET);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":158
 * 
 *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
 *         c_doc._private = c_pcontext             # <<<<<<<<<<<<<< 
 *     return c_doc
 * 
 */
  __pyx_v_c_doc->_private = __pyx_v_c_pcontext;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":159
 *     if c_doc is not NULL and c_type == xslt.XSLT_LOAD_STYLESHEET:
 *         c_doc._private = c_pcontext
 *     return c_doc             # <<<<<<<<<<<<<< 
 * 
 * cdef xslt.xsltDocLoaderFunc XSLT_DOC_DEFAULT_LOADER
 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":182
 *     """
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<< 
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 */

static PyObject *__pyx_k684p;

static char __pyx_k684[] = "Error preparing access control context";

static int __pyx_pf_4lxml_5etree_17XSLTAccessControl___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_17XSLTAccessControl___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_read_file = 0;
PyObject *__pyx_v_write_file = 0;
PyObject *__pyx_v_create_dir = 0;
PyObject *__pyx_v_read_network = 0;
PyObject *__pyx_v_write_network = 0;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"read_file","write_file","create_dir","read_network","write_network",0};
__pyx_v_read_file = __pyx_k273;
__pyx_v_write_file = __pyx_k274;
__pyx_v_create_dir = __pyx_k275;
__pyx_v_read_network = __pyx_k276;
__pyx_v_write_network = __pyx_k277;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOO", __pyx_argnames, &__pyx_v_read_file, &__pyx_v_write_file, &__pyx_v_create_dir, &__pyx_v_read_network, &__pyx_v_write_network))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_read_file);
Py_INCREF(__pyx_v_write_file);
Py_INCREF(__pyx_v_create_dir);
Py_INCREF(__pyx_v_read_network);
Py_INCREF(__pyx_v_write_network);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":184
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()             # <<<<<<<<<<<<<< 
 *         if self._prefs is NULL:
 *             raise XSLTError, "Error preparing access control context"
 */
((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs = xsltNewSecurityPrefs();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":185
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 *         if self._prefs is NULL:             # <<<<<<<<<<<<<< 
 *             raise XSLTError, "Error preparing access control context"
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":186
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 *         if self._prefs is NULL:
 *             raise XSLTError, "Error preparing access control context"             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 186; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":186
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 *         if self._prefs is NULL:
 *             raise XSLTError, "Error preparing access control context"             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
 */
  __Pyx_Raise(__pyx_2, __pyx_k684p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 186; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":187
 *         if self._prefs is NULL:
 *             raise XSLTError, "Error preparing access control context"
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
 *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 187; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":188
 *             raise XSLTError, "Error preparing access control context"
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
 *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 188; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":189
 *         self._setAccess(xslt.XSLT_SECPREF_READ_FILE, read_file)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
 *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 189; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":190
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_FILE, write_file)
 *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
 *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)             # <<<<<<<<<<<<<< 
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
 * 
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 190; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":191
 *         self._setAccess(xslt.XSLT_SECPREF_CREATE_DIRECTORY, create_dir)
 *         self._setAccess(xslt.XSLT_SECPREF_READ_NETWORK, read_network)
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 191; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.XSLTAccessControl.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_read_file);
Py_DECREF(__pyx_v_write_file);
Py_DECREF(__pyx_v_create_dir);
Py_DECREF(__pyx_v_read_network);
Py_DECREF(__pyx_v_write_network);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":193
 *         self._setAccess(xslt.XSLT_SECPREF_WRITE_NETWORK, write_network)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._prefs is not NULL:
 *             xslt.xsltFreeSecurityPrefs(self._prefs)
 */

static void __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":194
 * 
 *     def __dealloc__(self):
 *         if self._prefs is not NULL:             # <<<<<<<<<<<<<< 
 *             xslt.xsltFreeSecurityPrefs(self._prefs)
 * 
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":195
 *     def __dealloc__(self):
 *         if self._prefs is not NULL:
 *             xslt.xsltFreeSecurityPrefs(self._prefs)             # <<<<<<<<<<<<<< 
 * 
 *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):
 */
  xsltFreeSecurityPrefs(((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":197
 *             xslt.xsltFreeSecurityPrefs(self._prefs)
 * 
 *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):             # <<<<<<<<<<<<<< 
 *         cdef xslt.xsltSecurityCheck function
 *         if allow:
 */

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) {
xsltSecurityCheck __pyx_v_function;
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_allow);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":199
 *     cdef _setAccess(self, xslt.xsltSecurityOption option, allow):
 *         cdef xslt.xsltSecurityCheck function
 *         if allow:             # <<<<<<<<<<<<<< 
 *             function = xslt.xsltSecurityAllow
 *         else:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_allow); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 199; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":200
 *         cdef xslt.xsltSecurityCheck function
 *         if allow:
 *             function = xslt.xsltSecurityAllow             # <<<<<<<<<<<<<< 
 *         else:
 *             function = xslt.xsltSecurityForbid
 */
  __pyx_v_function = xsltSecurityAllow;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":202
 *             function = xslt.xsltSecurityAllow
 *         else:
 *             function = xslt.xsltSecurityForbid             # <<<<<<<<<<<<<< 
 *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)
 * 
 */
  __pyx_v_function = xsltSecurityForbid;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":203
 *         else:
 *             function = xslt.xsltSecurityForbid
 *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)             # <<<<<<<<<<<<<< 
 * 
 *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):
 */
xsltSetSecurityPrefs(__pyx_v_self->_prefs,__pyx_v_option,__pyx_v_function);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.XSLTAccessControl._setAccess");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_allow);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":205
 *         xslt.xsltSetSecurityPrefs(self._prefs, option, function)
 * 
 *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):             # <<<<<<<<<<<<<< 
 *         xslt.xsltSetCtxtSecurityPrefs(self._prefs, ctxt)
 * 
 */

static  void __pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context(struct __pyx_obj_4lxml_5etree_XSLTAccessControl *__pyx_v_self,xsltTransformContext *__pyx_v_ctxt) {
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":206
 * 
 *     cdef void _register_in_context(self, xslt.xsltTransformContext* ctxt):
 *         xslt.xsltSetCtxtSecurityPrefs(self._prefs, ctxt)             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
xsltSetCtxtSecurityPrefs(__pyx_v_self->_prefs,__pyx_v_ctxt);

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":211
 * # XSLT
 * 
 * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<< 
 *     if ns_utf is None:
 *         return 0
 */

static  int __pyx_f_4lxml_5etree__register_xslt_function(void *__pyx_v_ctxt,PyObject *__pyx_v_name_utf,PyObject *__pyx_v_ns_utf) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_ns_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":212
 * 
 * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:             # <<<<<<<<<<<<<< 
 *         return 0
 *     return xslt.xsltRegisterExtFunction(
 */
__pyx_1 = (__pyx_v_ns_utf == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":213
 * cdef int _register_xslt_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:
 *         return 0             # <<<<<<<<<<<<<< 
 *     return xslt.xsltRegisterExtFunction(
 *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":216
 *     return xslt.xsltRegisterExtFunction(
 *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
 *         _xpath_function_call)             # <<<<<<<<<<<<<< 
 * 
 * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
 */
__pyx_r = xsltRegisterExtFunction(((xsltTransformContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),__pyx_f_4lxml_5etree__xpath_function_call);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_ns_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":218
 *         _xpath_function_call)
 * 
 * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):             # <<<<<<<<<<<<<< 
 *     if ns_utf is None:
 *         return 0
 */

static  int __pyx_f_4lxml_5etree__unregister_xslt_function(void *__pyx_v_ctxt,PyObject *__pyx_v_name_utf,PyObject *__pyx_v_ns_utf) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_ns_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":219
 * 
 * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:             # <<<<<<<<<<<<<< 
 *         return 0
 *     return xslt.xsltRegisterExtFunction(
 */
__pyx_1 = (__pyx_v_ns_utf == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":220
 * cdef int _unregister_xslt_function(void* ctxt, name_utf, ns_utf):
 *     if ns_utf is None:
 *         return 0             # <<<<<<<<<<<<<< 
 *     return xslt.xsltRegisterExtFunction(
 *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":223
 *     return xslt.xsltRegisterExtFunction(
 *         <xslt.xsltTransformContext*>ctxt, _cstr(name_utf), _cstr(ns_utf),
 *         NULL)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_r = xsltRegisterExtFunction(((xsltTransformContext *)__pyx_v_ctxt),_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),NULL);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_ns_utf);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":228
 * cdef class _XSLTContext(_BaseContext):
 *     cdef xslt.xsltTransformContext* _xsltCtxt
 *     def __init__(self, namespaces, extensions, enable_regexp):             # <<<<<<<<<<<<<< 
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 */

static PyObject *__pyx_k685p;

static char __pyx_k685[] = "extensions must not have empty namespaces";

static int __pyx_pf_4lxml_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_enable_regexp = 0;
PyObject *__pyx_v_ns;
PyObject *__pyx_v_prefix;
int __pyx_r;
int __pyx_1;
Py_ssize_t __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions","enable_regexp",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_enable_regexp))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":229
 *     cdef xslt.xsltTransformContext* _xsltCtxt
 *     def __init__(self, namespaces, extensions, enable_regexp):
 *         self._xsltCtxt = NULL             # <<<<<<<<<<<<<< 
 *         if extensions is not None:
 *             for ns, prefix in extensions:
 */
((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_v_self)->_xsltCtxt = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":230
 *     def __init__(self, namespaces, extensions, enable_regexp):
 *         self._xsltCtxt = NULL
 *         if extensions is not None:             # <<<<<<<<<<<<<< 
 *             for ns, prefix in extensions:
 *                 if ns is None:
 */
__pyx_1 = (__pyx_v_extensions != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
  if (PyList_CheckExact(__pyx_v_extensions)) { __pyx_2 = 0; __pyx_3 = __pyx_v_extensions; Py_INCREF(__pyx_3); }
  else { __pyx_3 = PyObject_GetIter(__pyx_v_extensions); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; goto __pyx_L1;} }
  for (;;) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
    if (PyList_CheckExact(__pyx_3)) { if (__pyx_2 >= PyList_GET_SIZE(__pyx_3)) break; __pyx_4 = PyList_GET_ITEM(__pyx_3, __pyx_2++); Py_INCREF(__pyx_4); }
    else {
      __pyx_4 = PyIter_Next(__pyx_3);
      if (!__pyx_4) {
        break;
      }
    }
    if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
      Py_DECREF(__pyx_v_ns);
      __pyx_v_ns = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1);
      Py_INCREF(__pyx_6);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_6;
      __pyx_6 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
    }
    else {
      __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
      Py_DECREF(__pyx_v_ns);
      __pyx_v_ns = __pyx_6;
      __pyx_6 = 0;
      __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":231
 *         self._xsltCtxt = NULL
 *         if extensions is not None:
 *             for ns, prefix in extensions:             # <<<<<<<<<<<<<< 
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 */
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_6;
      __pyx_6 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 231; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":232
 *         if extensions is not None:
 *             for ns, prefix in extensions:
 *                 if ns is None:             # <<<<<<<<<<<<<< 
 *                     raise XSLTExtensionError, \
 *                           "extensions must not have empty namespaces"
 */
    __pyx_1 = (__pyx_v_ns == Py_None);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":233
 *             for ns, prefix in extensions:
 *                 if ns is None:
 *                     raise XSLTExtensionError, \             # <<<<<<<<<<<<<< 
 *                           "extensions must not have empty namespaces"
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 */
      __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTExtensionError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 233; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":234
 *                 if ns is None:
 *                     raise XSLTExtensionError, \
 *                           "extensions must not have empty namespaces"             # <<<<<<<<<<<<<< 
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 * 
 */
      __Pyx_Raise(__pyx_6, __pyx_k685p, 0);
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      {__pyx_filename = __pyx_f[14]; __pyx_lineno = 233; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":235
 *                     raise XSLTExtensionError, \
 *                           "extensions must not have empty namespaces"
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,
 */
__pyx_4 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__BaseContext), __pyx_n___init__); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 235; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":235
 *                     raise XSLTExtensionError, \
 *                           "extensions must not have empty namespaces"
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)             # <<<<<<<<<<<<<< 
 * 
 *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,
 */
__pyx_5 = PyTuple_New(4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 235; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_5, 2, __pyx_v_extensions);
Py_INCREF(__pyx_v_enable_regexp);
PyTuple_SET_ITEM(__pyx_5, 3, __pyx_v_enable_regexp);
__pyx_6 = PyObject_CallObject(__pyx_4, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 235; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree._XSLTContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_prefix);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_enable_regexp);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":237
 *         _BaseContext.__init__(self, namespaces, extensions, enable_regexp)
 * 
 *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,             # <<<<<<<<<<<<<< 
 *                                _Document doc):
 *         self._xsltCtxt = xsltCtxt
 */

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) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":239
 *     cdef register_context(self, xslt.xsltTransformContext* xsltCtxt,
 *                                _Document doc):
 *         self._xsltCtxt = xsltCtxt             # <<<<<<<<<<<<<< 
 *         self._set_xpath_context(xsltCtxt.xpathCtxt)
 *         self._register_context(doc)
 */
__pyx_v_self->_xsltCtxt = __pyx_v_xsltCtxt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":240
 *                                _Document doc):
 *         self._xsltCtxt = xsltCtxt
 *         self._set_xpath_context(xsltCtxt.xpathCtxt)             # <<<<<<<<<<<<<< 
 *         self._register_context(doc)
 *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":241
 *         self._xsltCtxt = xsltCtxt
 *         self._set_xpath_context(xsltCtxt.xpathCtxt)
 *         self._register_context(doc)             # <<<<<<<<<<<<<< 
 *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
 *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 241; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":242
 *         self._set_xpath_context(xsltCtxt.xpathCtxt)
 *         self._register_context(doc)
 *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)             # <<<<<<<<<<<<<< 
 *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
 * 
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":243
 *         self._register_context(doc)
 *         self.registerLocalFunctions(xsltCtxt, _register_xslt_function)
 *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)             # <<<<<<<<<<<<<< 
 * 
 *     cdef free_context(self):
 */
((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);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XSLTContext.register_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":245
 *         self.registerGlobalFunctions(xsltCtxt, _register_xslt_function)
 * 
 *     cdef free_context(self):             # <<<<<<<<<<<<<< 
 *         self._cleanup_context()
 *         self._release_context()
 */

static  PyObject *__pyx_f_4lxml_5etree_12_XSLTContext_free_context(struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":246
 * 
 *     cdef free_context(self):
 *         self._cleanup_context()             # <<<<<<<<<<<<<< 
 *         self._release_context()
 *         if self._xsltCtxt is not NULL:
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 246; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":247
 *     cdef free_context(self):
 *         self._cleanup_context()
 *         self._release_context()             # <<<<<<<<<<<<<< 
 *         if self._xsltCtxt is not NULL:
 *             xslt.xsltFreeTransformContext(self._xsltCtxt)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 247; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":248
 *         self._cleanup_context()
 *         self._release_context()
 *         if self._xsltCtxt is not NULL:             # <<<<<<<<<<<<<< 
 *             xslt.xsltFreeTransformContext(self._xsltCtxt)
 *             self._xsltCtxt = NULL
 */
__pyx_2 = (__pyx_v_self->_xsltCtxt != NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":249
 *         self._release_context()
 *         if self._xsltCtxt is not NULL:
 *             xslt.xsltFreeTransformContext(self._xsltCtxt)             # <<<<<<<<<<<<<< 
 *             self._xsltCtxt = NULL
 *         self._release_temp_refs()
 */
  xsltFreeTransformContext(__pyx_v_self->_xsltCtxt);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":250
 *         if self._xsltCtxt is not NULL:
 *             xslt.xsltFreeTransformContext(self._xsltCtxt)
 *             self._xsltCtxt = NULL             # <<<<<<<<<<<<<< 
 *         self._release_temp_refs()
 * 
 */
  __pyx_v_self->_xsltCtxt = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":251
 *             xslt.xsltFreeTransformContext(self._xsltCtxt)
 *             self._xsltCtxt = NULL
 *         self._release_temp_refs()             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 251; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XSLTContext.free_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":272
 *     cdef _ErrorLog _error_log
 * 
 *     def __init__(self, xslt_input, *, extensions=None, regexp=True,             # <<<<<<<<<<<<<< 
 *                  access_control=None):
 *         cdef xslt.xsltStylesheet* c_style
 */

static PyObject *__pyx_k686p;
static PyObject *__pyx_k687p;

static char __pyx_k686[] = "string://__STRING__XSLT__%s";
static char __pyx_k687[] = "Cannot parse stylesheet";

static int __pyx_pf_4lxml_5etree_4XSLT___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_4XSLT___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_xslt_input = 0;
PyObject *__pyx_v_extensions = 0;
PyObject *__pyx_v_regexp = 0;
PyObject *__pyx_v_access_control = 0;
xsltStylesheet *__pyx_v_c_style;
xmlDoc *__pyx_v_c_doc;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
PyObject *__pyx_v_doc_url_utf;
int __pyx_r;
PyObject *__pyx_1 = 0;
xmlDoc *__pyx_2;
int __pyx_3;
PyObject *__pyx_4 = 0;
xmlDoc *__pyx_5;
int __pyx_6;
PyObject *__pyx_7 = 0;
static char *__pyx_argnames[] = {"xslt_input","extensions","regexp","access_control",0};
__pyx_v_extensions = __pyx_k278;
__pyx_v_regexp = __pyx_k279;
__pyx_v_access_control = __pyx_k280;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, 0, 0) < 0) return -1;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_xslt_input, &__pyx_v_extensions, &__pyx_v_regexp, &__pyx_v_access_control))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  return -1;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_xslt_input);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
Py_INCREF(__pyx_v_access_control);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc_url_utf = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":279
 *         cdef _Element root_node
 * 
 *         doc = _documentOrRaise(xslt_input)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(xslt_input)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 279; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":280
 * 
 *         doc = _documentOrRaise(xslt_input)
 *         root_node = _rootNodeOrRaise(xslt_input)             # <<<<<<<<<<<<<< 
 * 
 *         # set access control or raise TypeError
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_xslt_input)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 280; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":283
 * 
 *         # set access control or raise TypeError
 *         self._access_control = access_control             # <<<<<<<<<<<<<< 
 * 
 *         # make a copy of the document as stylesheet parsing modifies it
 */
if (!__Pyx_TypeTest(__pyx_v_access_control, __pyx_ptype_4lxml_5etree_XSLTAccessControl)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 283; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":283
 * 
 *         # set access control or raise TypeError
 *         self._access_control = access_control             # <<<<<<<<<<<<<< 
 * 
 *         # make a copy of the document as stylesheet parsing modifies it
 */
Py_INCREF(__pyx_v_access_control);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control));
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)__pyx_v_access_control);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":286
 * 
 *         # make a copy of the document as stylesheet parsing modifies it
 *         c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 * 
 *         # make sure we always have a stylesheet URL
 */
__pyx_2 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 286; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":289
 * 
 *         # make sure we always have a stylesheet URL
 *         if c_doc.URL is NULL:             # <<<<<<<<<<<<<< 
 *             doc_url_utf = "string://__STRING__XSLT__%s" % id(self)
 *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
 */
__pyx_3 = (__pyx_v_c_doc->URL == NULL);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":290
 *         # make sure we always have a stylesheet URL
 *         if c_doc.URL is NULL:
 *             doc_url_utf = "string://__STRING__XSLT__%s" % id(self)             # <<<<<<<<<<<<<< 
 *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
 * 
 */
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 290; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
  __pyx_4 = PyObject_CallObject(__pyx_builtin_id, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 290; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyNumber_Remainder(__pyx_k686p, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 290; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_doc_url_utf);
  __pyx_v_doc_url_utf = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":291
 *         if c_doc.URL is NULL:
 *             doc_url_utf = "string://__STRING__XSLT__%s" % id(self)
 *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log = _ErrorLog()
 */
  __pyx_v_c_doc->URL = xmlStrdup(_cstr(__pyx_v_doc_url_utf));
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":293
 *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
 * 
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         self._xslt_resolver_context = _XSLTResolverContext()
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 */
__pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 293; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 293; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":293
 *             c_doc.URL = tree.xmlStrdup(_cstr(doc_url_utf))
 * 
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         self._xslt_resolver_context = _XSLTResolverContext()
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log));
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_4);
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":294
 * 
 *         self._error_log = _ErrorLog()
 *         self._xslt_resolver_context = _XSLTResolverContext()             # <<<<<<<<<<<<<< 
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResolverContext), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 294; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__XSLTResolverContext)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 294; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":294
 * 
 *         self._error_log = _ErrorLog()
 *         self._xslt_resolver_context = _XSLTResolverContext()             # <<<<<<<<<<<<<< 
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context));
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":295
 *         self._error_log = _ErrorLog()
 *         self._xslt_resolver_context = _XSLTResolverContext()
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)             # <<<<<<<<<<<<<< 
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)
 */
__pyx_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_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 295; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":297
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)             # <<<<<<<<<<<<<< 
 *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
 * 
 */
__pyx_5 = __pyx_f_4lxml_5etree__copyDoc(__pyx_v_c_doc,1); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 297; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":297
 *         _initXSLTResolverContext(self._xslt_resolver_context, doc._parser)
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)             # <<<<<<<<<<<<<< 
 *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
 * 
 */
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc = __pyx_5;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":298
 *         # keep a copy in case we need to access the stylesheet via 'document()'
 *         self._xslt_resolver_context._c_style_doc = _copyDoc(c_doc, 1)
 *         c_doc._private = <python.PyObject*>self._xslt_resolver_context             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
__pyx_v_c_doc->_private = ((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":300
 *         c_doc._private = <python.PyObject*>self._xslt_resolver_context
 * 
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":301
 * 
 *         self._error_log.connect()
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
 *         self._error_log.disconnect()
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":302
 *         self._error_log.connect()
 *         with nogil:
 *             c_style = xslt.xsltParseStylesheetDoc(c_doc)             # <<<<<<<<<<<<<< 
 *         self._error_log.disconnect()
 * 
 */
    __pyx_v_c_style = xsltParseStylesheetDoc(__pyx_v_c_doc);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":303
 *         with nogil:
 *             c_style = xslt.xsltParseStylesheetDoc(c_doc)
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 * 
 *         if c_style is NULL:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":305
 *         self._error_log.disconnect()
 * 
 *         if c_style is NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeDoc(c_doc)
 *             self._xslt_resolver_context._raise_if_stored()
 */
__pyx_3 = (__pyx_v_c_style == NULL);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":306
 * 
 *         if c_style is NULL:
 *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<< 
 *             self._xslt_resolver_context._raise_if_stored()
 *             # last error seems to be the most accurate here
 */
  xmlFreeDoc(__pyx_v_c_doc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":307
 *         if c_style is NULL:
 *             tree.xmlFreeDoc(c_doc)
 *             self._xslt_resolver_context._raise_if_stored()             # <<<<<<<<<<<<<< 
 *             # last error seems to be the most accurate here
 *             if self._error_log.last_error is not None and \
 */
  __pyx_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_6 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 307; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":309
 *             self._xslt_resolver_context._raise_if_stored()
 *             # last error seems to be the most accurate here
 *             if self._error_log.last_error is not None and \             # <<<<<<<<<<<<<< 
 *                     self._error_log.last_error.message:
 *                 raise XSLTParseError(self._error_log.last_error.message)
 */
  __pyx_3 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error != Py_None);
  __pyx_1 = __Pyx_PyBool_FromLong(__pyx_3); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 309; goto __pyx_L1;}
  __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 309; goto __pyx_L1;}
  if (__pyx_3) {
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":310
 *             # last error seems to be the most accurate here
 *             if self._error_log.last_error is not None and \
 *                     self._error_log.last_error.message:             # <<<<<<<<<<<<<< 
 *                 raise XSLTParseError(self._error_log.last_error.message)
 *             else:
 */
    __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 310; goto __pyx_L1;}
  }
  __pyx_3 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 309; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_3) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":311
 *             if self._error_log.last_error is not None and \
 *                     self._error_log.last_error.message:
 *                 raise XSLTParseError(self._error_log.last_error.message)             # <<<<<<<<<<<<<< 
 *             else:
 *                 raise XSLTParseError(
 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":311
 *             if self._error_log.last_error is not None and \
 *                     self._error_log.last_error.message:
 *                 raise XSLTParseError(self._error_log.last_error.message)             # <<<<<<<<<<<<<< 
 *             else:
 *                 raise XSLTParseError(
 */
    __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_message); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; goto __pyx_L1;}
    __pyx_7 = PyTuple_New(1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_7, 0, __pyx_1);
    __pyx_1 = 0;
    __pyx_1 = PyObject_CallObject(__pyx_4, __pyx_7); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    __Pyx_Raise(__pyx_1, 0, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 311; goto __pyx_L1;}
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":313
 *                 raise XSLTParseError(self._error_log.last_error.message)
 *             else:
 *                 raise XSLTParseError(             # <<<<<<<<<<<<<< 
 *                     self._error_log._buildExceptionMessage(
 *                         "Cannot parse stylesheet"))
 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 313; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":315
 *                 raise XSLTParseError(
 *                     self._error_log._buildExceptionMessage(
 *                         "Cannot parse stylesheet"))             # <<<<<<<<<<<<<< 
 * 
 *         c_doc._private = NULL # no longer used!
 */
    __pyx_7 = ((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),__pyx_k687p); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 314; goto __pyx_L1;}
    __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 313; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_7);
    __pyx_7 = 0;
    __pyx_7 = PyObject_CallObject(__pyx_4, __pyx_1); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 313; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_Raise(__pyx_7, 0, 0);
    Py_DECREF(__pyx_7); __pyx_7 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 313; goto __pyx_L1;}
  }
  __pyx_L7:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":317
 *                         "Cannot parse stylesheet"))
 * 
 *         c_doc._private = NULL # no longer used!             # <<<<<<<<<<<<<< 
 *         self._c_style = c_style
 *         self._context = _XSLTContext(None, extensions, regexp)
 */
__pyx_v_c_doc->_private = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":318
 * 
 *         c_doc._private = NULL # no longer used!
 *         self._c_style = c_style             # <<<<<<<<<<<<<< 
 *         self._context = _XSLTContext(None, extensions, regexp)
 * 
 */
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style = __pyx_v_c_style;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":319
 *         c_doc._private = NULL # no longer used!
 *         self._c_style = c_style
 *         self._context = _XSLTContext(None, extensions, regexp)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_4 = PyTuple_New(3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 319; goto __pyx_L1;}
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_4, 0, Py_None);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_extensions);
Py_INCREF(__pyx_v_regexp);
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_v_regexp);
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__XSLTContext), __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 319; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__XSLTContext)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 319; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":319
 *         c_doc._private = NULL # no longer used!
 *         self._c_style = c_style
 *         self._context = _XSLTContext(None, extensions, regexp)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context));
((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_1);
__pyx_1 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.XSLT.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF(__pyx_v_doc_url_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_xslt_input);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_regexp);
Py_DECREF(__pyx_v_access_control);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":321
 *         self._context = _XSLTContext(None, extensions, regexp)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         if self._xslt_resolver_context is not None and \
 *                self._xslt_resolver_context._c_style_doc is not NULL:
 */

static void __pyx_pf_4lxml_5etree_4XSLT___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_4XSLT___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":322
 * 
 *     def __dealloc__(self):
 *         if self._xslt_resolver_context is not None and \             # <<<<<<<<<<<<<< 
 *                self._xslt_resolver_context._c_style_doc is not NULL:
 *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":323
 *     def __dealloc__(self):
 *         if self._xslt_resolver_context is not None and \
 *                self._xslt_resolver_context._c_style_doc is not NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
 *         # this cleans up the doc copy as well
 */
  __pyx_1 = (((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc != NULL);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":324
 *         if self._xslt_resolver_context is not None and \
 *                self._xslt_resolver_context._c_style_doc is not NULL:
 *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)             # <<<<<<<<<<<<<< 
 *         # this cleans up the doc copy as well
 *         xslt.xsltFreeStylesheet(self._c_style)
 */
  xmlFreeDoc(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":326
 *             tree.xmlFreeDoc(self._xslt_resolver_context._c_style_doc)
 *         # this cleans up the doc copy as well
 *         xslt.xsltFreeStylesheet(self._c_style)             # <<<<<<<<<<<<<< 
 * 
 *     property error_log:
 */
xsltFreeStylesheet(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style);

Py_DECREF(__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":329
 * 
 *     property error_log:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return self._error_log.copy()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":330
 *     property error_log:
 *         def __get__(self):
 *             return self._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 330; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 330; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.XSLT.error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":332
 *             return self._error_log.copy()
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):             # <<<<<<<<<<<<<< 
 *         return self(_input, profile_run=profile_run, **_kw)
 * 
 */

static PyObject *__pyx_n_profile_run;


static PyObject *__pyx_pf_4lxml_5etree_4XSLT_apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_4XSLT_apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__input = 0;
PyObject *__pyx_v_profile_run = 0;
PyObject *__pyx_v__kw = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"_input","profile_run",0};
__pyx_v_profile_run = __pyx_k281;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__kw, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v__input, &__pyx_v_profile_run))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__kw);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__input);
Py_INCREF(__pyx_v_profile_run);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":333
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):
 *         return self(_input, profile_run=profile_run, **_kw)             # <<<<<<<<<<<<<< 
 * 
 *     def tostring(self, _ElementTree result_tree):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 333; goto __pyx_L1;}
Py_INCREF(__pyx_v__input);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__input);
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 333; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":333
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):
 *         return self(_input, profile_run=profile_run, **_kw)             # <<<<<<<<<<<<<< 
 * 
 *     def tostring(self, _ElementTree result_tree):
 */
if (PyDict_SetItem(__pyx_2, __pyx_n_profile_run, __pyx_v_profile_run) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 333; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":333
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):
 *         return self(_input, profile_run=profile_run, **_kw)             # <<<<<<<<<<<<<< 
 * 
 *     def tostring(self, _ElementTree result_tree):
 */
if (PyDict_Update(__pyx_2, __pyx_v__kw) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 333; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_v_self, __pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 333; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_r = __pyx_3;
__pyx_3 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XSLT.apply");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__kw);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__input);
Py_DECREF(__pyx_v_profile_run);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":335
 *         return self(_input, profile_run=profile_run, **_kw)
 * 
 *     def tostring(self, _ElementTree result_tree):             # <<<<<<<<<<<<<< 
 *         """Save result doc to string based on stylesheet output method.
 *         """
 */

static PyObject *__pyx_pf_4lxml_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_v_result_tree); /*proto*/
static char __pyx_doc_4lxml_5etree_4XSLT_tostring[] = "Save result doc to string based on stylesheet output method.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_v_result_tree) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_result_tree);
if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result_tree), __pyx_ptype_4lxml_5etree__ElementTree, 1, "result_tree"))) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 335; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":338
 *         """Save result doc to string based on stylesheet output method.
 *         """
 *         return str(result_tree)             # <<<<<<<<<<<<<< 
 * 
 *     def __deepcopy__(self, memo):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 338; goto __pyx_L1;}
Py_INCREF(__pyx_v_result_tree);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_result_tree);
__pyx_2 = PyObject_CallObject(((PyObject*)&PyString_Type), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 338; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.XSLT.tostring");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_result_tree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":340
 *         return str(result_tree)
 * 
 *     def __deepcopy__(self, memo):             # <<<<<<<<<<<<<< 
 *         return self.__copy__()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_4XSLT___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_4XSLT___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_v_memo) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_memo);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":341
 * 
 *     def __deepcopy__(self, memo):
 *         return self.__copy__()             # <<<<<<<<<<<<<< 
 * 
 *     def __copy__(self):
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___copy__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 341; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 341; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.XSLT.__deepcopy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_memo);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":343
 *         return self.__copy__()
 * 
 *     def __copy__(self):             # <<<<<<<<<<<<<< 
 *         cdef XSLT new_xslt
 *         cdef xmlDoc* c_doc
 */

static PyObject *__pyx_pf_4lxml_5etree_4XSLT___copy__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_4XSLT___copy__(PyObject *__pyx_v_self, PyObject *unused) {
struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_new_xslt;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
xmlDoc *__pyx_2;
int __pyx_3;
Py_INCREF(__pyx_v_self);
__pyx_v_new_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":346
 *         cdef XSLT new_xslt
 *         cdef xmlDoc* c_doc
 *         new_xslt = NEW_XSLT(XSLT)             # <<<<<<<<<<<<<< 
 *         new_xslt._access_control = self._access_control
 *         new_xslt._error_log = _ErrorLog()
 */
__pyx_1 = ((PyObject *)PY_NEW(((PyObject*)__pyx_ptype_4lxml_5etree_XSLT))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 346; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_new_xslt));
__pyx_v_new_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":347
 *         cdef xmlDoc* c_doc
 *         new_xslt = NEW_XSLT(XSLT)
 *         new_xslt._access_control = self._access_control             # <<<<<<<<<<<<<< 
 *         new_xslt._error_log = _ErrorLog()
 *         new_xslt._context = self._context._copy()
 */
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control));
Py_DECREF(((PyObject *)__pyx_v_new_xslt->_access_control));
__pyx_v_new_xslt->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_access_control;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":348
 *         new_xslt = NEW_XSLT(XSLT)
 *         new_xslt._access_control = self._access_control
 *         new_xslt._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         new_xslt._context = self._context._copy()
 * 
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 348; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 348; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":348
 *         new_xslt = NEW_XSLT(XSLT)
 *         new_xslt._access_control = self._access_control
 *         new_xslt._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 *         new_xslt._context = self._context._copy()
 * 
 */
Py_DECREF(((PyObject *)__pyx_v_new_xslt->_error_log));
__pyx_v_new_xslt->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":349
 *         new_xslt._access_control = self._access_control
 *         new_xslt._error_log = _ErrorLog()
 *         new_xslt._context = self._context._copy()             # <<<<<<<<<<<<<< 
 * 
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 349; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__XSLTContext)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 349; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":349
 *         new_xslt._access_control = self._access_control
 *         new_xslt._error_log = _ErrorLog()
 *         new_xslt._context = self._context._copy()             # <<<<<<<<<<<<<< 
 * 
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()
 */
Py_DECREF(((PyObject *)__pyx_v_new_xslt->_context));
__pyx_v_new_xslt->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":351
 *         new_xslt._context = self._context._copy()
 * 
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()             # <<<<<<<<<<<<<< 
 *         new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
 *             self._xslt_resolver_context._c_style_doc, 1)
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 351; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":351
 *         new_xslt._context = self._context._copy()
 * 
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()             # <<<<<<<<<<<<<< 
 *         new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
 *             self._xslt_resolver_context._c_style_doc, 1)
 */
Py_DECREF(((PyObject *)__pyx_v_new_xslt->_xslt_resolver_context));
__pyx_v_new_xslt->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":353
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()
 *         new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(
 *             self._xslt_resolver_context._c_style_doc, 1)             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _copyDoc(self._c_style.doc, 1)
 */
__pyx_2 = __pyx_f_4lxml_5etree__copyDoc(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc,1); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 352; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":352
 * 
 *         new_xslt._xslt_resolver_context = self._xslt_resolver_context._copy()
 *         new_xslt._xslt_resolver_context._c_style_doc = _copyDoc(             # <<<<<<<<<<<<<< 
 *             self._xslt_resolver_context._c_style_doc, 1)
 * 
 */
__pyx_v_new_xslt->_xslt_resolver_context->_c_style_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":355
 *             self._xslt_resolver_context._c_style_doc, 1)
 * 
 *         c_doc = _copyDoc(self._c_style.doc, 1)             # <<<<<<<<<<<<<< 
 *         new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
 *         if new_xslt._c_style is NULL:
 */
__pyx_2 = __pyx_f_4lxml_5etree__copyDoc(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc,1); if (unlikely(__pyx_2 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 355; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_2;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":356
 * 
 *         c_doc = _copyDoc(self._c_style.doc, 1)
 *         new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)             # <<<<<<<<<<<<<< 
 *         if new_xslt._c_style is NULL:
 *             tree.xmlFreeDoc(c_doc)
 */
__pyx_v_new_xslt->_c_style = xsltParseStylesheetDoc(__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":357
 *         c_doc = _copyDoc(self._c_style.doc, 1)
 *         new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
 *         if new_xslt._c_style is NULL:             # <<<<<<<<<<<<<< 
 *             tree.xmlFreeDoc(c_doc)
 *             python.PyErr_NoMemory()
 */
__pyx_3 = (__pyx_v_new_xslt->_c_style == NULL);
if (__pyx_3) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":358
 *         new_xslt._c_style = xslt.xsltParseStylesheetDoc(c_doc)
 *         if new_xslt._c_style is NULL:
 *             tree.xmlFreeDoc(c_doc)             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 * 
 */
  xmlFreeDoc(__pyx_v_c_doc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":359
 *         if new_xslt._c_style is NULL:
 *             tree.xmlFreeDoc(c_doc)
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 * 
 *         return new_xslt
 */
  __pyx_1 = PyErr_NoMemory(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 359; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":361
 *             python.PyErr_NoMemory()
 * 
 *         return new_xslt             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, _input, *, profile_run=False, **_kw):
 */
Py_INCREF(((PyObject *)__pyx_v_new_xslt));
__pyx_r = ((PyObject *)__pyx_v_new_xslt);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XSLT.__copy__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_new_xslt);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":363
 *         return new_xslt
 * 
 *     def __call__(self, _input, *, profile_run=False, **_kw):             # <<<<<<<<<<<<<< 
 *         cdef _XSLTContext context
 *         cdef _XSLTResolverContext resolver_context
 */

static PyObject *__pyx_n_RuntimeError;
static PyObject *__pyx_n_line;

static PyObject *__pyx_k689p;
static PyObject *__pyx_k690p;
static PyObject *__pyx_k691p;
static PyObject *__pyx_k692p;

static PyObject *__pyx_builtin_RuntimeError;

static char __pyx_k689[] = "stylesheet is not usable in this thread";
static char __pyx_k690[] = "%s, line %d";
static char __pyx_k691[] = "Error applying stylesheet, line %d";
static char __pyx_k692[] = "Error applying stylesheet";

static PyObject *__pyx_pf_4lxml_5etree_4XSLT___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_4XSLT___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__input = 0;
PyObject *__pyx_v_profile_run = 0;
PyObject *__pyx_v__kw = 0;
struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context;
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *__pyx_v_resolver_context;
struct LxmlDocument *__pyx_v_input_doc;
struct LxmlElement *__pyx_v_root_node;
struct LxmlDocument *__pyx_v_result_doc;
struct LxmlDocument *__pyx_v_profile_doc;
xmlDoc *__pyx_v_c_profile_doc;
xsltTransformContext *__pyx_v_transform_ctxt;
xmlDoc *__pyx_v_c_result;
xmlDoc *__pyx_v_c_doc;
PyObject *__pyx_v_error;
PyObject *__pyx_v_message;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc *__pyx_3;
int __pyx_4;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
static char *__pyx_argnames[] = {"_input","profile_run",0};
__pyx_v_profile_run = __pyx_k282;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__kw, 0) < 0) return NULL;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v__input, &__pyx_v_profile_run))) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v__kw);
  return NULL;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__input);
Py_INCREF(__pyx_v_profile_run);
__pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_input_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_profile_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_error = Py_None; Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":375
 *         cdef xmlDoc* c_doc
 * 
 *         if not _checkThreadDict(self._c_style.doc.dict):             # <<<<<<<<<<<<<< 
 *             raise RuntimeError, "stylesheet is not usable in this thread"
 * 
 */
__pyx_1 = (!__pyx_f_4lxml_5etree__checkThreadDict(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict));
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":376
 * 
 *         if not _checkThreadDict(self._c_style.doc.dict):
 *             raise RuntimeError, "stylesheet is not usable in this thread"             # <<<<<<<<<<<<<< 
 * 
 *         input_doc = _documentOrRaise(_input)
 */
  __Pyx_Raise(__pyx_builtin_RuntimeError, __pyx_k689p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 376; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":378
 *             raise RuntimeError, "stylesheet is not usable in this thread"
 * 
 *         input_doc = _documentOrRaise(_input)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(_input)
 * 
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v__input)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 378; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_input_doc));
__pyx_v_input_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":379
 * 
 *         input_doc = _documentOrRaise(_input)
 *         root_node = _rootNodeOrRaise(_input)             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v__input)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 379; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":381
 *         root_node = _rootNodeOrRaise(_input)
 * 
 *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 * 
 *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
 */
__pyx_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 381; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":383
 *         c_doc = _fakeRootDoc(input_doc._c_doc, root_node._c_node)
 * 
 *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)             # <<<<<<<<<<<<<< 
 *         if transform_ctxt is NULL:
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 */
__pyx_v_transform_ctxt = xsltNewTransformContext(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_c_style,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":384
 * 
 *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
 *         if transform_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 *             python.PyErr_NoMemory()
 */
__pyx_1 = (__pyx_v_transform_ctxt == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":385
 *         transform_ctxt = xslt.xsltNewTransformContext(self._c_style, c_doc)
 *         if transform_ctxt is NULL:
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 * 
 */
  __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc,__pyx_v_c_doc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":386
 *         if transform_ctxt is NULL:
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 * 
 *         initTransformDict(transform_ctxt)
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 386; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":388
 *             python.PyErr_NoMemory()
 * 
 *         initTransformDict(transform_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         if profile_run:
 */
__pyx_f_4lxml_5etree_initTransformDict(__pyx_v_transform_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":390
 *         initTransformDict(transform_ctxt)
 * 
 *         if profile_run:             # <<<<<<<<<<<<<< 
 *             transform_ctxt.profile = 1
 * 
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_profile_run); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 390; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":391
 * 
 *         if profile_run:
 *             transform_ctxt.profile = 1             # <<<<<<<<<<<<<< 
 * 
 *         try:
 */
  __pyx_v_transform_ctxt->profile = 1;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":393
 *             transform_ctxt.profile = 1
 * 
 *         try:             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             context = self._context._copy()
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":394
 * 
 *         try:
 *             self._error_log.connect()             # <<<<<<<<<<<<<< 
 *             context = self._context._copy()
 *             context.register_context(transform_ctxt, input_doc)
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":395
 *         try:
 *             self._error_log.connect()
 *             context = self._context._copy()             # <<<<<<<<<<<<<< 
 *             context.register_context(transform_ctxt, input_doc)
 * 
 */
  __pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 395; goto __pyx_L6;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__XSLTContext)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 395; goto __pyx_L6;}
  Py_DECREF(((PyObject *)__pyx_v_context));
  __pyx_v_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":396
 *             self._error_log.connect()
 *             context = self._context._copy()
 *             context.register_context(transform_ctxt, input_doc)             # <<<<<<<<<<<<<< 
 * 
 *             resolver_context = self._xslt_resolver_context._copy()
 */
  __pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 396; goto __pyx_L6;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":398
 *             context.register_context(transform_ctxt, input_doc)
 * 
 *             resolver_context = self._xslt_resolver_context._copy()             # <<<<<<<<<<<<<< 
 *             transform_ctxt._private = <python.PyObject*>resolver_context
 * 
 */
  __pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 398; goto __pyx_L6;}
  Py_DECREF(((PyObject *)__pyx_v_resolver_context));
  __pyx_v_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":399
 * 
 *             resolver_context = self._xslt_resolver_context._copy()
 *             transform_ctxt._private = <python.PyObject*>resolver_context             # <<<<<<<<<<<<<< 
 * 
 *             c_result = self._run_transform(
 */
  __pyx_v_transform_ctxt->_private = ((PyObject *)__pyx_v_resolver_context);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":402
 * 
 *             c_result = self._run_transform(
 *                 input_doc, c_doc, _kw, context, transform_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *             if transform_ctxt.profile:
 */
  __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_input_doc,__pyx_v_c_doc,__pyx_v__kw,__pyx_v_context,__pyx_v_transform_ctxt);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":404
 *                 input_doc, c_doc, _kw, context, transform_ctxt)
 * 
 *             if transform_ctxt.profile:             # <<<<<<<<<<<<<< 
 *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)
 *                 if c_profile_doc is not NULL:
 */
  __pyx_4 = __pyx_v_transform_ctxt->profile;
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":405
 * 
 *             if transform_ctxt.profile:
 *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)             # <<<<<<<<<<<<<< 
 *                 if c_profile_doc is not NULL:
 *                     profile_doc = _documentFactory(
 */
    __pyx_v_c_profile_doc = xsltGetProfileInformation(__pyx_v_transform_ctxt);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":406
 *             if transform_ctxt.profile:
 *                 c_profile_doc = xslt.xsltGetProfileInformation(transform_ctxt)
 *                 if c_profile_doc is not NULL:             # <<<<<<<<<<<<<< 
 *                     profile_doc = _documentFactory(
 *                         c_profile_doc, input_doc._parser)
 */
    __pyx_1 = (__pyx_v_c_profile_doc != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":408
 *                 if c_profile_doc is not NULL:
 *                     profile_doc = _documentFactory(
 *                         c_profile_doc, input_doc._parser)             # <<<<<<<<<<<<<< 
 *         finally:
 *             if context is not None:
 */
      __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_profile_doc,__pyx_v_input_doc->_parser)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 407; goto __pyx_L6;}
      Py_DECREF(((PyObject *)__pyx_v_profile_doc));
      __pyx_v_profile_doc = ((struct LxmlDocument *)__pyx_2);
      __pyx_2 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L7;
  __pyx_L6: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":410
 *                         c_profile_doc, input_doc._parser)
 *         finally:
 *             if context is not None:             # <<<<<<<<<<<<<< 
 *                 context.free_context()
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 */
  __pyx_1 = (((PyObject *)__pyx_v_context) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":411
 *         finally:
 *             if context is not None:
 *                 context.free_context()             # <<<<<<<<<<<<<< 
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 *             self._error_log.disconnect()
 */
    __pyx_2 = ((struct __pyx_vtabstruct_4lxml_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->free_context(__pyx_v_context); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 411; goto __pyx_L10;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":412
 *             if context is not None:
 *                 context.free_context()
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 *             self._error_log.disconnect()
 * 
 */
  __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc,__pyx_v_c_doc);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":413
 *                 context.free_context()
 *             _destroyFakeDoc(input_doc._c_doc, c_doc)
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 * 
 *         try:
 */
  ((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);
  goto __pyx_L12;
  __pyx_L10:;
  if (__pyx_why == 4) {
    Py_XDECREF(__pyx_exc_type);
    Py_XDECREF(__pyx_exc_value);
    Py_XDECREF(__pyx_exc_tb);
  }
  goto __pyx_L1;
  __pyx_L12:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":415
 *             self._error_log.disconnect()
 * 
 *         try:             # <<<<<<<<<<<<<< 
 *             if resolver_context is not None and resolver_context._has_raised():
 *                 if c_result is not NULL:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":416
 * 
 *         try:
 *             if resolver_context is not None and resolver_context._has_raised():             # <<<<<<<<<<<<<< 
 *                 if c_result is not NULL:
 *                     tree.xmlFreeDoc(c_result)
 */
  __pyx_1 = (((PyObject *)__pyx_v_resolver_context) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":416
 * 
 *         try:
 *             if resolver_context is not None and resolver_context._has_raised():             # <<<<<<<<<<<<<< 
 *                 if c_result is not NULL:
 *                     tree.xmlFreeDoc(c_result)
 */
    __pyx_1 = ((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));
  }
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":417
 *         try:
 *             if resolver_context is not None and resolver_context._has_raised():
 *                 if c_result is not NULL:             # <<<<<<<<<<<<<< 
 *                     tree.xmlFreeDoc(c_result)
 *                 resolver_context._raise_if_stored()
 */
    __pyx_1 = (__pyx_v_c_result != NULL);
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":418
 *             if resolver_context is not None and resolver_context._has_raised():
 *                 if c_result is not NULL:
 *                     tree.xmlFreeDoc(c_result)             # <<<<<<<<<<<<<< 
 *                 resolver_context._raise_if_stored()
 * 
 */
      xmlFreeDoc(__pyx_v_c_result);
      goto __pyx_L17;
    }
    __pyx_L17:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":419
 *                 if c_result is not NULL:
 *                     tree.xmlFreeDoc(c_result)
 *                 resolver_context._raise_if_stored()             # <<<<<<<<<<<<<< 
 * 
 *             if c_result is NULL:
 */
    __pyx_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_4 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 419; goto __pyx_L14;}
    goto __pyx_L16;
  }
  __pyx_L16:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":421
 *                 resolver_context._raise_if_stored()
 * 
 *             if c_result is NULL:             # <<<<<<<<<<<<<< 
 *                 # last error seems to be the most accurate here
 *                 error = self._error_log.last_error
 */
  __pyx_1 = (__pyx_v_c_result == NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":423
 *             if c_result is NULL:
 *                 # last error seems to be the most accurate here
 *                 error = self._error_log.last_error             # <<<<<<<<<<<<<< 
 *                 if error is not None and error.message:
 *                     if error.line >= 0:
 */
    Py_INCREF(((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error);
    Py_DECREF(__pyx_v_error);
    __pyx_v_error = ((struct __pyx_obj_4lxml_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":424
 *                 # last error seems to be the most accurate here
 *                 error = self._error_log.last_error
 *                 if error is not None and error.message:             # <<<<<<<<<<<<<< 
 *                     if error.line >= 0:
 *                         message = "%s, line %d" % (error.message, error.line)
 */
    __pyx_1 = (__pyx_v_error != Py_None);
    __pyx_2 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 424; goto __pyx_L14;}
    __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 424; goto __pyx_L14;}
    if (__pyx_1) {
      Py_DECREF(__pyx_2); __pyx_2 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":424
 *                 # last error seems to be the most accurate here
 *                 error = self._error_log.last_error
 *                 if error is not None and error.message:             # <<<<<<<<<<<<<< 
 *                     if error.line >= 0:
 *                         message = "%s, line %d" % (error.message, error.line)
 */
      __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 424; goto __pyx_L14;}
    }
    __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 424; goto __pyx_L14;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":425
 *                 error = self._error_log.last_error
 *                 if error is not None and error.message:
 *                     if error.line >= 0:             # <<<<<<<<<<<<<< 
 *                         message = "%s, line %d" % (error.message, error.line)
 *                     else:
 */
      __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 425; goto __pyx_L14;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":425
 *                 error = self._error_log.last_error
 *                 if error is not None and error.message:
 *                     if error.line >= 0:             # <<<<<<<<<<<<<< 
 *                         message = "%s, line %d" % (error.message, error.line)
 *                     else:
 */
      __pyx_5 = PyObject_RichCompare(__pyx_2, __pyx_num_0, Py_GE); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 425; goto __pyx_L14;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 425; goto __pyx_L14;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      if (__pyx_1) {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":426
 *                 if error is not None and error.message:
 *                     if error.line >= 0:
 *                         message = "%s, line %d" % (error.message, error.line)             # <<<<<<<<<<<<<< 
 *                     else:
 *                         message = error.message
 */
        __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 426; goto __pyx_L14;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":426
 *                 if error is not None and error.message:
 *                     if error.line >= 0:
 *                         message = "%s, line %d" % (error.message, error.line)             # <<<<<<<<<<<<<< 
 *                     else:
 *                         message = error.message
 */
        __pyx_5 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 426; goto __pyx_L14;}
        __pyx_6 = PyTuple_New(2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 426; goto __pyx_L14;}
        PyTuple_SET_ITEM(__pyx_6, 0, __pyx_2);
        PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
        __pyx_2 = 0;
        __pyx_5 = 0;
        __pyx_2 = PyNumber_Remainder(__pyx_k690p, __pyx_6); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 426; goto __pyx_L14;}
        Py_DECREF(__pyx_6); __pyx_6 = 0;
        Py_DECREF(__pyx_v_message);
        __pyx_v_message = __pyx_2;
        __pyx_2 = 0;
        goto __pyx_L20;
      }
      /*else*/ {

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":428
 *                         message = "%s, line %d" % (error.message, error.line)
 *                     else:
 *                         message = error.message             # <<<<<<<<<<<<<< 
 *                 elif error is not None and error.line >= 0:
 *                     message = "Error applying stylesheet, line %d" % error.line
 */
        __pyx_5 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 428; goto __pyx_L14;}
        Py_DECREF(__pyx_v_message);
        __pyx_v_message = __pyx_5;
        __pyx_5 = 0;
      }
      __pyx_L20:;
      goto __pyx_L19;
    }

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":429
 *                     else:
 *                         message = error.message
 *                 elif error is not None and error.line >= 0:             # <<<<<<<<<<<<<< 
 *                     message = "Error applying stylesheet, line %d" % error.line
 *                 else:
 */
    __pyx_1 = (__pyx_v_error != Py_None);
    __pyx_6 = __Pyx_PyBool_FromLong(__pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 429; goto __pyx_L14;}
    __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 429; goto __pyx_L14;}
    if (__pyx_1) {
      Py_DECREF(__pyx_6); __pyx_6 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":429
 *                     else:
 *                         message = error.message
 *                 elif error is not None and error.line >= 0:             # <<<<<<<<<<<<<< 
 *                     message = "Error applying stylesheet, line %d" % error.line
 *                 else:
 */
      __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 429; goto __pyx_L14;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":429
 *                     else:
 *                         message = error.message
 *                 elif error is not None and error.line >= 0:             # <<<<<<<<<<<<<< 
 *                     message = "Error applying stylesheet, line %d" % error.line
 *                 else:
 */
      __pyx_6 = PyObject_RichCompare(__pyx_2, __pyx_num_0, Py_GE); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 429; goto __pyx_L14;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
    }
    __pyx_1 = __Pyx_PyObject_IsTrue(__pyx_6); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 429; goto __pyx_L14;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    if (__pyx_1) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":430
 *                         message = error.message
 *                 elif error is not None and error.line >= 0:
 *                     message = "Error applying stylesheet, line %d" % error.line             # <<<<<<<<<<<<<< 
 *                 else:
 *                     message = "Error applying stylesheet"
 */
      __pyx_5 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 430; goto __pyx_L14;}
      __pyx_2 = PyNumber_Remainder(__pyx_k691p, __pyx_5); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 430; goto __pyx_L14;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L19;
    }
    /*else*/ {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":432
 *                     message = "Error applying stylesheet, line %d" % error.line
 *                 else:
 *                     message = "Error applying stylesheet"             # <<<<<<<<<<<<<< 
 *                 raise XSLTApplyError, message
 *         finally:
 */
      Py_INCREF(__pyx_k692p);
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_k692p;
    }
    __pyx_L19:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":433
 *                 else:
 *                     message = "Error applying stylesheet"
 *                 raise XSLTApplyError, message             # <<<<<<<<<<<<<< 
 *         finally:
 *             if resolver_context is not None:
 */
    __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTApplyError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 433; goto __pyx_L14;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":433
 *                 else:
 *                     message = "Error applying stylesheet"
 *                 raise XSLTApplyError, message             # <<<<<<<<<<<<<< 
 *         finally:
 *             if resolver_context is not None:
 */
    __Pyx_Raise(__pyx_6, __pyx_v_message, 0);
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 433; goto __pyx_L14;}
    goto __pyx_L18;
  }
  __pyx_L18:;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L15;
  __pyx_L14: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_5); __pyx_5 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_6); __pyx_6 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":435
 *                 raise XSLTApplyError, message
 *         finally:
 *             if resolver_context is not None:             # <<<<<<<<<<<<<< 
 *                 resolver_context.clear()
 * 
 */
  __pyx_1 = (((PyObject *)__pyx_v_resolver_context) != Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":436
 *         finally:
 *             if resolver_context is not None:
 *                 resolver_context.clear()             # <<<<<<<<<<<<<< 
 * 
 *         result_doc = _documentFactory(c_result, input_doc._parser)
 */
    ((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));
    goto __pyx_L22;
  }
  __pyx_L22:;
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":438
 *                 resolver_context.clear()
 * 
 *         result_doc = _documentFactory(c_result, input_doc._parser)             # <<<<<<<<<<<<<< 
 *         return _xsltResultTreeFactory(result_doc, self, profile_doc)
 * 
 */
__pyx_5 = ((PyObject *)__pyx_f_4lxml_5etree__documentFactory(__pyx_v_c_result,__pyx_v_input_doc->_parser)); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 438; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result_doc));
__pyx_v_result_doc = ((struct LxmlDocument *)__pyx_5);
__pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":439
 * 
 *         result_doc = _documentFactory(c_result, input_doc._parser)
 *         return _xsltResultTreeFactory(result_doc, self, profile_doc)             # <<<<<<<<<<<<<< 
 * 
 *     cdef xmlDoc* _run_transform(self, _Document input_doc, xmlDoc* c_input_doc,
 */
__pyx_2 = __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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 439; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("lxml.etree.XSLT.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_XDECREF(__pyx_v__kw);
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_resolver_context);
Py_DECREF(__pyx_v_input_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF(__pyx_v_result_doc);
Py_DECREF(__pyx_v_profile_doc);
Py_DECREF(__pyx_v_error);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v__input);
Py_DECREF(__pyx_v_profile_run);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":441
 *         return _xsltResultTreeFactory(result_doc, self, profile_doc)
 * 
 *     cdef xmlDoc* _run_transform(self, _Document input_doc, xmlDoc* c_input_doc,             # <<<<<<<<<<<<<< 
 *                                 parameters, _XSLTContext context,
 *                                 xslt.xsltTransformContext* transform_ctxt):
 */

static  xmlDoc *__pyx_f_4lxml_5etree_4XSLT__run_transform(struct __pyx_obj_4lxml_5etree_XSLT *__pyx_v_self,struct LxmlDocument *__pyx_v_input_doc,xmlDoc *__pyx_v_c_input_doc,PyObject *__pyx_v_parameters,struct __pyx_obj_4lxml_5etree__XSLTContext *__pyx_v_context,xsltTransformContext *__pyx_v_transform_ctxt) {
xmlDoc *__pyx_v_c_result;
char **__pyx_v_params;
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_parameter_count;
PyObject *__pyx_v_keep_ref;
PyObject *__pyx_v_key;
PyObject *__pyx_v_value;
PyObject *__pyx_v_k;
PyObject *__pyx_v_v;
xmlDoc *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_ssize_t __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_input_doc);
Py_INCREF(__pyx_v_parameters);
Py_INCREF((PyObject *)__pyx_v_context);
__pyx_v_keep_ref = Py_None; Py_INCREF(Py_None);
__pyx_v_key = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);
__pyx_v_k = Py_None; Py_INCREF(Py_None);
__pyx_v_v = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":449
 * 
 *         xslt.xsltSetTransformErrorFunc(transform_ctxt, <void*>self._error_log,
 *                                        _receiveXSLTError)             # <<<<<<<<<<<<<< 
 * 
 *         if self._access_control is not None:
 */
xsltSetTransformErrorFunc(__pyx_v_transform_ctxt,((void *)__pyx_v_self->_error_log),__pyx_f_4lxml_5etree__receiveXSLTError);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":451
 *                                        _receiveXSLTError)
 * 
 *         if self._access_control is not None:             # <<<<<<<<<<<<<< 
 *             self._access_control._register_in_context(transform_ctxt)
 * 
 */
__pyx_1 = (((PyObject *)__pyx_v_self->_access_control) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":452
 * 
 *         if self._access_control is not None:
 *             self._access_control._register_in_context(transform_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         parameter_count = python.PyDict_Size(parameters)
 */
  ((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);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":454
 *             self._access_control._register_in_context(transform_ctxt)
 * 
 *         parameter_count = python.PyDict_Size(parameters)             # <<<<<<<<<<<<<< 
 *         if parameter_count > 0:
 *             # allocate space for parameters
 */
__pyx_v_parameter_count = PyDict_Size(__pyx_v_parameters);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":455
 * 
 *         parameter_count = python.PyDict_Size(parameters)
 *         if parameter_count > 0:             # <<<<<<<<<<<<<< 
 *             # allocate space for parameters
 *             # * 2 as we want an entry for both key and value,
 */
__pyx_1 = (__pyx_v_parameter_count > 0);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":460
 *             # and + 1 as array is NULL terminated
 *             params = <char**>python.PyMem_Malloc(
 *                 sizeof(char*) * (parameter_count * 2 + 1))             # <<<<<<<<<<<<<< 
 *             try:
 *                 i = 0
 */
  __pyx_v_params = ((char **)PyMem_Malloc(((sizeof(char *)) * ((__pyx_v_parameter_count * 2) + 1))));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":461
 *             params = <char**>python.PyMem_Malloc(
 *                 sizeof(char*) * (parameter_count * 2 + 1))
 *             try:             # <<<<<<<<<<<<<< 
 *                 i = 0
 *                 keep_ref = []
 */
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":462
 *                 sizeof(char*) * (parameter_count * 2 + 1))
 *             try:
 *                 i = 0             # <<<<<<<<<<<<<< 
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():
 */
    __pyx_v_i = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":463
 *             try:
 *                 i = 0
 *                 keep_ref = []             # <<<<<<<<<<<<<< 
 *                 for key, value in parameters.iteritems():
 *                     k = _utf8(key)
 */
    __pyx_2 = PyList_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 463; goto __pyx_L4;}
    Py_DECREF(__pyx_v_keep_ref);
    __pyx_v_keep_ref = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_parameters, __pyx_n_iteritems); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}
    __pyx_4 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (PyList_CheckExact(__pyx_4)) { __pyx_3 = 0; __pyx_2 = __pyx_4; Py_INCREF(__pyx_2); }
    else { __pyx_2 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;} }
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    for (;;) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
      if (PyList_CheckExact(__pyx_2)) { if (__pyx_3 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_4 = PyList_GET_ITEM(__pyx_2, __pyx_3++); Py_INCREF(__pyx_4); }
      else {
        __pyx_4 = PyIter_Next(__pyx_2);
        if (!__pyx_4) {
          break;
        }
      }
      if (PyTuple_CheckExact(__pyx_4) && PyTuple_GET_SIZE(__pyx_4) == 2) {
        __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 0);
        Py_INCREF(__pyx_6);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
        Py_DECREF(__pyx_v_key);
        __pyx_v_key = __pyx_6;
        __pyx_6 = 0;
        __pyx_6 = PyTuple_GET_ITEM(__pyx_4, 1);
        Py_INCREF(__pyx_6);

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_6;
        __pyx_6 = 0;
        Py_DECREF(__pyx_4); __pyx_4 = 0;
      }
      else {
        __pyx_5 = PyObject_GetIter(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
        Py_DECREF(__pyx_v_key);
        __pyx_v_key = __pyx_6;
        __pyx_6 = 0;
        __pyx_6 = __Pyx_UnpackItem(__pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}

        /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":464
 *                 i = 0
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():             # <<<<<<<<<<<<<< 
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 */
        Py_DECREF(__pyx_v_value);
        __pyx_v_value = __pyx_6;
        __pyx_6 = 0;
        if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 464; goto __pyx_L4;}
        Py_DECREF(__pyx_5); __pyx_5 = 0;
      }

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":465
 *                 keep_ref = []
 *                 for key, value in parameters.iteritems():
 *                     k = _utf8(key)             # <<<<<<<<<<<<<< 
 *                     python.PyList_Append(keep_ref, k)
 *                     v = _utf8(value)
 */
      __pyx_6 = __pyx_f_4lxml_5etree__utf8(__pyx_v_key); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 465; goto __pyx_L4;}
      Py_DECREF(__pyx_v_k);
      __pyx_v_k = __pyx_6;
      __pyx_6 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":466
 *                 for key, value in parameters.iteritems():
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)             # <<<<<<<<<<<<<< 
 *                     v = _utf8(value)
 *                     python.PyList_Append(keep_ref, v)
 */
      __pyx_7 = PyList_Append(__pyx_v_keep_ref,__pyx_v_k); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 466; goto __pyx_L4;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":467
 *                     k = _utf8(key)
 *                     python.PyList_Append(keep_ref, k)
 *                     v = _utf8(value)             # <<<<<<<<<<<<<< 
 *                     python.PyList_Append(keep_ref, v)
 *                     params[i] = _cstr(k)
 */
      __pyx_4 = __pyx_f_4lxml_5etree__utf8(__pyx_v_value); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 467; goto __pyx_L4;}
      Py_DECREF(__pyx_v_v);
      __pyx_v_v = __pyx_4;
      __pyx_4 = 0;

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":468
 *                     python.PyList_Append(keep_ref, k)
 *                     v = _utf8(value)
 *                     python.PyList_Append(keep_ref, v)             # <<<<<<<<<<<<<< 
 *                     params[i] = _cstr(k)
 *                     i = i + 1
 */
      __pyx_7 = PyList_Append(__pyx_v_keep_ref,__pyx_v_v); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 468; goto __pyx_L4;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":469
 *                     v = _utf8(value)
 *                     python.PyList_Append(keep_ref, v)
 *                     params[i] = _cstr(k)             # <<<<<<<<<<<<<< 
 *                     i = i + 1
 *                     params[i] = _cstr(v)
 */
      (__pyx_v_params[__pyx_v_i]) = _cstr(__pyx_v_k);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":470
 *                     python.PyList_Append(keep_ref, v)
 *                     params[i] = _cstr(k)
 *                     i = i + 1             # <<<<<<<<<<<<<< 
 *                     params[i] = _cstr(v)
 *                     i = i + 1
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":471
 *                     params[i] = _cstr(k)
 *                     i = i + 1
 *                     params[i] = _cstr(v)             # <<<<<<<<<<<<<< 
 *                     i = i + 1
 *             except:
 */
      (__pyx_v_params[__pyx_v_i]) = _cstr(__pyx_v_v);

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":472
 *                     i = i + 1
 *                     params[i] = _cstr(v)
 *                     i = i + 1             # <<<<<<<<<<<<<< 
 *             except:
 *                 python.PyMem_Free(params)
 */
      __pyx_v_i = (__pyx_v_i + 1);
    }
    Py_DECREF(__pyx_2); __pyx_2 = 0;
  }
  goto __pyx_L5;
  __pyx_L4:;
  Py_XDECREF(__pyx_5); __pyx_5 = 0;
  Py_XDECREF(__pyx_6); __pyx_6 = 0;
  Py_XDECREF(__pyx_4); __pyx_4 = 0;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":473
 *                     params[i] = _cstr(v)
 *                     i = i + 1
 *             except:             # <<<<<<<<<<<<<< 
 *                 python.PyMem_Free(params)
 *                 raise
 */
  /*except:*/ {
    __Pyx_AddTraceback("lxml.etree._run_transform");
    if (__Pyx_GetException(&__pyx_5, &__pyx_6, &__pyx_4) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 473; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":474
 *                     i = i + 1
 *             except:
 *                 python.PyMem_Free(params)             # <<<<<<<<<<<<<< 
 *                 raise
 *             params[i] = NULL
 */
    PyMem_Free(__pyx_v_params);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":475
 *             except:
 *                 python.PyMem_Free(params)
 *                 raise             # <<<<<<<<<<<<<< 
 *             params[i] = NULL
 *         else:
 */
    __Pyx_Raise(__pyx_5, __pyx_6, __pyx_4);
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 475; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":476
 *                 python.PyMem_Free(params)
 *                 raise
 *             params[i] = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             params = NULL
 */
  (__pyx_v_params[__pyx_v_i]) = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":478
 *             params[i] = NULL
 *         else:
 *             params = NULL             # <<<<<<<<<<<<<< 
 * 
 *         with nogil:
 */
  __pyx_v_params = NULL;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":480
 *             params = NULL
 * 
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             c_result = xslt.xsltApplyStylesheetUser(
 *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":482
 *         with nogil:
 *             c_result = xslt.xsltApplyStylesheetUser(
 *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         if params is not NULL:
 */
    __pyx_v_c_result = xsltApplyStylesheetUser(__pyx_v_self->_c_style,__pyx_v_c_input_doc,__pyx_v_params,NULL,NULL,__pyx_v_transform_ctxt);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":484
 *                 self._c_style, c_input_doc, params, NULL, NULL, transform_ctxt)
 * 
 *         if params is not NULL:             # <<<<<<<<<<<<<< 
 *             # deallocate space for parameters
 *             python.PyMem_Free(params)
 */
__pyx_1 = (__pyx_v_params != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":486
 *         if params is not NULL:
 *             # deallocate space for parameters
 *             python.PyMem_Free(params)             # <<<<<<<<<<<<<< 
 * 
 *         return c_result
 */
  PyMem_Free(__pyx_v_params);
  goto __pyx_L11;
}
__pyx_L11:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":488
 *             python.PyMem_Free(params)
 * 
 *         return c_result             # <<<<<<<<<<<<<< 
 * 
 * cdef extern from "etree_defs.h":
 */
__pyx_r = __pyx_v_c_result;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_WriteUnraisable("lxml.etree.XSLT._run_transform");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_keep_ref);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
Py_DECREF(__pyx_v_k);
Py_DECREF(__pyx_v_v);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_input_doc);
Py_DECREF(__pyx_v_parameters);
Py_DECREF((PyObject *)__pyx_v_context);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":497
 *     cdef XSLT _xslt
 *     cdef _Document _profile
 *     cdef _saveToStringAndSize(self, char** s, int* l):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef int r
 */

static PyObject *__pyx_k693p;

static char __pyx_k693[] = "Error saving XSLT result to string";

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) {
struct LxmlDocument *__pyx_v_doc;
int __pyx_v_r;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":500
 *         cdef _Document doc
 *         cdef int r
 *         if self._context_node is not None:             # <<<<<<<<<<<<<< 
 *             doc = self._context_node._doc
 *         if doc is None:
 */
__pyx_1 = (((PyObject *)__pyx_v_self->__pyx_base._context_node) != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":501
 *         cdef int r
 *         if self._context_node is not None:
 *             doc = self._context_node._doc             # <<<<<<<<<<<<<< 
 *         if doc is None:
 *             doc = self._doc
 */
  Py_INCREF(((PyObject *)__pyx_v_self->__pyx_base._context_node->_doc));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = __pyx_v_self->__pyx_base._context_node->_doc;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":502
 *         if self._context_node is not None:
 *             doc = self._context_node._doc
 *         if doc is None:             # <<<<<<<<<<<<<< 
 *             doc = self._doc
 *             if doc is None:
 */
__pyx_1 = (((PyObject *)__pyx_v_doc) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":503
 *             doc = self._context_node._doc
 *         if doc is None:
 *             doc = self._doc             # <<<<<<<<<<<<<< 
 *             if doc is None:
 *                 s[0] = NULL
 */
  Py_INCREF(((PyObject *)__pyx_v_self->__pyx_base._doc));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = __pyx_v_self->__pyx_base._doc;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":504
 *         if doc is None:
 *             doc = self._doc
 *             if doc is None:             # <<<<<<<<<<<<<< 
 *                 s[0] = NULL
 *                 return
 */
  __pyx_1 = (((PyObject *)__pyx_v_doc) == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":505
 *             doc = self._doc
 *             if doc is None:
 *                 s[0] = NULL             # <<<<<<<<<<<<<< 
 *                 return
 *         with nogil:
 */
    (__pyx_v_s[0]) = NULL;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":506
 *             if doc is None:
 *                 s[0] = NULL
 *                 return             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
 */
    __pyx_r = Py_None; Py_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":507
 *                 s[0] = NULL
 *                 return
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
 *                                             self._xslt._c_style)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":509
 *         with nogil:
 *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
 *                                             self._xslt._c_style)             # <<<<<<<<<<<<<< 
 *         if r == -1:
 *             raise XSLTSaveError, "Error saving XSLT result to string"
 */
    __pyx_v_r = xsltSaveResultToString(__pyx_v_s,__pyx_v_l,__pyx_v_doc->_c_doc,__pyx_v_self->_xslt->_c_style);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":510
 *             r = xslt.xsltSaveResultToString(s, l, doc._c_doc,
 *                                             self._xslt._c_style)
 *         if r == -1:             # <<<<<<<<<<<<<< 
 *             raise XSLTSaveError, "Error saving XSLT result to string"
 * 
 */
__pyx_1 = (__pyx_v_r == -1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":511
 *                                             self._xslt._c_style)
 *         if r == -1:
 *             raise XSLTSaveError, "Error saving XSLT result to string"             # <<<<<<<<<<<<<< 
 * 
 *     def __str__(self):
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTSaveError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 511; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":511
 *                                             self._xslt._c_style)
 *         if r == -1:
 *             raise XSLTSaveError, "Error saving XSLT result to string"             # <<<<<<<<<<<<<< 
 * 
 *     def __str__(self):
 */
  __Pyx_Raise(__pyx_2, __pyx_k693p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 511; goto __pyx_L1;}
  goto __pyx_L8;
}
__pyx_L8:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._XSLTResultTree._saveToStringAndSize");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":513
 *             raise XSLTSaveError, "Error saving XSLT result to string"
 * 
 *     def __str__(self):             # <<<<<<<<<<<<<< 
 *         cdef char* s
 *         cdef int l
 */

static PyObject *__pyx_k694p;

static char __pyx_k694[] = "";

static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__(PyObject *__pyx_v_self) {
char *__pyx_v_s;
int __pyx_v_l;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":516
 *         cdef char* s
 *         cdef int l
 *         self._saveToStringAndSize(&s, &l)             # <<<<<<<<<<<<<< 
 *         if s is NULL:
 *             return ''
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 516; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":517
 *         cdef int l
 *         self._saveToStringAndSize(&s, &l)
 *         if s is NULL:             # <<<<<<<<<<<<<< 
 *             return ''
 *         # we must not use 'funicode' here as this is not always UTF-8
 */
__pyx_2 = (__pyx_v_s == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":518
 *         self._saveToStringAndSize(&s, &l)
 *         if s is NULL:
 *             return ''             # <<<<<<<<<<<<<< 
 *         # we must not use 'funicode' here as this is not always UTF-8
 *         try:
 */
  Py_INCREF(__pyx_k694p);
  __pyx_r = __pyx_k694p;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":520
 *             return ''
 *         # we must not use 'funicode' here as this is not always UTF-8
 *         try:             # <<<<<<<<<<<<<< 
 *             result = python.PyString_FromStringAndSize(s, l)
 *         finally:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":521
 *         # we must not use 'funicode' here as this is not always UTF-8
 *         try:
 *             result = python.PyString_FromStringAndSize(s, l)             # <<<<<<<<<<<<<< 
 *         finally:
 *             tree.xmlFree(s)
 */
  __pyx_1 = PyString_FromStringAndSize(__pyx_v_s,__pyx_v_l); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 521; goto __pyx_L4;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":523
 *             result = python.PyString_FromStringAndSize(s, l)
 *         finally:
 *             tree.xmlFree(s)             # <<<<<<<<<<<<<< 
 *         return result
 * 
 */
  xmlFree(__pyx_v_s);
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":524
 *         finally:
 *             tree.xmlFree(s)
 *         return result             # <<<<<<<<<<<<<< 
 * 
 *     def __unicode__(self):
 */
Py_INCREF(__pyx_v_result);
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XSLTResultTree.__str__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":526
 *         return result
 * 
 *     def __unicode__(self):             # <<<<<<<<<<<<<< 
 *         cdef char* encoding
 *         cdef char* s
 */

static PyObject *__pyx_k695p;

static char __pyx_k695[] = "";
static char __pyx_k696[] = "ascii";
static char __pyx_k697[] = "strict";

static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *unused) {
char *__pyx_v_encoding;
char *__pyx_v_s;
int __pyx_v_l;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":530
 *         cdef char* s
 *         cdef int l
 *         self._saveToStringAndSize(&s, &l)             # <<<<<<<<<<<<<< 
 *         if s is NULL:
 *             return unicode('')
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 530; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":531
 *         cdef int l
 *         self._saveToStringAndSize(&s, &l)
 *         if s is NULL:             # <<<<<<<<<<<<<< 
 *             return unicode('')
 *         encoding = self._xslt._c_style.encoding
 */
__pyx_2 = (__pyx_v_s == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":532
 *         self._saveToStringAndSize(&s, &l)
 *         if s is NULL:
 *             return unicode('')             # <<<<<<<<<<<<<< 
 *         encoding = self._xslt._c_style.encoding
 *         if encoding is NULL:
 */
  __pyx_1 = PyObject_Unicode(__pyx_k695p); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 532; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":533
 *         if s is NULL:
 *             return unicode('')
 *         encoding = self._xslt._c_style.encoding             # <<<<<<<<<<<<<< 
 *         if encoding is NULL:
 *             encoding = 'ascii'
 */
__pyx_v_encoding = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_xslt->_c_style->encoding;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":534
 *             return unicode('')
 *         encoding = self._xslt._c_style.encoding
 *         if encoding is NULL:             # <<<<<<<<<<<<<< 
 *             encoding = 'ascii'
 *         try:
 */
__pyx_2 = (__pyx_v_encoding == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":535
 *         encoding = self._xslt._c_style.encoding
 *         if encoding is NULL:
 *             encoding = 'ascii'             # <<<<<<<<<<<<<< 
 *         try:
 *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
 */
  __pyx_v_encoding = __pyx_k696;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":536
 *         if encoding is NULL:
 *             encoding = 'ascii'
 *         try:             # <<<<<<<<<<<<<< 
 *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
 *         finally:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":537
 *             encoding = 'ascii'
 *         try:
 *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')             # <<<<<<<<<<<<<< 
 *         finally:
 *             tree.xmlFree(s)
 */
  __pyx_1 = PyUnicode_Decode(__pyx_v_s,__pyx_v_l,__pyx_v_encoding,__pyx_k697); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 537; goto __pyx_L5;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  PyObject *__pyx_exc_type, *__pyx_exc_value, *__pyx_exc_tb;
  int __pyx_exc_lineno;
  __pyx_why = 0; goto __pyx_L6;
  __pyx_L5: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_exc_type, &__pyx_exc_value, &__pyx_exc_tb);
    __pyx_exc_lineno = __pyx_lineno;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":539
 *             result = python.PyUnicode_Decode(s, l, encoding, 'strict')
 *         finally:
 *             tree.xmlFree(s)             # <<<<<<<<<<<<<< 
 *         return _stripEncodingDeclaration(result)
 * 
 */
  xmlFree(__pyx_v_s);
  switch (__pyx_why) {
    case 4: {
      PyErr_Restore(__pyx_exc_type, __pyx_exc_value, __pyx_exc_tb);
      __pyx_lineno = __pyx_exc_lineno;
      __pyx_exc_type = 0;
      __pyx_exc_value = 0;
      __pyx_exc_tb = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":540
 *         finally:
 *             tree.xmlFree(s)
 *         return _stripEncodingDeclaration(result)             # <<<<<<<<<<<<<< 
 * 
 *     property xslt_profile:
 */
__pyx_1 = __pyx_f_4lxml_5etree__stripEncodingDeclaration(__pyx_v_result); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 540; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._XSLTResultTree.__unicode__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":545
 *         """Return an ElementTree with profiling data for the stylesheet run.
 *         """
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             cdef object root
 *             if self._profile is None:
 */

static PyObject *__pyx_n_ElementTree;

static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_root;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":547
 *         def __get__(self):
 *             cdef object root
 *             if self._profile is None:             # <<<<<<<<<<<<<< 
 *                 return None
 *             root = self._profile.getroot()
 */
__pyx_1 = (((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":548
 *             cdef object root
 *             if self._profile is None:
 *                 return None             # <<<<<<<<<<<<<< 
 *             root = self._profile.getroot()
 *             if root is None:
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":549
 *             if self._profile is None:
 *                 return None
 *             root = self._profile.getroot()             # <<<<<<<<<<<<<< 
 *             if root is None:
 *                 return None
 */
__pyx_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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 549; goto __pyx_L1;}
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":550
 *                 return None
 *             root = self._profile.getroot()
 *             if root is None:             # <<<<<<<<<<<<<< 
 *                 return None
 *             return ElementTree(root)
 */
__pyx_1 = (__pyx_v_root == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":551
 *             root = self._profile.getroot()
 *             if root is None:
 *                 return None             # <<<<<<<<<<<<<< 
 *             return ElementTree(root)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":552
 *             if root is None:
 *                 return None
 *             return ElementTree(root)             # <<<<<<<<<<<<<< 
 * 
 *         def __del__(self):
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 552; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":552
 *             if root is None:
 *                 return None
 *             return ElementTree(root)             # <<<<<<<<<<<<<< 
 * 
 *         def __del__(self):
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 552; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_root);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 552; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._XSLTResultTree.xslt_profile.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":554
 *             return ElementTree(root)
 * 
 *         def __del__(self):             # <<<<<<<<<<<<<< 
 *             self._profile = None
 * 
 */

static int __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(PyObject *__pyx_v_self) {
int __pyx_r;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":555
 * 
 *         def __del__(self):
 *             self._profile = None             # <<<<<<<<<<<<<< 
 * 
 * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile));
((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_v_self)->_profile = ((struct LxmlDocument *)Py_None);

__pyx_r = 0;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":557
 *             self._profile = None
 * 
 * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):             # <<<<<<<<<<<<<< 
 *     cdef _XSLTResultTree result
 *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
 */

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) {
struct __pyx_obj_4lxml_5etree__XSLTResultTree *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_xslt);
Py_INCREF(__pyx_v_profile);
__pyx_v_result = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":559
 * cdef _xsltResultTreeFactory(_Document doc, XSLT xslt, _Document profile):
 *     cdef _XSLTResultTree result
 *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)             # <<<<<<<<<<<<<< 
 *     result._xslt = xslt
 *     result._profile = profile
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_doc,((struct LxmlElement *)Py_None),((PyObject*)__pyx_ptype_4lxml_5etree__XSLTResultTree))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 559; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_1)));
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":560
 *     cdef _XSLTResultTree result
 *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
 *     result._xslt = xslt             # <<<<<<<<<<<<<< 
 *     result._profile = profile
 *     return result
 */
Py_INCREF(((PyObject *)__pyx_v_xslt));
Py_DECREF(((PyObject *)__pyx_v_result->_xslt));
__pyx_v_result->_xslt = __pyx_v_xslt;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":561
 *     result = <_XSLTResultTree>_newElementTree(doc, None, _XSLTResultTree)
 *     result._xslt = xslt
 *     result._profile = profile             # <<<<<<<<<<<<<< 
 *     return result
 * 
 */
Py_INCREF(((PyObject *)__pyx_v_profile));
Py_DECREF(((PyObject *)__pyx_v_result->_profile));
__pyx_v_result->_profile = __pyx_v_profile;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":562
 *     result._xslt = xslt
 *     result._profile = profile
 *     return result             # <<<<<<<<<<<<<< 
 * 
 * # functions like "output" and "write" are a potential security risk, but we
 */
Py_INCREF(((PyObject *)__pyx_v_result));
__pyx_r = ((PyObject *)__pyx_v_result);
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._xsltResultTreeFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_result);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_xslt);
Py_DECREF(__pyx_v_profile);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":571
 * xslt.exsltRegisterAll()
 * 
 * cdef void initTransformDict(xslt.xsltTransformContext* transform_ctxt):             # <<<<<<<<<<<<<< 
 *     __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&transform_ctxt.dict)
 * 
 */

static  void __pyx_f_4lxml_5etree_initTransformDict(xsltTransformContext *__pyx_v_transform_ctxt) {

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":572
 * 
 * cdef void initTransformDict(xslt.xsltTransformContext* transform_ctxt):
 *     __GLOBAL_PARSER_CONTEXT.initThreadDictRef(&transform_ctxt.dict)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
((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_transform_ctxt->dict));

}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":593
 * __findStylesheetByID = None
 * 
 * cdef _findStylesheetByID(_Document doc, id):             # <<<<<<<<<<<<<< 
 *     global __findStylesheetByID
 *     if __findStylesheetByID is None:
 */

static PyObject *__pyx_n_xsl;

static PyObject *__pyx_k698p;
static PyObject *__pyx_k701p;

static char __pyx_k698[] = "//xsl:stylesheet[@xml:id = $id]";
static char __pyx_k701[] = "http://www.w3.org/1999/XSL/Transform";

static  PyObject *__pyx_f_4lxml_5etree__findStylesheetByID(struct LxmlDocument *__pyx_v_doc,PyObject *__pyx_v_id) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_id);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":595
 * cdef _findStylesheetByID(_Document doc, id):
 *     global __findStylesheetByID
 *     if __findStylesheetByID is None:             # <<<<<<<<<<<<<< 
 *         __findStylesheetByID = XPath(
 *             "//xsl:stylesheet[@xml:id = $id]",
 */
__pyx_1 = (((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":597
 *     if __findStylesheetByID is None:
 *         __findStylesheetByID = XPath(
 *             "//xsl:stylesheet[@xml:id = $id]",             # <<<<<<<<<<<<<< 
 *             namespaces={"xsl" : "http://www.w3.org/1999/XSL/Transform"})
 *     return __findStylesheetByID(doc, id=id)
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 596; goto __pyx_L1;}
  Py_INCREF(__pyx_k698p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k698p);
  __pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 596; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":598
 *         __findStylesheetByID = XPath(
 *             "//xsl:stylesheet[@xml:id = $id]",
 *             namespaces={"xsl" : "http://www.w3.org/1999/XSL/Transform"})             # <<<<<<<<<<<<<< 
 *     return __findStylesheetByID(doc, id=id)
 * 
 */
  __pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 598; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":598
 *         __findStylesheetByID = XPath(
 *             "//xsl:stylesheet[@xml:id = $id]",
 *             namespaces={"xsl" : "http://www.w3.org/1999/XSL/Transform"})             # <<<<<<<<<<<<<< 
 *     return __findStylesheetByID(doc, id=id)
 * 
 */
  if (PyDict_SetItem(__pyx_4, __pyx_n_xsl, __pyx_k701p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 598; goto __pyx_L1;}
  if (PyDict_SetItem(__pyx_3, __pyx_n_namespaces, __pyx_4) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 596; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_4lxml_5etree_XPath), __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 596; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_4lxml_5etree_XPath)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 596; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
  __pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)__pyx_4);
  __pyx_4 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":599
 *             "//xsl:stylesheet[@xml:id = $id]",
 *             namespaces={"xsl" : "http://www.w3.org/1999/XSL/Transform"})
 *     return __findStylesheetByID(doc, id=id)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 599; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_doc));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_doc));
__pyx_3 = PyDict_New(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 599; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":599
 *             "//xsl:stylesheet[@xml:id = $id]",
 *             namespaces={"xsl" : "http://www.w3.org/1999/XSL/Transform"})
 *     return __findStylesheetByID(doc, id=id)             # <<<<<<<<<<<<<< 
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):
 */
if (PyDict_SetItem(__pyx_3, __pyx_n_id, __pyx_v_id) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 599; goto __pyx_L1;}
__pyx_4 = PyEval_CallObjectWithKeywords(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID), __pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 599; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
__pyx_4 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._findStylesheetByID");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_id);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":602
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):
 *     def parseXSL(self, parser=None):             # <<<<<<<<<<<<<< 
 *         """Try to parse the stylesheet referenced by this PI and return an
 *         ElementTree for it.  If the stylesheet is embedded in the same
 */

static PyObject *__pyx_k703p;
static PyObject *__pyx_k704p;
static PyObject *__pyx_k705p;
static PyObject *__pyx_k706p;
static PyObject *__pyx_k707p;

static char __pyx_k703[] = "PI lacks content";
static char __pyx_k704[] = " ";
static char __pyx_k705[] = "malformed PI attributes";
static char __pyx_k706[] = "reference to non-existing embedded stylesheet";
static char __pyx_k707[] = "ambiguous reference to embedded stylesheet";

static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
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        ";
static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_result_doc;
struct LxmlElement *__pyx_v_result_node;
char *__pyx_v_c_href;
xmlAttr *__pyx_v_c_attr;
PyObject *__pyx_v_hrefs_utf;
PyObject *__pyx_v_href_utf;
PyObject *__pyx_v_href;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
int __pyx_5;
static char *__pyx_argnames[] = {"parser",0};
__pyx_v_parser = __pyx_k285;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_parser))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
__pyx_v_result_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_hrefs_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_href_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_href = Py_None; Py_INCREF(Py_None);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":615
 *         cdef char* c_href
 *         cdef xmlAttr* c_attr
 *         if self._c_node.content is NULL:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "PI lacks content"
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":616
 *         cdef xmlAttr* c_attr
 *         if self._c_node.content is NULL:
 *             raise ValueError, "PI lacks content"             # <<<<<<<<<<<<<< 
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)
 *         if len(hrefs_utf) != 1:
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k703p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 616; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":617
 *         if self._c_node.content is NULL:
 *             raise ValueError, "PI lacks content"
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)             # <<<<<<<<<<<<<< 
 *         if len(hrefs_utf) != 1:
 *             raise ValueError, "malformed PI attributes"
 */
__pyx_2 = PyString_FromString(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k704p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_v_4lxml_5etree__FIND_PI_HREF, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_hrefs_utf);
__pyx_v_hrefs_utf = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":618
 *             raise ValueError, "PI lacks content"
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)
 *         if len(hrefs_utf) != 1:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "malformed PI attributes"
 *         href_utf = hrefs_utf[0]
 */
__pyx_4 = PyObject_Length(__pyx_v_hrefs_utf); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 618; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":618
 *             raise ValueError, "PI lacks content"
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)
 *         if len(hrefs_utf) != 1:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "malformed PI attributes"
 *         href_utf = hrefs_utf[0]
 */
__pyx_1 = (__pyx_4 != 1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":619
 *         hrefs_utf = _FIND_PI_HREF(' ' + self._c_node.content)
 *         if len(hrefs_utf) != 1:
 *             raise ValueError, "malformed PI attributes"             # <<<<<<<<<<<<<< 
 *         href_utf = hrefs_utf[0]
 *         c_href = _cstr(href_utf)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k705p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 619; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":620
 *         if len(hrefs_utf) != 1:
 *             raise ValueError, "malformed PI attributes"
 *         href_utf = hrefs_utf[0]             # <<<<<<<<<<<<<< 
 *         c_href = _cstr(href_utf)
 * 
 */
if (PyList_CheckExact(__pyx_v_hrefs_utf) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_hrefs_utf)) {
  __pyx_3 = PyList_GET_ITEM(__pyx_v_hrefs_utf, 0); Py_INCREF(__pyx_3);
  } else if (PyTuple_CheckExact(__pyx_v_hrefs_utf) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_hrefs_utf)) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_hrefs_utf, 0); Py_INCREF(__pyx_3);
  } else {
  __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 620; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_hrefs_utf, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 620; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
Py_DECREF(__pyx_v_href_utf);
__pyx_v_href_utf = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":621
 *             raise ValueError, "malformed PI attributes"
 *         href_utf = hrefs_utf[0]
 *         c_href = _cstr(href_utf)             # <<<<<<<<<<<<<< 
 * 
 *         if c_href[0] != c'#':
 */
__pyx_v_c_href = _cstr(__pyx_v_href_utf);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":623
 *         c_href = _cstr(href_utf)
 * 
 *         if c_href[0] != c'#':             # <<<<<<<<<<<<<< 
 *             # normal URL, try to parse from it
 *             c_href = tree.xmlBuildURI(
 */
__pyx_1 = ((__pyx_v_c_href[0]) != '#');
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":627
 *             c_href = tree.xmlBuildURI(
 *                 c_href,
 *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))             # <<<<<<<<<<<<<< 
 *             if c_href is not NULL:
 *                 href = funicode(c_href)
 */
  __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));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":628
 *                 c_href,
 *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))
 *             if c_href is not NULL:             # <<<<<<<<<<<<<< 
 *                 href = funicode(c_href)
 *                 tree.xmlFree(c_href)
 */
  __pyx_1 = (__pyx_v_c_href != NULL);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":629
 *                 tree.xmlNodeGetBase(self._c_node.doc, self._c_node))
 *             if c_href is not NULL:
 *                 href = funicode(c_href)             # <<<<<<<<<<<<<< 
 *                 tree.xmlFree(c_href)
 *             else:
 */
    __pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_href); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 629; goto __pyx_L1;}
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_2;
    __pyx_2 = 0;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":630
 *             if c_href is not NULL:
 *                 href = funicode(c_href)
 *                 tree.xmlFree(c_href)             # <<<<<<<<<<<<<< 
 *             else:
 *                 href = funicode(_cstr(href_utf))
 */
    xmlFree(__pyx_v_c_href);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":632
 *                 tree.xmlFree(c_href)
 *             else:
 *                 href = funicode(_cstr(href_utf))             # <<<<<<<<<<<<<< 
 *             result_doc = _parseDocument(href, parser)
 *             return _elementTreeFactory(result_doc, None)
 */
    __pyx_3 = __pyx_f_4lxml_5etree_funicode(_cstr(__pyx_v_href_utf)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 632; goto __pyx_L1;}
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":633
 *             else:
 *                 href = funicode(_cstr(href_utf))
 *             result_doc = _parseDocument(href, parser)             # <<<<<<<<<<<<<< 
 *             return _elementTreeFactory(result_doc, None)
 * 
 */
  if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 633; goto __pyx_L1;}
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__parseDocument(__pyx_v_href,((struct __pyx_obj_4lxml_5etree__BaseParser *)__pyx_v_parser))); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 633; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result_doc));
  __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":634
 *                 href = funicode(_cstr(href_utf))
 *             result_doc = _parseDocument(href, parser)
 *             return _elementTreeFactory(result_doc, None)             # <<<<<<<<<<<<<< 
 * 
 *         # ID reference to embedded stylesheet
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_doc,((struct LxmlElement *)Py_None))); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 634; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":638
 *         # ID reference to embedded stylesheet
 *         # try XML:ID lookup
 *         c_href = c_href+1 # skip leading '#'             # <<<<<<<<<<<<<< 
 *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
 */
__pyx_v_c_href = (__pyx_v_c_href + 1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":639
 *         # try XML:ID lookup
 *         c_href = c_href+1 # skip leading '#'
 *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)             # <<<<<<<<<<<<<< 
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
 *             result_node = _elementFactory(self._doc, c_attr.parent)
 */
__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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":640
 *         c_href = c_href+1 # skip leading '#'
 *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:             # <<<<<<<<<<<<<< 
 *             result_node = _elementFactory(self._doc, c_attr.parent)
 *             return _elementTreeFactory(result_node._doc, result_node)
 */
__pyx_1 = (__pyx_v_c_attr != NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":640
 *         c_href = c_href+1 # skip leading '#'
 *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:             # <<<<<<<<<<<<<< 
 *             result_node = _elementFactory(self._doc, c_attr.parent)
 *             return _elementTreeFactory(result_node._doc, result_node)
 */
  __pyx_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);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":641
 *         c_attr = tree.xmlGetID(self._c_node.doc, c_href)
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
 *             result_node = _elementFactory(self._doc, c_attr.parent)             # <<<<<<<<<<<<<< 
 *             return _elementTreeFactory(result_node._doc, result_node)
 * 
 */
  __pyx_2 = ((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_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 641; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result_node));
  __pyx_v_result_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":642
 *         if c_attr is not NULL and c_attr.doc is self._c_node.doc:
 *             result_node = _elementFactory(self._doc, c_attr.parent)
 *             return _elementTreeFactory(result_node._doc, result_node)             # <<<<<<<<<<<<<< 
 * 
 *         # try XPath search
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_node->_doc,__pyx_v_result_node)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 642; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":645
 * 
 *         # try XPath search
 *         root = _findStylesheetByID(self._doc, funicode(c_href))             # <<<<<<<<<<<<<< 
 *         if not root:
 *             raise ValueError, "reference to non-existing embedded stylesheet"
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_c_href); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 645; goto __pyx_L1;}
__pyx_3 = __pyx_f_4lxml_5etree__findStylesheetByID(((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc,__pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 645; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":646
 *         # try XPath search
 *         root = _findStylesheetByID(self._doc, funicode(c_href))
 *         if not root:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "reference to non-existing embedded stylesheet"
 *         elif len(root) > 1:
 */
__pyx_1 = __Pyx_PyObject_IsTrue(__pyx_v_root); if (unlikely(__pyx_1 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 646; goto __pyx_L1;}
__pyx_5 = (!__pyx_1);
if (__pyx_5) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":647
 *         root = _findStylesheetByID(self._doc, funicode(c_href))
 *         if not root:
 *             raise ValueError, "reference to non-existing embedded stylesheet"             # <<<<<<<<<<<<<< 
 *         elif len(root) > 1:
 *             raise ValueError, "ambiguous reference to embedded stylesheet"
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k706p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 647; goto __pyx_L1;}
  goto __pyx_L7;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":648
 *         if not root:
 *             raise ValueError, "reference to non-existing embedded stylesheet"
 *         elif len(root) > 1:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "ambiguous reference to embedded stylesheet"
 *         result_node = root[0]
 */
__pyx_4 = PyObject_Length(__pyx_v_root); if (unlikely(__pyx_4 == -1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 648; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":648
 *         if not root:
 *             raise ValueError, "reference to non-existing embedded stylesheet"
 *         elif len(root) > 1:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "ambiguous reference to embedded stylesheet"
 *         result_node = root[0]
 */
__pyx_1 = (__pyx_4 > 1);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":649
 *             raise ValueError, "reference to non-existing embedded stylesheet"
 *         elif len(root) > 1:
 *             raise ValueError, "ambiguous reference to embedded stylesheet"             # <<<<<<<<<<<<<< 
 *         result_node = root[0]
 *         return _elementTreeFactory(result_node._doc, result_node)
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k707p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 649; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":650
 *         elif len(root) > 1:
 *             raise ValueError, "ambiguous reference to embedded stylesheet"
 *         result_node = root[0]             # <<<<<<<<<<<<<< 
 *         return _elementTreeFactory(result_node._doc, result_node)
 * 
 */
if (PyList_CheckExact(__pyx_v_root) && 0 <= 0 && 0 < PyList_GET_SIZE(__pyx_v_root)) {
  __pyx_3 = PyList_GET_ITEM(__pyx_v_root, 0); Py_INCREF(__pyx_3);
  } else if (PyTuple_CheckExact(__pyx_v_root) && 0 <= 0 && 0 < PyTuple_GET_SIZE(__pyx_v_root)) {
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_root, 0); Py_INCREF(__pyx_3);
  } else {
  __pyx_2 = PyInt_FromLong(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 650; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_root, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 650; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_4lxml_5etree__Element)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 650; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result_node));
__pyx_v_result_node = ((struct LxmlElement *)__pyx_3);
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":651
 *             raise ValueError, "ambiguous reference to embedded stylesheet"
 *         result_node = root[0]
 *         return _elementTreeFactory(result_node._doc, result_node)             # <<<<<<<<<<<<<< 
 * 
 *     def set(self, key, value):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementTreeFactory(__pyx_v_result_node->_doc,__pyx_v_result_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 651; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.parseXSL");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_result_doc);
Py_DECREF(__pyx_v_result_node);
Py_DECREF(__pyx_v_hrefs_utf);
Py_DECREF(__pyx_v_href_utf);
Py_DECREF(__pyx_v_href);
Py_DECREF(__pyx_v_root);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":653
 *         return _elementTreeFactory(result_node._doc, result_node)
 * 
 *     def set(self, key, value):             # <<<<<<<<<<<<<< 
 *         if key != "href":
 *             raise AttributeError, "only setting the 'href' attribute is supported on XSLT-PIs"
 */

static PyObject *__pyx_n_href;

static PyObject *__pyx_k709p;
static PyObject *__pyx_k710p;
static PyObject *__pyx_k711p;
static PyObject *__pyx_k712p;
static PyObject *__pyx_k713p;
static PyObject *__pyx_k714p;
static PyObject *__pyx_k715p;

static char __pyx_k709[] = "only setting the 'href' attribute is supported on XSLT-PIs";
static char __pyx_k710[] = "";
static char __pyx_k711[] = "\"";
static char __pyx_k712[] = ">";
static char __pyx_k713[] = "Invalid URL, must not contain '\"' or '>'";
static char __pyx_k714[] = " href=\"%s\"";
static char __pyx_k715[] = " ";

static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_attrib;
PyObject *__pyx_v_text;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"key","value",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);
__pyx_v_attrib = Py_None; Py_INCREF(Py_None);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":654
 * 
 *     def set(self, key, value):
 *         if key != "href":             # <<<<<<<<<<<<<< 
 *             raise AttributeError, "only setting the 'href' attribute is supported on XSLT-PIs"
 *         if value is None:
 */
__pyx_1 = PyObject_RichCompare(__pyx_v_key, __pyx_n_href, Py_NE); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 654; goto __pyx_L1;}
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_1); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 654; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":655
 *     def set(self, key, value):
 *         if key != "href":
 *             raise AttributeError, "only setting the 'href' attribute is supported on XSLT-PIs"             # <<<<<<<<<<<<<< 
 *         if value is None:
 *             attrib = ""
 */
  __Pyx_Raise(__pyx_builtin_AttributeError, __pyx_k709p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 655; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":656
 *         if key != "href":
 *             raise AttributeError, "only setting the 'href' attribute is supported on XSLT-PIs"
 *         if value is None:             # <<<<<<<<<<<<<< 
 *             attrib = ""
 *         elif '"' in value or '>' in value:
 */
__pyx_2 = (__pyx_v_value == Py_None);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":657
 *             raise AttributeError, "only setting the 'href' attribute is supported on XSLT-PIs"
 *         if value is None:
 *             attrib = ""             # <<<<<<<<<<<<<< 
 *         elif '"' in value or '>' in value:
 *             raise ValueError, "Invalid URL, must not contain '\"' or '>'"
 */
  Py_INCREF(__pyx_k710p);
  Py_DECREF(__pyx_v_attrib);
  __pyx_v_attrib = __pyx_k710p;
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":658
 *         if value is None:
 *             attrib = ""
 *         elif '"' in value or '>' in value:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Invalid URL, must not contain '\"' or '>'"
 *         else:
 */
__pyx_2 = (PySequence_Contains(__pyx_v_value, __pyx_k711p)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 658; goto __pyx_L1;}
if (!__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":658
 *         if value is None:
 *             attrib = ""
 *         elif '"' in value or '>' in value:             # <<<<<<<<<<<<<< 
 *             raise ValueError, "Invalid URL, must not contain '\"' or '>'"
 *         else:
 */
  __pyx_2 = (PySequence_Contains(__pyx_v_value, __pyx_k712p)); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 658; goto __pyx_L1;}
}
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":659
 *             attrib = ""
 *         elif '"' in value or '>' in value:
 *             raise ValueError, "Invalid URL, must not contain '\"' or '>'"             # <<<<<<<<<<<<<< 
 *         else:
 *             attrib = ' href="%s"' % value
 */
  __Pyx_Raise(__pyx_builtin_ValueError, __pyx_k713p, 0);
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 659; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":661
 *             raise ValueError, "Invalid URL, must not contain '\"' or '>'"
 *         else:
 *             attrib = ' href="%s"' % value             # <<<<<<<<<<<<<< 
 *         text = ' ' + self.text
 *         if _FIND_PI_HREF(text):
 */
  __pyx_1 = PyNumber_Remainder(__pyx_k714p, __pyx_v_value); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 661; goto __pyx_L1;}
  Py_DECREF(__pyx_v_attrib);
  __pyx_v_attrib = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":662
 *         else:
 *             attrib = ' href="%s"' % value
 *         text = ' ' + self.text             # <<<<<<<<<<<<<< 
 *         if _FIND_PI_HREF(text):
 *             self.text = _REPLACE_PI_HREF(attrib, text)
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 662; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k715p, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 662; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_3;
__pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":663
 *             attrib = ' href="%s"' % value
 *         text = ' ' + self.text
 *         if _FIND_PI_HREF(text):             # <<<<<<<<<<<<<< 
 *             self.text = _REPLACE_PI_HREF(attrib, text)
 *         else:
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 663; goto __pyx_L1;}
Py_INCREF(__pyx_v_text);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_text);
__pyx_3 = PyObject_CallObject(__pyx_v_4lxml_5etree__FIND_PI_HREF, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 663; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_2 = __Pyx_PyObject_IsTrue(__pyx_3); if (unlikely(__pyx_2 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 663; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":664
 *         text = ' ' + self.text
 *         if _FIND_PI_HREF(text):
 *             self.text = _REPLACE_PI_HREF(attrib, text)             # <<<<<<<<<<<<<< 
 *         else:
 *             self.text = text + attrib
 */
  __pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 664; goto __pyx_L1;}
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_attrib);
  Py_INCREF(__pyx_v_text);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_text);
  __pyx_3 = PyObject_CallObject(__pyx_v_4lxml_5etree__REPLACE_PI_HREF, __pyx_1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 664; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":664
 *         text = ' ' + self.text
 *         if _FIND_PI_HREF(text):
 *             self.text = _REPLACE_PI_HREF(attrib, text)             # <<<<<<<<<<<<<< 
 *         else:
 *             self.text = text + attrib
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_text, __pyx_3) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 664; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":666
 *             self.text = _REPLACE_PI_HREF(attrib, text)
 *         else:
 *             self.text = text + attrib             # <<<<<<<<<<<<<< 
 * 
 *     def get(self, key, default=None):
 */
  __pyx_1 = PyNumber_Add(__pyx_v_text, __pyx_v_attrib); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 666; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":666
 *             self.text = _REPLACE_PI_HREF(attrib, text)
 *         else:
 *             self.text = text + attrib             # <<<<<<<<<<<<<< 
 * 
 *     def get(self, key, default=None):
 */
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_text, __pyx_1) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 666; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
__pyx_L4:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.set");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_text);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":668
 *             self.text = text + attrib
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):
 *             if attr == key:
 */

static PyObject *__pyx_k716p;

static char __pyx_k716[] = " ";

static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_v_default = 0;
PyObject *__pyx_v_attr;
PyObject *__pyx_v_value;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
static char *__pyx_argnames[] = {"key","default",0};
__pyx_v_default = __pyx_k286;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);
__pyx_v_attr = Py_None; Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k716p, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyList_CheckExact(__pyx_3)) { __pyx_1 = 0; __pyx_2 = __pyx_3; Py_INCREF(__pyx_2); }
else { __pyx_2 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;} }
Py_DECREF(__pyx_3); __pyx_3 = 0;
for (;;) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
  if (PyList_CheckExact(__pyx_2)) { if (__pyx_1 >= PyList_GET_SIZE(__pyx_2)) break; __pyx_3 = PyList_GET_ITEM(__pyx_2, __pyx_1++); Py_INCREF(__pyx_3); }
  else {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      break;
    }
  }
  if (PyTuple_CheckExact(__pyx_3) && PyTuple_GET_SIZE(__pyx_3) == 2) {
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 0);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
    Py_DECREF(__pyx_v_attr);
    __pyx_v_attr = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = PyTuple_GET_ITEM(__pyx_3, 1);
    Py_INCREF(__pyx_5);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_5;
    __pyx_5 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  else {
    __pyx_4 = PyObject_GetIter(__pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
    Py_DECREF(__pyx_v_attr);
    __pyx_v_attr = __pyx_5;
    __pyx_5 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":669
 * 
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):             # <<<<<<<<<<<<<< 
 *             if attr == key:
 *                 return value
 */
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 669; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":670
 *     def get(self, key, default=None):
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):
 *             if attr == key:             # <<<<<<<<<<<<<< 
 *                 return value
 *         return default
 */
  __pyx_5 = PyObject_RichCompare(__pyx_v_attr, __pyx_v_key, Py_EQ); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 670; goto __pyx_L1;}
  __pyx_6 = __Pyx_PyObject_IsTrue(__pyx_5); if (unlikely(__pyx_6 < 0)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 670; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__pyx_6) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":671
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):
 *             if attr == key:
 *                 return value             # <<<<<<<<<<<<<< 
 *         return default
 */
    Py_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":672
 *             if attr == key:
 *                 return value
 *         return default             # <<<<<<<<<<<<<< 
 */
Py_INCREF(__pyx_v_default);
__pyx_r = __pyx_v_default;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("lxml.etree._XSLTProcessingInstruction.get");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_attr);
Py_DECREF(__pyx_v_value);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2343
 *     "Base class for XML validators."
 *     cdef _ErrorLog _error_log
 *     def __init__(self):             # <<<<<<<<<<<<<< 
 *         self._error_log = _ErrorLog()
 * 
 */

static int __pyx_pf_4lxml_5etree_10_Validator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_10_Validator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames))) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2344
 *     cdef _ErrorLog _error_log
 *     def __init__(self):
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 *     def validate(self, etree):
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ErrorLog), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ErrorLog)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2344; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2344
 *     cdef _ErrorLog _error_log
 *     def __init__(self):
 *         self._error_log = _ErrorLog()             # <<<<<<<<<<<<<< 
 * 
 *     def validate(self, etree):
 */
Py_DECREF(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log));
((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)__pyx_1);
__pyx_1 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree._Validator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2346
 *         self._error_log = _ErrorLog()
 * 
 *     def validate(self, etree):             # <<<<<<<<<<<<<< 
 *         """Validate the document using this schema.
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
static char __pyx_doc_4lxml_5etree_10_Validator_validate[] = "Validate the document using this schema.\n\n        Returns true if document is valid, false if not.";
static PyObject *__pyx_pf_4lxml_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2350
 * 
 *         Returns true if document is valid, false if not."""
 *         return self(etree)             # <<<<<<<<<<<<<< 
 * 
 *     def assertValid(self, etree):
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;}
Py_INCREF(__pyx_v_etree);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_etree);
__pyx_2 = PyObject_CallObject(__pyx_v_self, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2350; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Validator.validate");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2352
 *         return self(etree)
 * 
 *     def assertValid(self, etree):             # <<<<<<<<<<<<<< 
 *         "Raises DocumentInvalid if the document does not comply with the schema."
 *         if not self(etree):
 */

static PyObject *__pyx_k717p;

static char __pyx_k717[] = "Document does not comply with schema";

static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
static char __pyx_doc_4lxml_5etree_10_Validator_assertValid[] = "Raises DocumentInvalid if the document does not comply with the schema.";
static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2354
 *     def assertValid(self, etree):
 *         "Raises DocumentInvalid if the document does not comply with the schema."
 *         if not self(etree):             # <<<<<<<<<<<<<< 
 *             raise DocumentInvalid, self._error_log._buildExceptionMessage(
 *                 "Document does not comply with schema")
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; goto __pyx_L1;}
Py_INCREF(__pyx_v_etree);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_etree);
__pyx_2 = PyObject_CallObject(__pyx_v_self, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2354; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = (!__pyx_3);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2355
 *         "Raises DocumentInvalid if the document does not comply with the schema."
 *         if not self(etree):
 *             raise DocumentInvalid, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<< 
 *                 "Document does not comply with schema")
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DocumentInvalid); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2356
 *         if not self(etree):
 *             raise DocumentInvalid, self._error_log._buildExceptionMessage(
 *                 "Document does not comply with schema")             # <<<<<<<<<<<<<< 
 * 
 *     def assert_(self, etree):
 */
  __pyx_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),__pyx_k717p); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_2, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2355; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Validator.assertValid");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2358
 *                 "Document does not comply with schema")
 * 
 *     def assert_(self, etree):             # <<<<<<<<<<<<<< 
 *         "Raises AssertionError if the document does not comply with the schema."
 *         if not self(etree):
 */

static PyObject *__pyx_n_AssertionError;

static PyObject *__pyx_k718p;

static PyObject *__pyx_builtin_AssertionError;

static char __pyx_k718[] = "Document does not comply with schema";

static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_v_etree); /*proto*/
static char __pyx_doc_4lxml_5etree_10_Validator_assert_[] = "Raises AssertionError if the document does not comply with the schema.";
static PyObject *__pyx_pf_4lxml_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_v_etree) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2360
 *     def assert_(self, etree):
 *         "Raises AssertionError if the document does not comply with the schema."
 *         if not self(etree):             # <<<<<<<<<<<<<< 
 *             raise AssertionError, self._error_log._buildExceptionMessage(
 *                 "Document does not comply with schema")
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;}
Py_INCREF(__pyx_v_etree);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_etree);
__pyx_2 = PyObject_CallObject(__pyx_v_self, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_PyObject_IsTrue(__pyx_2); if (unlikely(__pyx_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2360; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = (!__pyx_3);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2362
 *         if not self(etree):
 *             raise AssertionError, self._error_log._buildExceptionMessage(
 *                 "Document does not comply with schema")             # <<<<<<<<<<<<<< 
 * 
 *     property error_log:
 */
  __pyx_1 = ((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),__pyx_k718p); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
  __Pyx_Raise(__pyx_builtin_AssertionError, __pyx_1, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Validator.assert_");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2365
 * 
 *     property error_log:
 *         def __get__(self):             # <<<<<<<<<<<<<< 
 *             return self._error_log.copy()
 * 
 */

static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2366
 *     property error_log:
 *         def __get__(self):
 *             return self._error_log.copy()             # <<<<<<<<<<<<<< 
 * 
 * include "dtd.pxi"        # DTD
 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_4lxml_5etree__Validator *)__pyx_v_self)->_error_log), __pyx_n_copy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2366; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._Validator.error_log.__get__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":30
 *     """
 *     cdef tree.xmlDtd* _c_dtd
 *     def __init__(self, file=None, external_id=None):             # <<<<<<<<<<<<<< 
 *         self._c_dtd = NULL
 *         if file is not None:
 */

static PyObject *__pyx_k720p;
static PyObject *__pyx_k721p;
static PyObject *__pyx_k722p;

static char __pyx_k720[] = "parsing from file objects is not supported";
static char __pyx_k721[] = "either filename or external ID required";
static char __pyx_k722[] = "error parsing DTD";

static int __pyx_pf_4lxml_5etree_3DTD___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_3DTD___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_file = 0;
PyObject *__pyx_v_external_id = 0;
int __pyx_r;
int __pyx_1;
int __pyx_2;
xmlDtd *__pyx_3;
PyObject *__pyx_4 = 0;
char *__pyx_5;
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
static char *__pyx_argnames[] = {"file","external_id",0};
__pyx_v_file = __pyx_k295;
__pyx_v_external_id = __pyx_k296;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_file, &__pyx_v_external_id))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_file);
Py_INCREF(__pyx_v_external_id);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":31
 *     cdef tree.xmlDtd* _c_dtd
 *     def __init__(self, file=None, external_id=None):
 *         self._c_dtd = NULL             # <<<<<<<<<<<<<< 
 *         if file is not None:
 *             if python._isString(file):
 */
((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":32
 *     def __init__(self, file=None, external_id=None):
 *         self._c_dtd = NULL
 *         if file is not None:             # <<<<<<<<<<<<<< 
 *             if python._isString(file):
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
 */
__pyx_1 = (__pyx_v_file != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":33
 *         self._c_dtd = NULL
 *         if file is not None:
 *             if python._isString(file):             # <<<<<<<<<<<<<< 
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
 *             elif hasattr(file, 'read'):
 */
  __pyx_2 = _isString(__pyx_v_file);
  if (__pyx_2) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":34
 *         if file is not None:
 *             if python._isString(file):
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))             # <<<<<<<<<<<<<< 
 *             elif hasattr(file, 'read'):
 *                 self._c_dtd = _parseDtdFromFilelike(file)
 */
    ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = xmlParseDTD(NULL,_cstr(__pyx_v_file));
    goto __pyx_L3;
  }

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":35
 *             if python._isString(file):
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
 *             elif hasattr(file, 'read'):             # <<<<<<<<<<<<<< 
 *                 self._c_dtd = _parseDtdFromFilelike(file)
 *             else:
 */
  __pyx_1 = PyObject_HasAttr(__pyx_v_file,__pyx_n_read); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 35; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":36
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
 *             elif hasattr(file, 'read'):
 *                 self._c_dtd = _parseDtdFromFilelike(file)             # <<<<<<<<<<<<<< 
 *             else:
 *                 raise DTDParseError, "parsing from file objects is not supported"
 */
    __pyx_3 = __pyx_f_4lxml_5etree__parseDtdFromFilelike(__pyx_v_file); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 36; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":36
 *                 self._c_dtd = xmlparser.xmlParseDTD(NULL, _cstr(file))
 *             elif hasattr(file, 'read'):
 *                 self._c_dtd = _parseDtdFromFilelike(file)             # <<<<<<<<<<<<<< 
 *             else:
 *                 raise DTDParseError, "parsing from file objects is not supported"
 */
    ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = __pyx_3;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":38
 *                 self._c_dtd = _parseDtdFromFilelike(file)
 *             else:
 *                 raise DTDParseError, "parsing from file objects is not supported"             # <<<<<<<<<<<<<< 
 *         elif external_id is not None:
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
 */
    __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_DTDParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 38; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":38
 *                 self._c_dtd = _parseDtdFromFilelike(file)
 *             else:
 *                 raise DTDParseError, "parsing from file objects is not supported"             # <<<<<<<<<<<<<< 
 *         elif external_id is not None:
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
 */
    __Pyx_Raise(__pyx_4, __pyx_k720p, 0);
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    {__pyx_filename = __pyx_f[15]; __pyx_lineno = 38; goto __pyx_L1;}
  }
  __pyx_L3:;
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":39
 *             else:
 *                 raise DTDParseError, "parsing from file objects is not supported"
 *         elif external_id is not None:             # <<<<<<<<<<<<<< 
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
 *         else:
 */
__pyx_1 = (__pyx_v_external_id != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":40
 *                 raise DTDParseError, "parsing from file objects is not supported"
 *         elif external_id is not None:
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)             # <<<<<<<<<<<<<< 
 *         else:
 *             raise DTDParseError, "either filename or external ID required"
 */
  __pyx_5 = PyString_AsString(__pyx_v_external_id); if (unlikely((!__pyx_5) && PyErr_Occurred())) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 40; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":40
 *                 raise DTDParseError, "parsing from file objects is not supported"
 *         elif external_id is not None:
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)             # <<<<<<<<<<<<<< 
 *         else:
 *             raise DTDParseError, "either filename or external ID required"
 */
  ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd = xmlParseDTD(__pyx_5,NULL);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":42
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
 *         else:
 *             raise DTDParseError, "either filename or external ID required"             # <<<<<<<<<<<<<< 
 * 
 *         if self._c_dtd is NULL:
 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_DTDParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 42; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":42
 *             self._c_dtd = xmlparser.xmlParseDTD(external_id, NULL)
 *         else:
 *             raise DTDParseError, "either filename or external ID required"             # <<<<<<<<<<<<<< 
 * 
 *         if self._c_dtd is NULL:
 */
  __Pyx_Raise(__pyx_4, __pyx_k721p, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 42; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":44
 *             raise DTDParseError, "either filename or external ID required"
 * 
 *         if self._c_dtd is NULL:             # <<<<<<<<<<<<<< 
 *             raise DTDParseError, "error parsing DTD"
 *         _Validator.__init__(self)
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":45
 * 
 *         if self._c_dtd is NULL:
 *             raise DTDParseError, "error parsing DTD"             # <<<<<<<<<<<<<< 
 *         _Validator.__init__(self)
 * 
 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_DTDParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 45; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":45
 * 
 *         if self._c_dtd is NULL:
 *             raise DTDParseError, "error parsing DTD"             # <<<<<<<<<<<<<< 
 *         _Validator.__init__(self)
 * 
 */
  __Pyx_Raise(__pyx_4, __pyx_k722p, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 45; goto __pyx_L1;}
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":46
 *         if self._c_dtd is NULL:
 *             raise DTDParseError, "error parsing DTD"
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_4 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__Validator), __pyx_n___init__); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 46; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":46
 *         if self._c_dtd is NULL:
 *             raise DTDParseError, "error parsing DTD"
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 46; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_self);
__pyx_7 = PyObject_CallObject(__pyx_4, __pyx_6); if (unlikely(!__pyx_7)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 46; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("lxml.etree.DTD.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_file);
Py_DECREF(__pyx_v_external_id);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":48
 *         _Validator.__init__(self)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         tree.xmlFreeDtd(self._c_dtd)
 * 
 */

static void __pyx_pf_4lxml_5etree_3DTD___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_3DTD___dealloc__(PyObject *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":49
 * 
 *     def __dealloc__(self):
 *         tree.xmlFreeDtd(self._c_dtd)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, etree):
 */
xmlFreeDtd(((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":51
 *         tree.xmlFreeDtd(self._c_dtd)
 * 
 *     def __call__(self, etree):             # <<<<<<<<<<<<<< 
 *         """Validate doc using the DTD.
 * 
 */

static PyObject *__pyx_k723p;
static PyObject *__pyx_k724p;

static char __pyx_k723[] = "Failed to create validation context";
static char __pyx_k724[] = "Internal error in DTD validation";

static PyObject *__pyx_pf_4lxml_5etree_3DTD___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_3DTD___call__[] = "Validate doc using the DTD.\n\n        Returns true if the document is valid, false if not.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_3DTD___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_c_doc;
xmlValidCtxt *__pyx_v_valid_ctxt;
int __pyx_v_ret;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"etree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":62
 *         cdef int ret
 * 
 *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(etree)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 62; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":63
 * 
 *         doc = _documentOrRaise(etree)
 *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 63; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":65
 *         root_node = _rootNodeOrRaise(etree)
 * 
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
 *         if valid_ctxt is NULL:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":66
 * 
 *         self._error_log.connect()
 *         valid_ctxt = dtdvalid.xmlNewValidCtxt()             # <<<<<<<<<<<<<< 
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 */
__pyx_v_valid_ctxt = xmlNewValidCtxt();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":67
 *         self._error_log.connect()
 *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
 *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             self._error_log.disconnect()
 *             raise DTDError, "Failed to create validation context"
 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":68
 *         valid_ctxt = dtdvalid.xmlNewValidCtxt()
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             raise DTDError, "Failed to create validation context"
 * 
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":69
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 *             raise DTDError, "Failed to create validation context"             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DTDError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 69; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":69
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 *             raise DTDError, "Failed to create validation context"             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
  __Pyx_Raise(__pyx_1, __pyx_k723p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 69; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":71
 *             raise DTDError, "Failed to create validation context"
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
 */
__pyx_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 71; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":72
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":73
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:
 *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)             # <<<<<<<<<<<<<< 
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 */
    __pyx_v_ret = xmlValidateDtd(__pyx_v_valid_ctxt,__pyx_v_c_doc,((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_v_self)->_c_dtd);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":74
 *         with nogil:
 *             ret = dtdvalid.xmlValidateDtd(valid_ctxt, c_doc, self._c_dtd)
 *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 * 
 *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)
 */
__pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":76
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.disconnect()
 */
xmlFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":78
 *         dtdvalid.xmlFreeValidCtxt(valid_ctxt)
 * 
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *         if ret == -1:
 *             raise DTDValidateError, "Internal error in DTD validation"
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":79
 * 
 *         self._error_log.disconnect()
 *         if ret == -1:             # <<<<<<<<<<<<<< 
 *             raise DTDValidateError, "Internal error in DTD validation"
 *         if ret == 1:
 */
__pyx_2 = (__pyx_v_ret == -1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":80
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise DTDValidateError, "Internal error in DTD validation"             # <<<<<<<<<<<<<< 
 *         if ret == 1:
 *             return True
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DTDValidateError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 80; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":80
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise DTDValidateError, "Internal error in DTD validation"             # <<<<<<<<<<<<<< 
 *         if ret == 1:
 *             return True
 */
  __Pyx_Raise(__pyx_1, __pyx_k724p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 80; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":81
 *         if ret == -1:
 *             raise DTDValidateError, "Internal error in DTD validation"
 *         if ret == 1:             # <<<<<<<<<<<<<< 
 *             return True
 *         else:
 */
__pyx_2 = (__pyx_v_ret == 1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":82
 *             raise DTDValidateError, "Internal error in DTD validation"
 *         if ret == 1:
 *             return True             # <<<<<<<<<<<<<< 
 *         else:
 *             return False
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":84
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<< 
 * 
 * 
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.DTD.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":87
 * 
 * 
 * cdef tree.xmlDtd* _parseDtdFromFilelike(file) except NULL:             # <<<<<<<<<<<<<< 
 *     cdef _ExceptionContext exc_context
 *     cdef _FileReaderContext dtd_parser
 */

static PyObject *__pyx_k725p;

static char __pyx_k725[] = "error parsing DTD";

static  xmlDtd *__pyx_f_4lxml_5etree__parseDtdFromFilelike(PyObject *__pyx_v_file) {
struct __pyx_obj_4lxml_5etree__ExceptionContext *__pyx_v_exc_context;
struct __pyx_obj_4lxml_5etree__FileReaderContext *__pyx_v_dtd_parser;
xmlDtd *__pyx_v_c_dtd;
xmlDtd *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
Py_INCREF(__pyx_v_file);
__pyx_v_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_dtd_parser = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":91
 *     cdef _FileReaderContext dtd_parser
 *     cdef tree.xmlDtd* c_dtd
 *     exc_context = _ExceptionContext()             # <<<<<<<<<<<<<< 
 *     dtd_parser = _FileReaderContext(file, exc_context, None, None)
 * 
 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ExceptionContext), 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 91; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_4lxml_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 91; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_exc_context));
__pyx_v_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":92
 *     cdef tree.xmlDtd* c_dtd
 *     exc_context = _ExceptionContext()
 *     dtd_parser = _FileReaderContext(file, exc_context, None, None)             # <<<<<<<<<<<<<< 
 * 
 *     c_dtd = dtd_parser._readDtd()
 */
__pyx_1 = PyTuple_New(4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 92; goto __pyx_L1;}
Py_INCREF(__pyx_v_file);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_file);
Py_INCREF(((PyObject *)__pyx_v_exc_context));
PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_exc_context));
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_1, 2, Py_None);
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_1, 3, Py_None);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__FileReaderContext), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__FileReaderContext)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_dtd_parser));
__pyx_v_dtd_parser = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":94
 *     dtd_parser = _FileReaderContext(file, exc_context, None, None)
 * 
 *     c_dtd = dtd_parser._readDtd()             # <<<<<<<<<<<<<< 
 * 
 *     exc_context._raise_if_stored()
 */
__pyx_v_c_dtd = ((struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext *)__pyx_v_dtd_parser->__pyx_vtab)->_readDtd(__pyx_v_dtd_parser);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":96
 *     c_dtd = dtd_parser._readDtd()
 * 
 *     exc_context._raise_if_stored()             # <<<<<<<<<<<<<< 
 *     if c_dtd is NULL:
 *         raise DTDParseError, "error parsing DTD"
 */
__pyx_3 = ((struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext *)__pyx_v_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_exc_context); if (unlikely(__pyx_3 == -1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 96; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":97
 * 
 *     exc_context._raise_if_stored()
 *     if c_dtd is NULL:             # <<<<<<<<<<<<<< 
 *         raise DTDParseError, "error parsing DTD"
 *     return c_dtd
 */
__pyx_4 = (__pyx_v_c_dtd == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":98
 *     exc_context._raise_if_stored()
 *     if c_dtd is NULL:
 *         raise DTDParseError, "error parsing DTD"             # <<<<<<<<<<<<<< 
 *     return c_dtd
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DTDParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 98; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":98
 *     exc_context._raise_if_stored()
 *     if c_dtd is NULL:
 *         raise DTDParseError, "error parsing DTD"             # <<<<<<<<<<<<<< 
 *     return c_dtd
 * 
 */
  __Pyx_Raise(__pyx_1, __pyx_k725p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 98; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":99
 *     if c_dtd is NULL:
 *         raise DTDParseError, "error parsing DTD"
 *     return c_dtd             # <<<<<<<<<<<<<< 
 * 
 * cdef extern from "etree_defs.h":
 */
__pyx_r = __pyx_v_c_dtd;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree._parseDtdFromFilelike");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_exc_context);
Py_DECREF(__pyx_v_dtd_parser);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":105
 *     cdef DTD NEW_DTD "PY_NEW" (object t)
 * 
 * cdef DTD _dtdFactory(tree.xmlDtd* c_dtd):             # <<<<<<<<<<<<<< 
 *     # do not run through DTD.__init__()!
 *     cdef DTD dtd
 */

static  struct __pyx_obj_4lxml_5etree_DTD *__pyx_f_4lxml_5etree__dtdFactory(xmlDtd *__pyx_v_c_dtd) {
struct __pyx_obj_4lxml_5etree_DTD *__pyx_v_dtd;
struct __pyx_obj_4lxml_5etree_DTD *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
__pyx_v_dtd = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":108
 *     # do not run through DTD.__init__()!
 *     cdef DTD dtd
 *     if c_dtd is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     dtd = NEW_DTD(DTD)
 */
__pyx_1 = (__pyx_v_c_dtd == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":109
 *     cdef DTD dtd
 *     if c_dtd is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     dtd = NEW_DTD(DTD)
 *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
 */
  Py_INCREF(Py_None);
  __pyx_r = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":110
 *     if c_dtd is NULL:
 *         return None
 *     dtd = NEW_DTD(DTD)             # <<<<<<<<<<<<<< 
 *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
 *     if dtd._c_dtd is NULL:
 */
__pyx_2 = ((PyObject *)PY_NEW(((PyObject*)__pyx_ptype_4lxml_5etree_DTD))); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 110; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_dtd));
__pyx_v_dtd = ((struct __pyx_obj_4lxml_5etree_DTD *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":111
 *         return None
 *     dtd = NEW_DTD(DTD)
 *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)             # <<<<<<<<<<<<<< 
 *     if dtd._c_dtd is NULL:
 *         python.PyErr_NoMemory()
 */
__pyx_v_dtd->_c_dtd = xmlCopyDtd(__pyx_v_c_dtd);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":112
 *     dtd = NEW_DTD(DTD)
 *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
 *     if dtd._c_dtd is NULL:             # <<<<<<<<<<<<<< 
 *         python.PyErr_NoMemory()
 *     _Validator.__init__(dtd)
 */
__pyx_1 = (__pyx_v_dtd->_c_dtd == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":113
 *     dtd._c_dtd = tree.xmlCopyDtd(c_dtd)
 *     if dtd._c_dtd is NULL:
 *         python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 *     _Validator.__init__(dtd)
 *     return dtd
 */
  __pyx_2 = PyErr_NoMemory(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 113; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":114
 *     if dtd._c_dtd is NULL:
 *         python.PyErr_NoMemory()
 *     _Validator.__init__(dtd)             # <<<<<<<<<<<<<< 
 *     return dtd
 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__Validator), __pyx_n___init__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 114; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":114
 *     if dtd._c_dtd is NULL:
 *         python.PyErr_NoMemory()
 *     _Validator.__init__(dtd)             # <<<<<<<<<<<<<< 
 *     return dtd
 */
__pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 114; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_dtd));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_dtd));
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":115
 *         python.PyErr_NoMemory()
 *     _Validator.__init__(dtd)
 *     return dtd             # <<<<<<<<<<<<<< 
 */
Py_INCREF(((PyObject *)__pyx_v_dtd));
__pyx_r = __pyx_v_dtd;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_4lxml_5etree_DTD *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree._dtdFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_dtd);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":27
 *     """
 *     cdef relaxng.xmlRelaxNG* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */

static PyObject *__pyx_k727p;
static PyObject *__pyx_k728p;
static PyObject *__pyx_k729p;
static PyObject *__pyx_k730p;

static char __pyx_k726[] = "http://relaxng.org/ns/structure/1.0";
static char __pyx_k727[] = "Document is not Relax NG";
static char __pyx_k728[] = "No tree or file given";
static char __pyx_k729[] = "Document is not parsable as Relax NG";
static char __pyx_k730[] = "Document is not valid Relax NG";

static int __pyx_pf_4lxml_5etree_7RelaxNG___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_7RelaxNG___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_v_file = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlNode *__pyx_v_c_node;
xmlDoc *__pyx_v_fake_c_doc;
char *__pyx_v_c_href;
xmlRelaxNGParserCtxt *__pyx_v_parser_ctxt;
PyObject *__pyx_v_filename;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
xmlDoc *__pyx_5;
static char *__pyx_argnames[] = {"etree","file",0};
__pyx_v_etree = __pyx_k303;
__pyx_v_file = __pyx_k304;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_etree, &__pyx_v_file))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
Py_INCREF(__pyx_v_file);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":34
 *         cdef char* c_href
 *         cdef relaxng.xmlRelaxNGParserCtxt* parser_ctxt
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__Validator), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 34; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":34
 *         cdef char* c_href
 *         cdef relaxng.xmlRelaxNGParserCtxt* parser_ctxt
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 34; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 34; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":35
 *         cdef relaxng.xmlRelaxNGParserCtxt* parser_ctxt
 *         _Validator.__init__(self)
 *         self._c_schema = NULL             # <<<<<<<<<<<<<< 
 *         fake_c_doc = NULL
 *         if etree is not None:
 */
((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":36
 *         _Validator.__init__(self)
 *         self._c_schema = NULL
 *         fake_c_doc = NULL             # <<<<<<<<<<<<<< 
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 */
__pyx_v_fake_c_doc = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":37
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 *         if etree is not None:             # <<<<<<<<<<<<<< 
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)
 */
__pyx_4 = (__pyx_v_etree != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":38
 *         fake_c_doc = NULL
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *             root_node = _rootNodeOrRaise(etree)
 *             c_node = root_node._c_node
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":39
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 *             c_node = root_node._c_node
 *             # work around for libxml2 crash bug if document is not RNG at all
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root_node));
  __pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":40
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)
 *             c_node = root_node._c_node             # <<<<<<<<<<<<<< 
 *             # work around for libxml2 crash bug if document is not RNG at all
 *             if _LIBXML_VERSION_INT < 20624:
 */
  __pyx_v_c_node = __pyx_v_root_node->_c_node;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":42
 *             c_node = root_node._c_node
 *             # work around for libxml2 crash bug if document is not RNG at all
 *             if _LIBXML_VERSION_INT < 20624:             # <<<<<<<<<<<<<< 
 *                 c_href = _getNs(c_node)
 *                 if c_href is NULL or \
 */
  __pyx_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20624);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":43
 *             # work around for libxml2 crash bug if document is not RNG at all
 *             if _LIBXML_VERSION_INT < 20624:
 *                 c_href = _getNs(c_node)             # <<<<<<<<<<<<<< 
 *                 if c_href is NULL or \
 *                        cstd.strcmp(c_href,
 */
    __pyx_v_c_href = _getNs(__pyx_v_c_node);

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":44
 *             if _LIBXML_VERSION_INT < 20624:
 *                 c_href = _getNs(c_node)
 *                 if c_href is NULL or \             # <<<<<<<<<<<<<< 
 *                        cstd.strcmp(c_href,
 *                                    'http://relaxng.org/ns/structure/1.0') != 0:
 */
    __pyx_4 = (__pyx_v_c_href == NULL);
    if (!__pyx_4) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":46
 *                 if c_href is NULL or \
 *                        cstd.strcmp(c_href,
 *                                    'http://relaxng.org/ns/structure/1.0') != 0:             # <<<<<<<<<<<<<< 
 *                     raise RelaxNGParseError, "Document is not Relax NG"
 *             self._error_log.connect()
 */
      __pyx_4 = (strcmp(__pyx_v_c_href,__pyx_k726) != 0);
    }
    if (__pyx_4) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":47
 *                        cstd.strcmp(c_href,
 *                                    'http://relaxng.org/ns/structure/1.0') != 0:
 *                     raise RelaxNGParseError, "Document is not Relax NG"             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
      __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 47; goto __pyx_L1;}

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":47
 *                        cstd.strcmp(c_href,
 *                                    'http://relaxng.org/ns/structure/1.0') != 0:
 *                     raise RelaxNGParseError, "Document is not Relax NG"             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
      __Pyx_Raise(__pyx_3, __pyx_k727p, 0);
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      {__pyx_filename = __pyx_f[16]; __pyx_lineno = 47; goto __pyx_L1;}
      goto __pyx_L4;
    }
    __pyx_L4:;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":48
 *                                    'http://relaxng.org/ns/structure/1.0') != 0:
 *                     raise RelaxNGParseError, "Document is not Relax NG"
 *             self._error_log.connect()             # <<<<<<<<<<<<<< 
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":49
 *                     raise RelaxNGParseError, "Document is not Relax NG"
 *             self._error_log.connect()
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:
 */
  __pyx_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 49; goto __pyx_L1;}
  __pyx_v_fake_c_doc = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":50
 *             self._error_log.connect()
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)             # <<<<<<<<<<<<<< 
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 */
  __pyx_v_parser_ctxt = xmlRelaxNGNewDocParserCtxt(__pyx_v_fake_c_doc);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":51
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:             # <<<<<<<<<<<<<< 
 *             filename = _getFilenameForFile(file)
 *             if filename is None:
 */
__pyx_4 = (__pyx_v_file != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":52
 *             parser_ctxt = relaxng.xmlRelaxNGNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)             # <<<<<<<<<<<<<< 
 *             if filename is None:
 *                 # XXX assume a string object
 */
  __pyx_1 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_file); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":53
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 *             if filename is None:             # <<<<<<<<<<<<<< 
 *                 # XXX assume a string object
 *                 filename = file
 */
  __pyx_4 = (__pyx_v_filename == Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":55
 *             if filename is None:
 *                 # XXX assume a string object
 *                 filename = file             # <<<<<<<<<<<<<< 
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()
 */
    Py_INCREF(__pyx_v_file);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_v_file;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":56
 *                 # XXX assume a string object
 *                 filename = file
 *             filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
 */
  __pyx_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 56; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":57
 *                 filename = file
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()             # <<<<<<<<<<<<<< 
 *             parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
 *         else:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":58
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()
 *             parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<< 
 *         else:
 *             raise RelaxNGParseError, "No tree or file given"
 */
  __pyx_v_parser_ctxt = xmlRelaxNGNewParserCtxt(_cstr(__pyx_v_filename));
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":60
 *             parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
 *         else:
 *             raise RelaxNGParseError, "No tree or file given"             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is NULL:
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 60; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":60
 *             parser_ctxt = relaxng.xmlRelaxNGNewParserCtxt(_cstr(filename))
 *         else:
 *             raise RelaxNGParseError, "No tree or file given"             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is NULL:
 */
  __Pyx_Raise(__pyx_3, __pyx_k728p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 60; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":62
 *             raise RelaxNGParseError, "No tree or file given"
 * 
 *         if parser_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             self._error_log.disconnect()
 *             if fake_c_doc is not NULL:
 */
__pyx_4 = (__pyx_v_parser_ctxt == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":63
 * 
 *         if parser_ctxt is NULL:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             if fake_c_doc is not NULL:
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":64
 *         if parser_ctxt is NULL:
 *             self._error_log.disconnect()
 *             if fake_c_doc is not NULL:             # <<<<<<<<<<<<<< 
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"
 */
  __pyx_4 = (__pyx_v_fake_c_doc != NULL);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":65
 *             self._error_log.disconnect()
 *             if fake_c_doc is not NULL:
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<< 
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"
 *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
 */
    __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":66
 *             if fake_c_doc is not NULL:
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"             # <<<<<<<<<<<<<< 
 *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
 *         self._error_log.disconnect()
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 66; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":66
 *             if fake_c_doc is not NULL:
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"             # <<<<<<<<<<<<<< 
 *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
 *         self._error_log.disconnect()
 */
  __Pyx_Raise(__pyx_1, __pyx_k729p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 66; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":67
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"
 *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)             # <<<<<<<<<<<<<< 
 *         self._error_log.disconnect()
 * 
 */
((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema = xmlRelaxNGParse(__pyx_v_parser_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":68
 *             raise RelaxNGParseError, "Document is not parsable as Relax NG"
 *         self._c_schema = relaxng.xmlRelaxNGParse(parser_ctxt)
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 * 
 *         if _LIBXML_VERSION_INT >= 20624:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":70
 *         self._error_log.disconnect()
 * 
 *         if _LIBXML_VERSION_INT >= 20624:             # <<<<<<<<<<<<<< 
 *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *         if self._c_schema is NULL:
 */
__pyx_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20624);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":71
 * 
 *         if _LIBXML_VERSION_INT >= 20624:
 *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<< 
 *         if self._c_schema is NULL:
 *             if fake_c_doc is not NULL:
 */
  xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":72
 *         if _LIBXML_VERSION_INT >= 20624:
 *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *         if self._c_schema is NULL:             # <<<<<<<<<<<<<< 
 *             if fake_c_doc is not NULL:
 *                 if _LIBXML_VERSION_INT < 20624:
 */
__pyx_4 = (((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":73
 *             relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *         if self._c_schema is NULL:
 *             if fake_c_doc is not NULL:             # <<<<<<<<<<<<<< 
 *                 if _LIBXML_VERSION_INT < 20624:
 *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 */
  __pyx_4 = (__pyx_v_fake_c_doc != NULL);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":74
 *         if self._c_schema is NULL:
 *             if fake_c_doc is not NULL:
 *                 if _LIBXML_VERSION_INT < 20624:             # <<<<<<<<<<<<<< 
 *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 */
    __pyx_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT < 20624);
    if (__pyx_4) {

      /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":75
 *             if fake_c_doc is not NULL:
 *                 if _LIBXML_VERSION_INT < 20624:
 *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<< 
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, self._error_log._buildExceptionMessage(
 */
      xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);
      goto __pyx_L11;
    }
    __pyx_L11:;

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":76
 *                 if _LIBXML_VERSION_INT < 20624:
 *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<< 
 *             raise RelaxNGParseError, self._error_log._buildExceptionMessage(
 *                 "Document is not valid Relax NG")
 */
    __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":77
 *                     relaxng.xmlRelaxNGFreeParserCtxt(parser_ctxt)
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<< 
 *                 "Document is not valid Relax NG")
 *         if fake_c_doc is not NULL:
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 77; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":78
 *                 _destroyFakeDoc(doc._c_doc, fake_c_doc)
 *             raise RelaxNGParseError, self._error_log._buildExceptionMessage(
 *                 "Document is not valid Relax NG")             # <<<<<<<<<<<<<< 
 *         if fake_c_doc is not NULL:
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
 */
  __pyx_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),__pyx_k730p); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 77; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_3, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 77; goto __pyx_L1;}
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":79
 *             raise RelaxNGParseError, self._error_log._buildExceptionMessage(
 *                 "Document is not valid Relax NG")
 *         if fake_c_doc is not NULL:             # <<<<<<<<<<<<<< 
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
 * 
 */
__pyx_4 = (__pyx_v_fake_c_doc != NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":80
 *                 "Document is not valid Relax NG")
 *         if fake_c_doc is not NULL:
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
  __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
  goto __pyx_L12;
}
__pyx_L12:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.RelaxNG.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":82
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         relaxng.xmlRelaxNGFree(self._c_schema)
 * 
 */

static void __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(PyObject *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":83
 * 
 *     def __dealloc__(self):
 *         relaxng.xmlRelaxNGFree(self._c_schema)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, etree):
 */
xmlRelaxNGFree(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":85
 *         relaxng.xmlRelaxNGFree(self._c_schema)
 * 
 *     def __call__(self, etree):             # <<<<<<<<<<<<<< 
 *         """Validate doc using Relax NG.
 * 
 */

static PyObject *__pyx_k731p;

static char __pyx_k731[] = "Internal error in Relax NG validation";

static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_7RelaxNG___call__[] = "Validate doc using Relax NG.\n\n        Returns true if document is valid, false if not.";
static PyObject *__pyx_pf_4lxml_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_c_doc;
xmlRelaxNGValidCtxt *__pyx_v_valid_ctxt;
int __pyx_v_ret;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"etree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":95
 *         cdef int ret
 * 
 *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(etree)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 95; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":96
 * 
 *         doc = _documentOrRaise(etree)
 *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":98
 *         root_node = _rootNodeOrRaise(etree)
 * 
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":99
 * 
 *         self._error_log.connect()
 *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)             # <<<<<<<<<<<<<< 
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 */
__pyx_v_valid_ctxt = xmlRelaxNGNewValidCtxt(((struct __pyx_obj_4lxml_5etree_RelaxNG *)__pyx_v_self)->_c_schema);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":100
 *         self._error_log.connect()
 *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             self._error_log.disconnect()
 *             python.PyErr_NoMemory()
 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":101
 *         valid_ctxt = relaxng.xmlRelaxNGNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 * 
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":102
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
  __pyx_1 = PyErr_NoMemory(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 102; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":104
 *             python.PyErr_NoMemory()
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
 */
__pyx_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":105
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":106
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:
 *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<< 
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 */
    __pyx_v_ret = xmlRelaxNGValidateDoc(__pyx_v_valid_ctxt,__pyx_v_c_doc);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":107
 *         with nogil:
 *             ret = relaxng.xmlRelaxNGValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 * 
 *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)
 */
__pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":109
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.disconnect()
 */
xmlRelaxNGFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":111
 *         relaxng.xmlRelaxNGFreeValidCtxt(valid_ctxt)
 * 
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *         if ret == -1:
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":112
 * 
 *         self._error_log.disconnect()
 *         if ret == -1:             # <<<<<<<<<<<<<< 
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"
 *         if ret == 0:
 */
__pyx_2 = (__pyx_v_ret == -1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":113
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"             # <<<<<<<<<<<<<< 
 *         if ret == 0:
 *             return True
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGValidateError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 113; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":113
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"             # <<<<<<<<<<<<<< 
 *         if ret == 0:
 *             return True
 */
  __Pyx_Raise(__pyx_1, __pyx_k731p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 113; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":114
 *         if ret == -1:
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"
 *         if ret == 0:             # <<<<<<<<<<<<<< 
 *             return True
 *         else:
 */
__pyx_2 = (__pyx_v_ret == 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":115
 *             raise RelaxNGValidateError, "Internal error in Relax NG validation"
 *         if ret == 0:
 *             return True             # <<<<<<<<<<<<<< 
 *         else:
 *             return False
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":117
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<< 
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.RelaxNG.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":26
 *     """
 *     cdef xmlschema.xmlSchema* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */

static PyObject *__pyx_k733p;
static PyObject *__pyx_k734p;
static PyObject *__pyx_k735p;

static char __pyx_k732[] = "http://www.w3.org/2001/XMLSchema";
static char __pyx_k733[] = "Document is not XML Schema";
static char __pyx_k734[] = "No tree or file given";
static char __pyx_k735[] = "Document is not valid XML Schema";

static int __pyx_pf_4lxml_5etree_9XMLSchema___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_9XMLSchema___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_v_file = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_fake_c_doc;
xmlNode *__pyx_v_c_node;
char *__pyx_v_c_href;
xmlSchemaParserCtxt *__pyx_v_parser_ctxt;
PyObject *__pyx_v_filename;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
xmlDoc *__pyx_5;
static char *__pyx_argnames[] = {"etree","file",0};
__pyx_v_etree = __pyx_k311;
__pyx_v_file = __pyx_k312;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_etree, &__pyx_v_file))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
Py_INCREF(__pyx_v_file);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":33
 *         cdef char* c_href
 *         cdef xmlschema.xmlSchemaParserCtxt* parser_ctxt
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__Validator), __pyx_n___init__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 33; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":33
 *         cdef char* c_href
 *         cdef xmlschema.xmlSchemaParserCtxt* parser_ctxt
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 33; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":34
 *         cdef xmlschema.xmlSchemaParserCtxt* parser_ctxt
 *         _Validator.__init__(self)
 *         self._c_schema = NULL             # <<<<<<<<<<<<<< 
 *         fake_c_doc = NULL
 *         if etree is not None:
 */
((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":35
 *         _Validator.__init__(self)
 *         self._c_schema = NULL
 *         fake_c_doc = NULL             # <<<<<<<<<<<<<< 
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 */
__pyx_v_fake_c_doc = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":36
 *         self._c_schema = NULL
 *         fake_c_doc = NULL
 *         if etree is not None:             # <<<<<<<<<<<<<< 
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)
 */
__pyx_4 = (__pyx_v_etree != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":37
 *         fake_c_doc = NULL
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *             root_node = _rootNodeOrRaise(etree)
 * 
 */
  __pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 37; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":38
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 * 
 *             # work around for libxml2 bug if document is not XML schema at all
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root_node));
  __pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":42
 *             # work around for libxml2 bug if document is not XML schema at all
 *             #if _LIBXML_VERSION_INT < 20624:
 *             c_node = root_node._c_node             # <<<<<<<<<<<<<< 
 *             c_href = _getNs(c_node)
 *             if c_href is NULL or \
 */
  __pyx_v_c_node = __pyx_v_root_node->_c_node;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":43
 *             #if _LIBXML_VERSION_INT < 20624:
 *             c_node = root_node._c_node
 *             c_href = _getNs(c_node)             # <<<<<<<<<<<<<< 
 *             if c_href is NULL or \
 *                    cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
 */
  __pyx_v_c_href = _getNs(__pyx_v_c_node);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":44
 *             c_node = root_node._c_node
 *             c_href = _getNs(c_node)
 *             if c_href is NULL or \             # <<<<<<<<<<<<<< 
 *                    cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
 *                 raise XMLSchemaParseError, "Document is not XML Schema"
 */
  __pyx_4 = (__pyx_v_c_href == NULL);
  if (!__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":45
 *             c_href = _getNs(c_node)
 *             if c_href is NULL or \
 *                    cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:             # <<<<<<<<<<<<<< 
 *                 raise XMLSchemaParseError, "Document is not XML Schema"
 * 
 */
    __pyx_4 = (strcmp(__pyx_v_c_href,__pyx_k732) != 0);
  }
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":46
 *             if c_href is NULL or \
 *                    cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
 *                 raise XMLSchemaParseError, "Document is not XML Schema"             # <<<<<<<<<<<<<< 
 * 
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 46; goto __pyx_L1;}

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":46
 *             if c_href is NULL or \
 *                    cstd.strcmp(c_href, 'http://www.w3.org/2001/XMLSchema') != 0:
 *                 raise XMLSchemaParseError, "Document is not XML Schema"             # <<<<<<<<<<<<<< 
 * 
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
    __Pyx_Raise(__pyx_3, __pyx_k733p, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[17]; __pyx_lineno = 46; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":48
 *                 raise XMLSchemaParseError, "Document is not XML Schema"
 * 
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
 */
  __pyx_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 48; goto __pyx_L1;}
  __pyx_v_fake_c_doc = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":49
 * 
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *             self._error_log.connect()             # <<<<<<<<<<<<<< 
 *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":50
 *             fake_c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *             self._error_log.connect()
 *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)             # <<<<<<<<<<<<<< 
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 */
  __pyx_v_parser_ctxt = xmlSchemaNewDocParserCtxt(__pyx_v_fake_c_doc);
  goto __pyx_L2;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":51
 *             self._error_log.connect()
 *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:             # <<<<<<<<<<<<<< 
 *             filename = _getFilenameForFile(file)
 *             if filename is None:
 */
__pyx_4 = (__pyx_v_file != Py_None);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":52
 *             parser_ctxt = xmlschema.xmlSchemaNewDocParserCtxt(fake_c_doc)
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)             # <<<<<<<<<<<<<< 
 *             if filename is None:
 *                 # XXX assume a string object
 */
  __pyx_1 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_file); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 52; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_1;
  __pyx_1 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":53
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 *             if filename is None:             # <<<<<<<<<<<<<< 
 *                 # XXX assume a string object
 *                 filename = file
 */
  __pyx_4 = (__pyx_v_filename == Py_None);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":55
 *             if filename is None:
 *                 # XXX assume a string object
 *                 filename = file             # <<<<<<<<<<<<<< 
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()
 */
    Py_INCREF(__pyx_v_file);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_v_file;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":56
 *                 # XXX assume a string object
 *                 filename = file
 *             filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 *             self._error_log.connect()
 *             parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
 */
  __pyx_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 56; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":57
 *                 filename = file
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()             # <<<<<<<<<<<<<< 
 *             parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
 *         else:
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":58
 *             filename = _encodeFilename(filename)
 *             self._error_log.connect()
 *             parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<< 
 *         else:
 *             raise XMLSchemaParseError, "No tree or file given"
 */
  __pyx_v_parser_ctxt = xmlSchemaNewParserCtxt(_cstr(__pyx_v_filename));
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":60
 *             parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
 *         else:
 *             raise XMLSchemaParseError, "No tree or file given"             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is not NULL:
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 60; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":60
 *             parser_ctxt = xmlschema.xmlSchemaNewParserCtxt(_cstr(filename))
 *         else:
 *             raise XMLSchemaParseError, "No tree or file given"             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is not NULL:
 */
  __Pyx_Raise(__pyx_3, __pyx_k734p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[17]; __pyx_lineno = 60; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":62
 *             raise XMLSchemaParseError, "No tree or file given"
 * 
 *         if parser_ctxt is not NULL:             # <<<<<<<<<<<<<< 
 *             self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
 *             if _LIBXML_VERSION_INT >= 20624:
 */
__pyx_4 = (__pyx_v_parser_ctxt != NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":63
 * 
 *         if parser_ctxt is not NULL:
 *             self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)             # <<<<<<<<<<<<<< 
 *             if _LIBXML_VERSION_INT >= 20624:
 *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
 */
  ((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema = xmlSchemaParse(__pyx_v_parser_ctxt);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":64
 *         if parser_ctxt is not NULL:
 *             self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
 *             if _LIBXML_VERSION_INT >= 20624:             # <<<<<<<<<<<<<< 
 *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
 * 
 */
  __pyx_4 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT >= 20624);
  if (__pyx_4) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":65
 *             self._c_schema = xmlschema.xmlSchemaParse(parser_ctxt)
 *             if _LIBXML_VERSION_INT >= 20624:
 *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.disconnect()
 */
    xmlSchemaFreeParserCtxt(__pyx_v_parser_ctxt);
    goto __pyx_L6;
  }
  __pyx_L6:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":67
 *                 xmlschema.xmlSchemaFreeParserCtxt(parser_ctxt)
 * 
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 * 
 *         if fake_c_doc is not NULL:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":69
 *         self._error_log.disconnect()
 * 
 *         if fake_c_doc is not NULL:             # <<<<<<<<<<<<<< 
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
 * 
 */
__pyx_4 = (__pyx_v_fake_c_doc != NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":70
 * 
 *         if fake_c_doc is not NULL:
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)             # <<<<<<<<<<<<<< 
 * 
 *         if self._c_schema is NULL:
 */
  __pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":72
 *             _destroyFakeDoc(doc._c_doc, fake_c_doc)
 * 
 *         if self._c_schema is NULL:             # <<<<<<<<<<<<<< 
 *             raise XMLSchemaParseError, self._error_log._buildExceptionMessage(
 *                 "Document is not valid XML Schema")
 */
__pyx_4 = (((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema == NULL);
if (__pyx_4) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":73
 * 
 *         if self._c_schema is NULL:
 *             raise XMLSchemaParseError, self._error_log._buildExceptionMessage(             # <<<<<<<<<<<<<< 
 *                 "Document is not valid XML Schema")
 * 
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 73; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":74
 *         if self._c_schema is NULL:
 *             raise XMLSchemaParseError, self._error_log._buildExceptionMessage(
 *                 "Document is not valid XML Schema")             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
  __pyx_2 = ((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),__pyx_k735p); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 73; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_2, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[17]; __pyx_lineno = 73; goto __pyx_L1;}
  goto __pyx_L8;
}
__pyx_L8:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("lxml.etree.XMLSchema.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":76
 *                 "Document is not valid XML Schema")
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         xmlschema.xmlSchemaFree(self._c_schema)
 * 
 */

static void __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(PyObject *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":77
 * 
 *     def __dealloc__(self):
 *         xmlschema.xmlSchemaFree(self._c_schema)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, etree):
 */
xmlSchemaFree(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":79
 *         xmlschema.xmlSchemaFree(self._c_schema)
 * 
 *     def __call__(self, etree):             # <<<<<<<<<<<<<< 
 *         """Validate doc using XML Schema.
 * 
 */

static PyObject *__pyx_k736p;
static PyObject *__pyx_k737p;

static char __pyx_k736[] = "Failed to create validation context";
static char __pyx_k737[] = "Internal error in XML Schema validation.";

static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_9XMLSchema___call__[] = "Validate doc using XML Schema.\n\n        Returns true if document is valid, false if not.\n        ";
static PyObject *__pyx_pf_4lxml_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
xmlSchemaValidCtxt *__pyx_v_valid_ctxt;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_c_doc;
int __pyx_v_ret;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
xmlDoc *__pyx_3;
static char *__pyx_argnames[] = {"etree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":90
 *         cdef int ret
 * 
 *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(etree)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 90; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":91
 * 
 *         doc = _documentOrRaise(etree)
 *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 91; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":93
 *         root_node = _rootNodeOrRaise(etree)
 * 
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":94
 * 
 *         self._error_log.connect()
 *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)             # <<<<<<<<<<<<<< 
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 */
__pyx_v_valid_ctxt = xmlSchemaNewValidCtxt(((struct __pyx_obj_4lxml_5etree_XMLSchema *)__pyx_v_self)->_c_schema);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":95
 *         self._error_log.connect()
 *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             self._error_log.disconnect()
 *             raise XMLSchemaError, "Failed to create validation context"
 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":96
 *         valid_ctxt = xmlschema.xmlSchemaNewValidCtxt(self._c_schema)
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *             raise XMLSchemaError, "Failed to create validation context"
 * 
 */
  ((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);

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":97
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 *             raise XMLSchemaError, "Failed to create validation context"             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 97; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":97
 *         if valid_ctxt is NULL:
 *             self._error_log.disconnect()
 *             raise XMLSchemaError, "Failed to create validation context"             # <<<<<<<<<<<<<< 
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 */
  __Pyx_Raise(__pyx_1, __pyx_k736p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[17]; __pyx_lineno = 97; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":99
 *             raise XMLSchemaError, "Failed to create validation context"
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
 */
__pyx_3 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_3 == NULL)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 99; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":100
 * 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":101
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:
 *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<< 
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 */
    __pyx_v_ret = xmlSchemaValidateDoc(__pyx_v_valid_ctxt,__pyx_v_c_doc);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":102
 *         with nogil:
 *             ret = xmlschema.xmlSchemaValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 * 
 *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)
 */
__pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":104
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 * 
 *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.disconnect()
 */
xmlSchemaFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":106
 *         xmlschema.xmlSchemaFreeValidCtxt(valid_ctxt)
 * 
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 *         if ret == -1:
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":107
 * 
 *         self._error_log.disconnect()
 *         if ret == -1:             # <<<<<<<<<<<<<< 
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."
 *         if ret == 0:
 */
__pyx_2 = (__pyx_v_ret == -1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":108
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."             # <<<<<<<<<<<<<< 
 *         if ret == 0:
 *             return True
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaValidateError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":108
 *         self._error_log.disconnect()
 *         if ret == -1:
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."             # <<<<<<<<<<<<<< 
 *         if ret == 0:
 *             return True
 */
  __Pyx_Raise(__pyx_1, __pyx_k737p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[17]; __pyx_lineno = 108; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":109
 *         if ret == -1:
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."
 *         if ret == 0:             # <<<<<<<<<<<<<< 
 *             return True
 *         else:
 */
__pyx_2 = (__pyx_v_ret == 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":110
 *             raise XMLSchemaValidateError, "Internal error in XML Schema validation."
 *         if ret == 0:
 *             return True             # <<<<<<<<<<<<<< 
 *         else:
 *             return False
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":112
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<< 
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.XMLSchema.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":76
 *     """
 *     cdef schematron.xmlSchematron* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */

static PyObject *__pyx_k738p;
static PyObject *__pyx_k739p;
static PyObject *__pyx_k740p;

static char __pyx_k738[] = "lxml.etree was compiled without Schematron support.";
static char __pyx_k739[] = "No tree or file given";
static char __pyx_k740[] = "Document is not a valid Schematron schema";

static int __pyx_pf_4lxml_5etree_10Schematron___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_4lxml_5etree_10Schematron___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_v_file = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_c_doc;
xmlSchematronParserCtxt *__pyx_v_parser_ctxt;
PyObject *__pyx_v_filename;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
xmlDoc *__pyx_5;
static char *__pyx_argnames[] = {"etree","file",0};
__pyx_v_etree = __pyx_k319;
__pyx_v_file = __pyx_k320;
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_etree, &__pyx_v_file))) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
Py_INCREF(__pyx_v_file);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":83
 *         cdef char* c_href
 *         cdef schematron.xmlSchematronParserCtxt* parser_ctxt
 *         if not config.ENABLE_SCHEMATRON:             # <<<<<<<<<<<<<< 
 *             raise SchematronError(
 *                 "lxml.etree was compiled without Schematron support.")
 */
__pyx_1 = (!ENABLE_SCHEMATRON);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":84
 *         cdef schematron.xmlSchematronParserCtxt* parser_ctxt
 *         if not config.ENABLE_SCHEMATRON:
 *             raise SchematronError(             # <<<<<<<<<<<<<< 
 *                 "lxml.etree was compiled without Schematron support.")
 *         self._c_schema = NULL
 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 84; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":85
 *         if not config.ENABLE_SCHEMATRON:
 *             raise SchematronError(
 *                 "lxml.etree was compiled without Schematron support.")             # <<<<<<<<<<<<<< 
 *         self._c_schema = NULL
 *         if etree is not None:
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_INCREF(__pyx_k738p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k738p);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, 0, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[18]; __pyx_lineno = 84; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":86
 *             raise SchematronError(
 *                 "lxml.etree was compiled without Schematron support.")
 *         self._c_schema = NULL             # <<<<<<<<<<<<<< 
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 */
((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":87
 *                 "lxml.etree was compiled without Schematron support.")
 *         self._c_schema = NULL
 *         if etree is not None:             # <<<<<<<<<<<<<< 
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)
 */
__pyx_1 = (__pyx_v_etree != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":88
 *         self._c_schema = NULL
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *             root_node = _rootNodeOrRaise(etree)
 *             c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
 */
  __pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 88; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":89
 *         if etree is not None:
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 *             c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
 *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(c_doc)
 */
  __pyx_3 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 89; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root_node));
  __pyx_v_root_node = ((struct LxmlElement *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":90
 *             doc = _documentOrRaise(etree)
 *             root_node = _rootNodeOrRaise(etree)
 *             c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(c_doc)
 *         elif file is not None:
 */
  __pyx_5 = __pyx_f_4lxml_5etree__copyDocRoot(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 90; goto __pyx_L1;}
  __pyx_v_c_doc = __pyx_5;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":91
 *             root_node = _rootNodeOrRaise(etree)
 *             c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
 *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(c_doc)             # <<<<<<<<<<<<<< 
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 */
  __pyx_v_parser_ctxt = xmlSchematronNewDocParserCtxt(__pyx_v_c_doc);
  goto __pyx_L3;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":92
 *             c_doc = _copyDocRoot(doc._c_doc, root_node._c_node)
 *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(c_doc)
 *         elif file is not None:             # <<<<<<<<<<<<<< 
 *             filename = _getFilenameForFile(file)
 *             if filename is None:
 */
__pyx_1 = (__pyx_v_file != Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":93
 *             parser_ctxt = schematron.xmlSchematronNewDocParserCtxt(c_doc)
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)             # <<<<<<<<<<<<<< 
 *             if filename is None:
 *                 # XXX assume a string object
 */
  __pyx_4 = __pyx_f_4lxml_5etree__getFilenameForFile(__pyx_v_file); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 93; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_4;
  __pyx_4 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":94
 *         elif file is not None:
 *             filename = _getFilenameForFile(file)
 *             if filename is None:             # <<<<<<<<<<<<<< 
 *                 # XXX assume a string object
 *                 filename = file
 */
  __pyx_1 = (__pyx_v_filename == Py_None);
  if (__pyx_1) {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":96
 *             if filename is None:
 *                 # XXX assume a string object
 *                 filename = file             # <<<<<<<<<<<<<< 
 *             filename = _encodeFilename(filename)
 *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
 */
    Py_INCREF(__pyx_v_file);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_v_file;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":97
 *                 # XXX assume a string object
 *                 filename = file
 *             filename = _encodeFilename(filename)             # <<<<<<<<<<<<<< 
 *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
 *             c_doc = NULL
 */
  __pyx_2 = __pyx_f_4lxml_5etree__encodeFilename(__pyx_v_filename); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 97; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":98
 *                 filename = file
 *             filename = _encodeFilename(filename)
 *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))             # <<<<<<<<<<<<<< 
 *             c_doc = NULL
 *         else:
 */
  __pyx_v_parser_ctxt = xmlSchematronNewParserCtxt(_cstr(__pyx_v_filename));

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":99
 *             filename = _encodeFilename(filename)
 *             parser_ctxt = schematron.xmlSchematronNewParserCtxt(_cstr(filename))
 *             c_doc = NULL             # <<<<<<<<<<<<<< 
 *         else:
 *             raise SchematronParseError("No tree or file given")
 */
  __pyx_v_c_doc = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":101
 *             c_doc = NULL
 *         else:
 *             raise SchematronParseError("No tree or file given")             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is NULL:
 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronParseError); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 101; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":101
 *             c_doc = NULL
 *         else:
 *             raise SchematronParseError("No tree or file given")             # <<<<<<<<<<<<<< 
 * 
 *         if parser_ctxt is NULL:
 */
  __pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_INCREF(__pyx_k739p);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k739p);
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[18]; __pyx_lineno = 101; goto __pyx_L1;}
}
__pyx_L3:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":103
 *             raise SchematronParseError("No tree or file given")
 * 
 *         if parser_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             python.PyErr_NoMemory()
 * 
 */
__pyx_1 = (__pyx_v_parser_ctxt == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":104
 * 
 *         if parser_ctxt is NULL:
 *             python.PyErr_NoMemory()             # <<<<<<<<<<<<<< 
 * 
 *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
 */
  __pyx_3 = PyErr_NoMemory(); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":106
 *             python.PyErr_NoMemory()
 * 
 *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
 */
((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema = xmlSchematronParse(__pyx_v_parser_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":108
 *         self._c_schema = schematron.xmlSchematronParse(parser_ctxt)
 * 
 *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)             # <<<<<<<<<<<<<< 
 *         if self._c_schema is NULL:
 *             raise SchematronParseError(
 */
xmlSchematronFreeParserCtxt(__pyx_v_parser_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":109
 * 
 *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
 *         if self._c_schema is NULL:             # <<<<<<<<<<<<<< 
 *             raise SchematronParseError(
 *                 "Document is not a valid Schematron schema")
 */
__pyx_1 = (((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":110
 *         schematron.xmlSchematronFreeParserCtxt(parser_ctxt)
 *         if self._c_schema is NULL:
 *             raise SchematronParseError(             # <<<<<<<<<<<<<< 
 *                 "Document is not a valid Schematron schema")
 *         _Validator.__init__(self)
 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronParseError); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 110; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":111
 *         if self._c_schema is NULL:
 *             raise SchematronParseError(
 *                 "Document is not a valid Schematron schema")             # <<<<<<<<<<<<<< 
 *         _Validator.__init__(self)
 * 
 */
  __pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_INCREF(__pyx_k740p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k740p);
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_Raise(__pyx_3, 0, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[18]; __pyx_lineno = 110; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":112
 *             raise SchematronParseError(
 *                 "Document is not a valid Schematron schema")
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_4 = PyObject_GetAttr(((PyObject*)__pyx_ptype_4lxml_5etree__Validator), __pyx_n___init__); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 112; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":112
 *             raise SchematronParseError(
 *                 "Document is not a valid Schematron schema")
 *         _Validator.__init__(self)             # <<<<<<<<<<<<<< 
 * 
 *     def __dealloc__(self):
 */
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 112; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 112; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.Schematron.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":114
 *         _Validator.__init__(self)
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<< 
 *         schematron.xmlSchematronFree(self._c_schema)
 * 
 */

static void __pyx_pf_4lxml_5etree_10Schematron___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_4lxml_5etree_10Schematron___dealloc__(PyObject *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":115
 * 
 *     def __dealloc__(self):
 *         schematron.xmlSchematronFree(self._c_schema)             # <<<<<<<<<<<<<< 
 * 
 *     def __call__(self, etree):
 */
xmlSchematronFree(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema);

Py_DECREF((PyObject *)__pyx_v_self);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":117
 *         schematron.xmlSchematronFree(self._c_schema)
 * 
 *     def __call__(self, etree):             # <<<<<<<<<<<<<< 
 *         """Validate doc using Schematron.
 * 
 */

static PyObject *__pyx_k741p;
static PyObject *__pyx_k742p;

static char __pyx_k741[] = "Failed to create validation context";
static char __pyx_k742[] = "Internal error in Schematron validation";

static PyObject *__pyx_pf_4lxml_5etree_10Schematron___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_4lxml_5etree_10Schematron___call__[] = "Validate doc using Schematron.\n\n        Returns true if document is valid, false if not.";
static PyObject *__pyx_pf_4lxml_5etree_10Schematron___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
struct LxmlDocument *__pyx_v_doc;
struct LxmlElement *__pyx_v_root_node;
xmlDoc *__pyx_v_c_doc;
xmlSchematronValidCtxt *__pyx_v_valid_ctxt;
int __pyx_v_ret;
int __pyx_v_options;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
xmlDoc *__pyx_5;
static char *__pyx_argnames[] = {"etree",0};
if (unlikely(!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree))) return NULL;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_root_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":128
 *         cdef int options
 * 
 *         doc = _documentOrRaise(etree)             # <<<<<<<<<<<<<< 
 *         root_node = _rootNodeOrRaise(etree)
 * 
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 128; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":129
 * 
 *         doc = _documentOrRaise(etree)
 *         root_node = _rootNodeOrRaise(etree)             # <<<<<<<<<<<<<< 
 * 
 *         options = schematron.XML_SCHEMATRON_OUT_QUIET
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_etree)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 129; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":131
 *         root_node = _rootNodeOrRaise(etree)
 * 
 *         options = schematron.XML_SCHEMATRON_OUT_QUIET             # <<<<<<<<<<<<<< 
 *         #if tree.LIBXML_VERSION <= 20630: # ... and later?
 *         # hack to switch off stderr output
 */
__pyx_v_options = XML_SCHEMATRON_OUT_QUIET;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":134
 *         #if tree.LIBXML_VERSION <= 20630: # ... and later?
 *         # hack to switch off stderr output
 *         options = options | schematron.XML_SCHEMATRON_OUT_XML             # <<<<<<<<<<<<<< 
 * 
 *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
 */
__pyx_v_options = (__pyx_v_options | XML_SCHEMATRON_OUT_XML);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":137
 * 
 *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
 *             self._c_schema, options)             # <<<<<<<<<<<<<< 
 *         if valid_ctxt is NULL:
 *             raise SchematronError("Failed to create validation context")
 */
__pyx_v_valid_ctxt = xmlSchematronNewValidCtxt(((struct __pyx_obj_4lxml_5etree_Schematron *)__pyx_v_self)->_c_schema,__pyx_v_options);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":138
 *         valid_ctxt = schematron.xmlSchematronNewValidCtxt(
 *             self._c_schema, options)
 *         if valid_ctxt is NULL:             # <<<<<<<<<<<<<< 
 *             raise SchematronError("Failed to create validation context")
 * 
 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":139
 *             self._c_schema, options)
 *         if valid_ctxt is NULL:
 *             raise SchematronError("Failed to create validation context")             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 139; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":139
 *             self._c_schema, options)
 *         if valid_ctxt is NULL:
 *             raise SchematronError("Failed to create validation context")             # <<<<<<<<<<<<<< 
 * 
 *         self._error_log.connect()
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_INCREF(__pyx_k741p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k741p);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, 0, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[18]; __pyx_lineno = 139; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":141
 *             raise SchematronError("Failed to create validation context")
 * 
 *         self._error_log.connect()             # <<<<<<<<<<<<<< 
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":142
 * 
 *         self._error_log.connect()
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)             # <<<<<<<<<<<<<< 
 *         with nogil:
 *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
 */
__pyx_5 = __pyx_f_4lxml_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node); if (unlikely(__pyx_5 == NULL)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 142; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_5;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":143
 *         self._error_log.connect()
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:             # <<<<<<<<<<<<<< 
 *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 */
/*with nogil:*/ {
  PyThreadState *_save;
  Py_UNBLOCK_THREADS
  /*try:*/ {

    /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":144
 *         c_doc = _fakeRootDoc(doc._c_doc, root_node._c_node)
 *         with nogil:
 *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)             # <<<<<<<<<<<<<< 
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         self._error_log.disconnect()
 */
    __pyx_v_ret = xmlSchematronValidateDoc(__pyx_v_valid_ctxt,__pyx_v_c_doc);
  }
  /*finally:*/ {
    Py_BLOCK_THREADS
  }
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":145
 *         with nogil:
 *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)             # <<<<<<<<<<<<<< 
 *         self._error_log.disconnect()
 * 
 */
__pyx_f_4lxml_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":146
 *             ret = schematron.xmlSchematronValidateDoc(valid_ctxt, c_doc)
 *         _destroyFakeDoc(doc._c_doc, c_doc)
 *         self._error_log.disconnect()             # <<<<<<<<<<<<<< 
 * 
 *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)
 */
((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);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":148
 *         self._error_log.disconnect()
 * 
 *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)             # <<<<<<<<<<<<<< 
 * 
 *         if ret == -1:
 */
xmlSchematronFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":150
 *         schematron.xmlSchematronFreeValidCtxt(valid_ctxt)
 * 
 *         if ret == -1:             # <<<<<<<<<<<<<< 
 *             raise SchematronValidateError(
 *                 "Internal error in Schematron validation")
 */
__pyx_2 = (__pyx_v_ret == -1);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":151
 * 
 *         if ret == -1:
 *             raise SchematronValidateError(             # <<<<<<<<<<<<<< 
 *                 "Internal error in Schematron validation")
 *         if ret == 0:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronValidateError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 151; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":152
 *         if ret == -1:
 *             raise SchematronValidateError(
 *                 "Internal error in Schematron validation")             # <<<<<<<<<<<<<< 
 *         if ret == 0:
 *             return True
 */
  __pyx_3 = PyTuple_New(1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 151; goto __pyx_L1;}
  Py_INCREF(__pyx_k742p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k742p);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 151; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, 0, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[18]; __pyx_lineno = 151; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":153
 *             raise SchematronValidateError(
 *                 "Internal error in Schematron validation")
 *         if ret == 0:             # <<<<<<<<<<<<<< 
 *             return True
 *         else:
 */
__pyx_2 = (__pyx_v_ret == 0);
if (__pyx_2) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":154
 *                 "Internal error in Schematron validation")
 *         if ret == 0:
 *             return True             # <<<<<<<<<<<<<< 
 *         else:
 *             return False
 */
  Py_INCREF(Py_True);
  __pyx_r = Py_True;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":156
 *             return True
 *         else:
 *             return False             # <<<<<<<<<<<<<< 
 */
  Py_INCREF(Py_False);
  __pyx_r = Py_False;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("lxml.etree.Schematron.__call__");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_root_node);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":3
 * # Public C API for lxml.etree
 * 
 * cdef public api _Element deepcopyNodeToDocument(_Document doc, xmlNode* c_root):             # <<<<<<<<<<<<<< 
 *     "Recursively copy the element into the document. doc is not modified."
 *     cdef xmlNode* c_node
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlElement) *deepcopyNodeToDocument(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_root) {
xmlNode *__pyx_v_c_node;
struct LxmlElement *__pyx_r;
xmlNode *__pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":6
 *     "Recursively copy the element into the document. doc is not modified."
 *     cdef xmlNode* c_node
 *     c_node = _copyNodeToDoc(c_root, doc._c_doc)             # <<<<<<<<<<<<<< 
 *     return _elementFactory(doc, c_node)
 * 
 */
__pyx_1 = __pyx_f_4lxml_5etree__copyNodeToDoc(__pyx_v_c_root,__pyx_v_doc->_c_doc); if (unlikely(__pyx_1 == NULL)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_v_c_node = __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":7
 *     cdef xmlNode* c_node
 *     c_node = _copyNodeToDoc(c_root, doc._c_doc)
 *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _ElementTree elementTreeFactory(_Element context_node):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_r = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.deepcopyNodeToDocument");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":9
 *     return _elementFactory(doc, c_node)
 * 
 * cdef public api _ElementTree elementTreeFactory(_Element context_node):             # <<<<<<<<<<<<<< 
 *     return newElementTree(context_node, _ElementTree)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlElementTree) *elementTreeFactory(struct LxmlElement *__pyx_v_context_node) {
struct LxmlElementTree *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_context_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":10
 * 
 * cdef public api _ElementTree elementTreeFactory(_Element context_node):
 *     return newElementTree(context_node, _ElementTree)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _ElementTree newElementTree(_Element context_node,
 */
__pyx_1 = ((PyObject *)newElementTree(__pyx_v_context_node,((PyObject*)__pyx_ptype_4lxml_5etree__ElementTree))); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_r = ((struct LxmlElementTree *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElementTree *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.elementTreeFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context_node);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":12
 *     return newElementTree(context_node, _ElementTree)
 * 
 * cdef public api _ElementTree newElementTree(_Element context_node,             # <<<<<<<<<<<<<< 
 *                                         object subclass):
 *     if <void*>context_node is NULL or context_node is None:
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlElementTree) *newElementTree(struct LxmlElement *__pyx_v_context_node,PyObject *__pyx_v_subclass) {
struct LxmlElementTree *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_context_node);
Py_INCREF(__pyx_v_subclass);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":14
 * cdef public api _ElementTree newElementTree(_Element context_node,
 *                                         object subclass):
 *     if <void*>context_node is NULL or context_node is None:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 * 
 */
__pyx_1 = (((void *)__pyx_v_context_node) == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":14
 * cdef public api _ElementTree newElementTree(_Element context_node,
 *                                         object subclass):
 *     if <void*>context_node is NULL or context_node is None:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 * 
 */
  __pyx_1 = (((PyObject *)__pyx_v_context_node) == Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":15
 *                                         object subclass):
 *     if <void*>context_node is NULL or context_node is None:
 *         raise TypeError             # <<<<<<<<<<<<<< 
 * 
 *     return _newElementTree(context_node._doc, context_node, subclass)
 */
  __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 15; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":17
 *         raise TypeError
 * 
 *     return _newElementTree(context_node._doc, context_node, subclass)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__newElementTree(__pyx_v_context_node->_doc,__pyx_v_context_node,__pyx_v_subclass)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_r = ((struct LxmlElementTree *)__pyx_2);
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElementTree *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.newElementTree");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context_node);
Py_DECREF(__pyx_v_subclass);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":19
 *     return _newElementTree(context_node._doc, context_node, subclass)
 * 
 * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     if c_node is NULL or doc is None:
 *         raise TypeError
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlElement) *elementFactory(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":20
 * 
 * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
 *     if c_node is NULL or doc is None:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 *     return _elementFactory(doc, c_node)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":20
 * 
 * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
 *     if c_node is NULL or doc is None:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 *     return _elementFactory(doc, c_node)
 */
  __pyx_1 = (((PyObject *)__pyx_v_doc) == Py_None);
}
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":21
 * cdef public api _Element elementFactory(_Document doc, xmlNode* c_node):
 *     if c_node is NULL or doc is None:
 *         raise TypeError             # <<<<<<<<<<<<<< 
 *     return _elementFactory(doc, c_node)
 * 
 */
  __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 21; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":22
 *     if c_node is NULL or doc is None:
 *         raise TypeError
 *     return _elementFactory(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Element makeElement(tag, _Document doc, parser,
 */
__pyx_2 = ((PyObject *)__pyx_f_4lxml_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_r = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.elementFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":24
 *     return _elementFactory(doc, c_node)
 * 
 * cdef public api _Element makeElement(tag, _Document doc, parser,             # <<<<<<<<<<<<<< 
 *                                  text, tail, attrib, nsmap):
 *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)
 */

__PYX_EXTERN_C  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) {
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_doc);
Py_INCREF(__pyx_v_parser);
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_tail);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":26
 * cdef public api _Element makeElement(tag, _Document doc, parser,
 *                                  text, tail, attrib, nsmap):
 *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,
 */
if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_4lxml_5etree__BaseParser)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 26; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":26
 * cdef public api _Element makeElement(tag, _Document doc, parser,
 *                                  text, tail, attrib, nsmap):
 *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 26; goto __pyx_L1;}
__pyx_r = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.makeElement");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_tail);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":28
 *     return _makeElement(tag, NULL, doc, parser, text, tail, attrib, nsmap, None)
 * 
 * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,             # <<<<<<<<<<<<<< 
 *                                     attrib, nsmap):
 *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)
 */

__PYX_EXTERN_C  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) {
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_tail);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":30
 * cdef public api _Element makeSubElement(_Element parent, tag, text, tail,
 *                                     attrib, nsmap):
 *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api void setElementClassLookupFunction(
 */
__pyx_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_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 30; goto __pyx_L1;}
__pyx_r = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.makeSubElement");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_tag);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_tail);
Py_DECREF(__pyx_v_attrib);
Py_DECREF(__pyx_v_nsmap);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":32
 *     return _makeSubElement(parent, tag, text, tail, attrib, nsmap, None)
 * 
 * cdef public api void setElementClassLookupFunction(             # <<<<<<<<<<<<<< 
 *     _element_class_lookup_function function, state):
 *     _setElementClassLookupFunction(function, state)
 */

__PYX_EXTERN_C  DL_EXPORT(void) setElementClassLookupFunction(_element_class_lookup_function __pyx_v_function,PyObject *__pyx_v_state) {
Py_INCREF(__pyx_v_state);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":34
 * cdef public api void setElementClassLookupFunction(
 *     _element_class_lookup_function function, state):
 *     _setElementClassLookupFunction(function, state)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):
 */
__pyx_f_4lxml_5etree__setElementClassLookupFunction(__pyx_v_function,__pyx_v_state);

Py_DECREF(__pyx_v_state);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":36
 *     _setElementClassLookupFunction(function, state)
 * 
 * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _lookupDefaultElementClass(state, doc, c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *lookupDefaultElementClass(PyObject *__pyx_v_state,PyObject *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":37
 * 
 * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):
 *     return _lookupDefaultElementClass(state, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 37; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":37
 * 
 * cdef public api object lookupDefaultElementClass(state, doc, xmlNode* c_node):
 *     return _lookupDefaultElementClass(state, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
 */
__pyx_1 = __pyx_f_4lxml_5etree__lookupDefaultElementClass(__pyx_v_state,((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 37; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.lookupDefaultElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":39
 *     return _lookupDefaultElementClass(state, doc, c_node)
 * 
 * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _find_nselement_class(state, doc, c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *lookupNamespaceElementClass(PyObject *__pyx_v_state,PyObject *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":40
 * 
 * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
 *     return _find_nselement_class(state, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,
 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_4lxml_5etree__Document)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 40; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":40
 * 
 * cdef public api object lookupNamespaceElementClass(state, doc, xmlNode* c_node):
 *     return _find_nselement_class(state, doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,
 */
__pyx_1 = __pyx_f_4lxml_5etree__find_nselement_class(__pyx_v_state,((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 40; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.lookupNamespaceElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":42
 *     return _find_nselement_class(state, doc, c_node)
 * 
 * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,             # <<<<<<<<<<<<<< 
 *                                       _Document doc, xmlNode* c_node):
 *     return lookup._callFallback(doc, c_node)
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *callLookupFallback(struct LxmlFallbackElementClassLookup *__pyx_v_lookup,struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_lookup);
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":44
 * cdef public api object callLookupFallback(FallbackElementClassLookup lookup,
 *                                       _Document doc, xmlNode* c_node):
 *     return lookup._callFallback(doc, c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup *)__pyx_v_lookup->__pyx_vtab)->_callFallback(__pyx_v_lookup,((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 44; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.callLookupFallback");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":46
 *     return lookup._callFallback(doc, c_node)
 * 
 * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return -1
 */

__PYX_EXTERN_C  DL_EXPORT(int) tagMatches(xmlNode *__pyx_v_c_node,char *__pyx_v_c_href,char *__pyx_v_c_name) {
int __pyx_r;
int __pyx_1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":47
 * 
 * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return -1
 *     return _tagMatches(c_node, c_href, c_name)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":48
 * cdef public api int tagMatches(xmlNode* c_node, char* c_href, char* c_name):
 *     if c_node is NULL:
 *         return -1             # <<<<<<<<<<<<<< 
 *     return _tagMatches(c_node, c_href, c_name)
 * 
 */
  __pyx_r = -1;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":49
 *     if c_node is NULL:
 *         return -1
 *     return _tagMatches(c_node, c_href, c_name)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Document documentOrRaise(object input):
 */
__pyx_r = __pyx_f_4lxml_5etree__tagMatches(__pyx_v_c_node,__pyx_v_c_href,__pyx_v_c_name);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":51
 *     return _tagMatches(c_node, c_href, c_name)
 * 
 * cdef public api _Document documentOrRaise(object input):             # <<<<<<<<<<<<<< 
 *     return _documentOrRaise(input)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlDocument) *documentOrRaise(PyObject *__pyx_v_input) {
struct LxmlDocument *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":52
 * 
 * cdef public api _Document documentOrRaise(object input):
 *     return _documentOrRaise(input)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api _Element rootNodeOrRaise(object input):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__documentOrRaise(__pyx_v_input)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 52; goto __pyx_L1;}
__pyx_r = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.documentOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":54
 *     return _documentOrRaise(input)
 * 
 * cdef public api _Element rootNodeOrRaise(object input):             # <<<<<<<<<<<<<< 
 *     return _rootNodeOrRaise(input)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(struct LxmlElement) *rootNodeOrRaise(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":55
 * 
 * cdef public api _Element rootNodeOrRaise(object input):
 *     return _rootNodeOrRaise(input)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api bint hasText(xmlNode* c_node):
 */
__pyx_1 = ((PyObject *)__pyx_f_4lxml_5etree__rootNodeOrRaise(__pyx_v_input)); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 55; goto __pyx_L1;}
__pyx_r = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.rootNodeOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":57
 *     return _rootNodeOrRaise(input)
 * 
 * cdef public api bint hasText(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _hasText(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(int) hasText(xmlNode *__pyx_v_c_node) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":58
 * 
 * cdef public api bint hasText(xmlNode* c_node):
 *     return _hasText(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api bint hasTail(xmlNode* c_node):
 */
__pyx_r = __pyx_f_4lxml_5etree__hasText(__pyx_v_c_node);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":60
 *     return _hasText(c_node)
 * 
 * cdef public api bint hasTail(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _hasTail(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(int) hasTail(xmlNode *__pyx_v_c_node) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":61
 * 
 * cdef public api bint hasTail(xmlNode* c_node):
 *     return _hasTail(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object textOf(xmlNode* c_node):
 */
__pyx_r = __pyx_f_4lxml_5etree__hasTail(__pyx_v_c_node);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":63
 *     return _hasTail(c_node)
 * 
 * cdef public api object textOf(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return None
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *textOf(xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":64
 * 
 * cdef public api object textOf(xmlNode* c_node):
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     return _collectText(c_node.children)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":65
 * cdef public api object textOf(xmlNode* c_node):
 *     if c_node is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     return _collectText(c_node.children)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":66
 *     if c_node is NULL:
 *         return None
 *     return _collectText(c_node.children)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object tailOf(xmlNode* c_node):
 */
__pyx_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_node->children); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 66; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.textOf");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":68
 *     return _collectText(c_node.children)
 * 
 * cdef public api object tailOf(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         return None
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *tailOf(xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":69
 * 
 * cdef public api object tailOf(xmlNode* c_node):
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         return None
 *     return _collectText(c_node.next)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":70
 * cdef public api object tailOf(xmlNode* c_node):
 *     if c_node is NULL:
 *         return None             # <<<<<<<<<<<<<< 
 *     return _collectText(c_node.next)
 * 
 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":71
 *     if c_node is NULL:
 *         return None
 *     return _collectText(c_node.next)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
 */
__pyx_2 = __pyx_f_4lxml_5etree__collectText(__pyx_v_c_node->next); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 71; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.tailOf");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":73
 *     return _collectText(c_node.next)
 * 
 * cdef public api int setNodeText(xmlNode* c_node, text) except -1:             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         raise ValueError
 */

__PYX_EXTERN_C  DL_EXPORT(int) setNodeText(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_text) {
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_text);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":74
 * 
 * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         raise ValueError
 *     return _setNodeText(c_node, text)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":75
 * cdef public api int setNodeText(xmlNode* c_node, text) except -1:
 *     if c_node is NULL:
 *         raise ValueError             # <<<<<<<<<<<<<< 
 *     return _setNodeText(c_node, text)
 * 
 */
  __Pyx_Raise(__pyx_builtin_ValueError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 75; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":76
 *     if c_node is NULL:
 *         raise ValueError
 *     return _setNodeText(c_node, text)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int setTailText(xmlNode* c_node, text) except -1:
 */
__pyx_2 = __pyx_f_4lxml_5etree__setNodeText(__pyx_v_c_node,__pyx_v_text); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 76; goto __pyx_L1;}
__pyx_r = __pyx_2;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.setNodeText");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":78
 *     return _setNodeText(c_node, text)
 * 
 * cdef public api int setTailText(xmlNode* c_node, text) except -1:             # <<<<<<<<<<<<<< 
 *     if c_node is NULL:
 *         raise ValueError
 */

__PYX_EXTERN_C  DL_EXPORT(int) setTailText(xmlNode *__pyx_v_c_node,PyObject *__pyx_v_text) {
int __pyx_r;
int __pyx_1;
int __pyx_2;
Py_INCREF(__pyx_v_text);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":79
 * 
 * cdef public api int setTailText(xmlNode* c_node, text) except -1:
 *     if c_node is NULL:             # <<<<<<<<<<<<<< 
 *         raise ValueError
 *     return _setTailText(c_node, text)
 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":80
 * cdef public api int setTailText(xmlNode* c_node, text) except -1:
 *     if c_node is NULL:
 *         raise ValueError             # <<<<<<<<<<<<<< 
 *     return _setTailText(c_node, text)
 * 
 */
  __Pyx_Raise(__pyx_builtin_ValueError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 80; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":81
 *     if c_node is NULL:
 *         raise ValueError
 *     return _setTailText(c_node, text)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
 */
__pyx_2 = __pyx_f_4lxml_5etree__setTailText(__pyx_v_c_node,__pyx_v_text); if (unlikely(__pyx_2 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 81; goto __pyx_L1;}
__pyx_r = __pyx_2;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.setTailText");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":83
 *     return _setTailText(c_node, text)
 * 
 * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):             # <<<<<<<<<<<<<< 
 *     return _attributeValue(c_element, c_attrib_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *attributeValue(xmlNode *__pyx_v_c_element,xmlAttr *__pyx_v_c_attrib_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":84
 * 
 * cdef public api object attributeValue(xmlNode* c_element, xmlAttr* c_attrib_node):
 *     return _attributeValue(c_element, c_attrib_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object attributeValueFromNsName(xmlNode* c_element,
 */
__pyx_1 = __pyx_f_4lxml_5etree__attributeValue(__pyx_v_c_element,__pyx_v_c_attrib_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 84; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.attributeValue");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":86
 *     return _attributeValue(c_element, c_attrib_node)
 * 
 * cdef public api object attributeValueFromNsName(xmlNode* c_element,             # <<<<<<<<<<<<<< 
 *                                             char* ns, char* name):
 *     return _attributeValueFromNsName(c_element, ns, name)
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *attributeValueFromNsName(xmlNode *__pyx_v_c_element,char *__pyx_v_ns,char *__pyx_v_name) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":88
 * cdef public api object attributeValueFromNsName(xmlNode* c_element,
 *                                             char* ns, char* name):
 *     return _attributeValueFromNsName(c_element, ns, name)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object getAttributeValue(_Element element, key, default):
 */
__pyx_1 = __pyx_f_4lxml_5etree__attributeValueFromNsName(__pyx_v_c_element,__pyx_v_ns,__pyx_v_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.attributeValueFromNsName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":90
 *     return _attributeValueFromNsName(c_element, ns, name)
 * 
 * cdef public api object getAttributeValue(_Element element, key, default):             # <<<<<<<<<<<<<< 
 *     return _getAttributeValue(element, key, default)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *getAttributeValue(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key,PyObject *__pyx_v_default) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":91
 * 
 * cdef public api object getAttributeValue(_Element element, key, default):
 *     return _getAttributeValue(element, key, default)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object iterattributes(_Element element, int keysvalues):
 */
__pyx_1 = __pyx_f_4lxml_5etree__getAttributeValue(__pyx_v_element,__pyx_v_key,__pyx_v_default); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 91; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.getAttributeValue");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":93
 *     return _getAttributeValue(element, key, default)
 * 
 * cdef public api object iterattributes(_Element element, int keysvalues):             # <<<<<<<<<<<<<< 
 *     return _attributeIteratorFactory(element, keysvalues)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *iterattributes(struct LxmlElement *__pyx_v_element,int __pyx_v_keysvalues) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_element);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":94
 * 
 * cdef public api object iterattributes(_Element element, int keysvalues):
 *     return _attributeIteratorFactory(element, keysvalues)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):
 */
__pyx_1 = __pyx_f_4lxml_5etree__attributeIteratorFactory(__pyx_v_element,__pyx_v_keysvalues); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 94; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.iterattributes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":96
 *     return _attributeIteratorFactory(element, keysvalues)
 * 
 * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):             # <<<<<<<<<<<<<< 
 *     return _collectAttributes(c_element, keysvalues)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *collectAttributes(xmlNode *__pyx_v_c_element,int __pyx_v_keysvalues) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":97
 * 
 * cdef public api object collectAttributes(xmlNode* c_element, int keysvalues):
 *     return _collectAttributes(c_element, keysvalues)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int setAttributeValue(_Element element, key, value) except -1:
 */
__pyx_1 = __pyx_f_4lxml_5etree__collectAttributes(__pyx_v_c_element,__pyx_v_keysvalues); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 97; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.collectAttributes");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":99
 *     return _collectAttributes(c_element, keysvalues)
 * 
 * cdef public api int setAttributeValue(_Element element, key, value) except -1:             # <<<<<<<<<<<<<< 
 *     return _setAttributeValue(element, key, value)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(int) setAttributeValue(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key,PyObject *__pyx_v_value) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":100
 * 
 * cdef public api int setAttributeValue(_Element element, key, value) except -1:
 *     return _setAttributeValue(element, key, value)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int delAttribute(_Element element, key) except -1:
 */
__pyx_1 = __pyx_f_4lxml_5etree__setAttributeValue(__pyx_v_element,__pyx_v_key,__pyx_v_value); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 100; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.setAttributeValue");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":102
 *     return _setAttributeValue(element, key, value)
 * 
 * cdef public api int delAttribute(_Element element, key) except -1:             # <<<<<<<<<<<<<< 
 *     return _delAttribute(element, key)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(int) delAttribute(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_key) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_key);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":103
 * 
 * cdef public api int delAttribute(_Element element, key) except -1:
 *     return _delAttribute(element, key)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,
 */
__pyx_1 = __pyx_f_4lxml_5etree__delAttribute(__pyx_v_element,__pyx_v_key); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 103; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.delAttribute");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":105
 *     return _delAttribute(element, key)
 * 
 * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,             # <<<<<<<<<<<<<< 
 *                                        char* c_href, char* c_name):
 *     return _delAttributeFromNsName(c_element, c_href, c_name)
 */

__PYX_EXTERN_C  DL_EXPORT(int) delAttributeFromNsName(xmlNode *__pyx_v_c_element,char *__pyx_v_c_href,char *__pyx_v_c_name) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":107
 * cdef public api int delAttributeFromNsName(tree.xmlNode* c_element,
 *                                        char* c_href, char* c_name):
 *     return _delAttributeFromNsName(c_element, c_href, c_name)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api bint hasChild(xmlNode* c_node):
 */
__pyx_r = __pyx_f_4lxml_5etree__delAttributeFromNsName(__pyx_v_c_element,__pyx_v_c_href,__pyx_v_c_name);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":109
 *     return _delAttributeFromNsName(c_element, c_href, c_name)
 * 
 * cdef public api bint hasChild(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _hasChild(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(int) hasChild(xmlNode *__pyx_v_c_node) {
int __pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":110
 * 
 * cdef public api bint hasChild(xmlNode* c_node):
 *     return _hasChild(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):
 */
__pyx_r = __pyx_f_4lxml_5etree__hasChild(__pyx_v_c_node);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":112
 *     return _hasChild(c_node)
 * 
 * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     return _findChild(c_node, index)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNode) *findChild(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":113
 * 
 * cdef public api xmlNode* findChild(xmlNode* c_node, Py_ssize_t index):
 *     return _findChild(c_node, index)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):
 */
__pyx_r = __pyx_f_4lxml_5etree__findChild(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":115
 *     return _findChild(c_node, index)
 * 
 * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     return _findChildForwards(c_node, index)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNode) *findChildForwards(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":116
 * 
 * cdef public api xmlNode* findChildForwards(xmlNode* c_node, Py_ssize_t index):
 *     return _findChildForwards(c_node, index)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):
 */
__pyx_r = __pyx_f_4lxml_5etree__findChildForwards(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":118
 *     return _findChildForwards(c_node, index)
 * 
 * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):             # <<<<<<<<<<<<<< 
 *     return _findChildBackwards(c_node, index)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNode) *findChildBackwards(xmlNode *__pyx_v_c_node,Py_ssize_t __pyx_v_index) {
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":119
 * 
 * cdef public api xmlNode* findChildBackwards(xmlNode* c_node, Py_ssize_t index):
 *     return _findChildBackwards(c_node, index)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api xmlNode* nextElement(xmlNode* c_node):
 */
__pyx_r = __pyx_f_4lxml_5etree__findChildBackwards(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":121
 *     return _findChildBackwards(c_node, index)
 * 
 * cdef public api xmlNode* nextElement(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _nextElement(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNode) *nextElement(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":122
 * 
 * cdef public api xmlNode* nextElement(xmlNode* c_node):
 *     return _nextElement(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api xmlNode* previousElement(xmlNode* c_node):
 */
__pyx_r = __pyx_f_4lxml_5etree__nextElement(__pyx_v_c_node);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":124
 *     return _nextElement(c_node)
 * 
 * cdef public api xmlNode* previousElement(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _previousElement(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNode) *previousElement(xmlNode *__pyx_v_c_node) {
xmlNode *__pyx_r;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":125
 * 
 * cdef public api xmlNode* previousElement(xmlNode* c_node):
 *     return _previousElement(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api void appendChild(_Element parent, _Element child):
 */
__pyx_r = __pyx_f_4lxml_5etree__previousElement(__pyx_v_c_node);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":127
 *     return _previousElement(c_node)
 * 
 * cdef public api void appendChild(_Element parent, _Element child):             # <<<<<<<<<<<<<< 
 *     _appendChild(parent, child)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(void) appendChild(struct LxmlElement *__pyx_v_parent,struct LxmlElement *__pyx_v_child) {
int __pyx_1;
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_child);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":128
 * 
 * cdef public api void appendChild(_Element parent, _Element child):
 *     _appendChild(parent, child)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object pyunicode(char* s):
 */
__pyx_1 = __pyx_f_4lxml_5etree__appendChild(__pyx_v_parent,__pyx_v_child); if (unlikely(__pyx_1 == -1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 128; goto __pyx_L1;}

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("lxml.etree.appendChild");
__pyx_L0:;
Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_child);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":130
 *     _appendChild(parent, child)
 * 
 * cdef public api object pyunicode(char* s):             # <<<<<<<<<<<<<< 
 *     if s is NULL:
 *         raise TypeError
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *pyunicode(char *__pyx_v_s) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":131
 * 
 * cdef public api object pyunicode(char* s):
 *     if s is NULL:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 *     return funicode(s)
 */
__pyx_1 = (__pyx_v_s == NULL);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":132
 * cdef public api object pyunicode(char* s):
 *     if s is NULL:
 *         raise TypeError             # <<<<<<<<<<<<<< 
 *     return funicode(s)
 * 
 */
  __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 132; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":133
 *     if s is NULL:
 *         raise TypeError
 *     return funicode(s)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object utf8(object s):
 */
__pyx_2 = __pyx_f_4lxml_5etree_funicode(__pyx_v_s); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 133; goto __pyx_L1;}
__pyx_r = __pyx_2;
__pyx_2 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("lxml.etree.pyunicode");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":135
 *     return funicode(s)
 * 
 * cdef public api object utf8(object s):             # <<<<<<<<<<<<<< 
 *     return _utf8(s)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *utf8(PyObject *__pyx_v_s) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_s);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":136
 * 
 * cdef public api object utf8(object s):
 *     return _utf8(s)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object getNsTag(object tag):
 */
__pyx_1 = __pyx_f_4lxml_5etree__utf8(__pyx_v_s); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 136; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.utf8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":138
 *     return _utf8(s)
 * 
 * cdef public api object getNsTag(object tag):             # <<<<<<<<<<<<<< 
 *     return _getNsTag(tag)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *getNsTag(PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":139
 * 
 * cdef public api object getNsTag(object tag):
 *     return _getNsTag(tag)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object namespacedName(xmlNode* c_node):
 */
__pyx_1 = __pyx_f_4lxml_5etree__getNsTag(__pyx_v_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 139; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.getNsTag");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":141
 *     return _getNsTag(tag)
 * 
 * cdef public api object namespacedName(xmlNode* c_node):             # <<<<<<<<<<<<<< 
 *     return _namespacedName(c_node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *namespacedName(xmlNode *__pyx_v_c_node) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":142
 * 
 * cdef public api object namespacedName(xmlNode* c_node):
 *     return _namespacedName(c_node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api object namespacedNameFromNsName(char* href, char* name):
 */
__pyx_1 = __pyx_f_4lxml_5etree__namespacedName(__pyx_v_c_node); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 142; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.namespacedName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":144
 *     return _namespacedName(c_node)
 * 
 * cdef public api object namespacedNameFromNsName(char* href, char* name):             # <<<<<<<<<<<<<< 
 *     return _namespacedNameFromNsName(href, name)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(PyObject) *namespacedNameFromNsName(char *__pyx_v_href,char *__pyx_v_name) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":145
 * 
 * cdef public api object namespacedNameFromNsName(char* href, char* name):
 *     return _namespacedNameFromNsName(href, name)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):
 */
__pyx_1 = __pyx_f_4lxml_5etree__namespacedNameFromNsName(__pyx_v_href,__pyx_v_name); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 145; goto __pyx_L1;}
__pyx_r = __pyx_1;
__pyx_1 = 0;
goto __pyx_L0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("lxml.etree.namespacedNameFromNsName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":147
 *     return _namespacedNameFromNsName(href, name)
 * 
 * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):             # <<<<<<<<<<<<<< 
 *     iterator._storeNext(node)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(void) iteratorStoreNext(struct LxmlElementIterator *__pyx_v_iterator,struct LxmlElement *__pyx_v_node) {
Py_INCREF((PyObject *)__pyx_v_iterator);
Py_INCREF(__pyx_v_node);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":148
 * 
 * cdef public api void iteratorStoreNext(_ElementIterator iterator, _Element node):
 *     iterator._storeNext(node)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):
 */
((struct __pyx_vtabstruct_4lxml_5etree__ElementIterator *)__pyx_v_iterator->__pyx_base.__pyx_vtab)->_storeNext(__pyx_v_iterator,__pyx_v_node);

Py_DECREF((PyObject *)__pyx_v_iterator);
Py_DECREF(__pyx_v_node);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":150
 *     iterator._storeNext(node)
 * 
 * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):             # <<<<<<<<<<<<<< 
 *     matcher._initTagMatch(tag)
 * 
 */

__PYX_EXTERN_C  DL_EXPORT(void) initTagMatch(struct LxmlElementTagMatcher *__pyx_v_matcher,PyObject *__pyx_v_tag) {
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_matcher);
Py_INCREF(__pyx_v_tag);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":151
 * 
 * cdef public api void initTagMatch(_ElementTagMatcher matcher, tag):
 *     matcher._initTagMatch(tag)             # <<<<<<<<<<<<<< 
 * 
 * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(
 */
__pyx_1 = ((struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher *)__pyx_v_matcher->__pyx_vtab)->_initTagMatch(__pyx_v_matcher,__pyx_v_tag); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("lxml.etree.initTagMatch");
__pyx_L0:;
Py_DECREF(__pyx_v_matcher);
Py_DECREF(__pyx_v_tag);
}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":153
 *     matcher._initTagMatch(tag)
 * 
 * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(             # <<<<<<<<<<<<<< 
 *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
 *     if doc is None:
 */

__PYX_EXTERN_C  DL_EXPORT(xmlNs) *findOrBuildNodeNsPrefix(struct LxmlDocument *__pyx_v_doc,xmlNode *__pyx_v_c_node,char *__pyx_v_href,char *__pyx_v_prefix) {
xmlNs *__pyx_r;
int __pyx_1;
xmlNs *__pyx_2;
Py_INCREF(__pyx_v_doc);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":155
 * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(
 *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
 *     if doc is None:             # <<<<<<<<<<<<<< 
 *         raise TypeError
 *     return doc._findOrBuildNodeNs(c_node, href, prefix)
 */
__pyx_1 = (((PyObject *)__pyx_v_doc) == Py_None);
if (__pyx_1) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":156
 *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
 *     if doc is None:
 *         raise TypeError             # <<<<<<<<<<<<<< 
 *     return doc._findOrBuildNodeNs(c_node, href, prefix)
 */
  __Pyx_Raise(__pyx_builtin_TypeError, 0, 0);
  {__pyx_filename = __pyx_f[19]; __pyx_lineno = 156; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":157
 *     if doc is None:
 *         raise TypeError
 *     return doc._findOrBuildNodeNs(c_node, href, prefix)             # <<<<<<<<<<<<<< 
 */
__pyx_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_2 == NULL)) {__pyx_filename = __pyx_f[19]; __pyx_lineno = 157; goto __pyx_L1;}
__pyx_r = __pyx_2;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("lxml.etree.findOrBuildNodeNsPrefix");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__pyx_n_A, "A"},
{&__pyx_n_ASCII, "ASCII"},
{&__pyx_n_AssertionError, "AssertionError"},
{&__pyx_n_AttributeError, "AttributeError"},
{&__pyx_n_C14NError, "C14NError"},
{&__pyx_n_CRITICAL, "CRITICAL"},
{&__pyx_n_Comment, "Comment"},
{&__pyx_n_DEBUG, "DEBUG"},
{&__pyx_n_DTDError, "DTDError"},
{&__pyx_n_DTDParseError, "DTDParseError"},
{&__pyx_n_DTDValidateError, "DTDValidateError"},
{&__pyx_n_DocumentInvalid, "DocumentInvalid"},
{&__pyx_n_ERROR, "ERROR"},
{&__pyx_n_ERR_UNDECLARED_ENTITY, "ERR_UNDECLARED_ENTITY"},
{&__pyx_n_Element, "Element"},
{&__pyx_n_ElementTree, "ElementTree"},
{&__pyx_n_Entity, "Entity"},
{&__pyx_n_Error, "Error"},
{&__pyx_n_ErrorDomains, "ErrorDomains"},
{&__pyx_n_ErrorLevels, "ErrorLevels"},
{&__pyx_n_ErrorTypes, "ErrorTypes"},
{&__pyx_n_Exception, "Exception"},
{&__pyx_n_FATAL, "FATAL"},
{&__pyx_n_FutureWarning, "FutureWarning"},
{&__pyx_n_IGNORECASE, "IGNORECASE"},
{&__pyx_n_IOError, "IOError"},
{&__pyx_n_IndexError, "IndexError"},
{&__pyx_n_KeyError, "KeyError"},
{&__pyx_n_LIBXML_COMPILED_VERSION, "LIBXML_COMPILED_VERSION"},
{&__pyx_n_LIBXML_VERSION, "LIBXML_VERSION"},
{&__pyx_n_LIBXSLT_COMPILED_VERSION, "LIBXSLT_COMPILED_VERSION"},
{&__pyx_n_LIBXSLT_VERSION, "LIBXSLT_VERSION"},
{&__pyx_n_LXML_VERSION, "LXML_VERSION"},
{&__pyx_n_LookupError, "LookupError"},
{&__pyx_n_LxmlError, "LxmlError"},
{&__pyx_n_LxmlRegistryError, "LxmlRegistryError"},
{&__pyx_n_LxmlSyntaxError, "LxmlSyntaxError"},
{&__pyx_n_NamespaceRegistryError, "NamespaceRegistryError"},
{&__pyx_n_NotImplementedError, "NotImplementedError"},
{&__pyx_n_PI, "PI"},
{&__pyx_n_ParseError, "ParseError"},
{&__pyx_n_ParserError, "ParserError"},
{&__pyx_n_ProcessingInstruction, "ProcessingInstruction"},
{&__pyx_n_RelaxNGError, "RelaxNGError"},
{&__pyx_n_RelaxNGParseError, "RelaxNGParseError"},
{&__pyx_n_RelaxNGValidateError, "RelaxNGValidateError"},
{&__pyx_n_RuntimeError, "RuntimeError"},
{&__pyx_n_SchematronError, "SchematronError"},
{&__pyx_n_SchematronParseError, "SchematronParseError"},
{&__pyx_n_SchematronValidateError, "SchematronValidateError"},
{&__pyx_n_Set, "Set"},
{&__pyx_n_StopIteration, "StopIteration"},
{&__pyx_n_SubElement, "SubElement"},
{&__pyx_n_SyntaxError, "SyntaxError"},
{&__pyx_n_TypeError, "TypeError"},
{&__pyx_n_U, "U"},
{&__pyx_n_UNICODE, "UNICODE"},
{&__pyx_n_UTF8, "UTF8"},
{&__pyx_n_UnicodeDecodeError, "UnicodeDecodeError"},
{&__pyx_n_ValueError, "ValueError"},
{&__pyx_n_WARNING, "WARNING"},
{&__pyx_n_WAR_UNDECLARED_ENTITY, "WAR_UNDECLARED_ENTITY"},
{&__pyx_n_XIncludeError, "XIncludeError"},
{&__pyx_n_XML, "XML"},
{&__pyx_n_XMLSchemaError, "XMLSchemaError"},
{&__pyx_n_XMLSchemaParseError, "XMLSchemaParseError"},
{&__pyx_n_XMLSchemaValidateError, "XMLSchemaValidateError"},
{&__pyx_n_XMLSyntaxError, "XMLSyntaxError"},
{&__pyx_n_XPathError, "XPathError"},
{&__pyx_n_XPathEvalError, "XPathEvalError"},
{&__pyx_n_XPathFunctionError, "XPathFunctionError"},
{&__pyx_n_XPathResultError, "XPathResultError"},
{&__pyx_n_XPathSyntaxError, "XPathSyntaxError"},
{&__pyx_n_XSLTApplyError, "XSLTApplyError"},
{&__pyx_n_XSLTError, "XSLTError"},
{&__pyx_n_XSLTExtensionError, "XSLTExtensionError"},
{&__pyx_n_XSLTParseError, "XSLTParseError"},
{&__pyx_n_XSLTSaveError, "XSLTSaveError"},
{&__pyx_n__, "_"},
{&__pyx_n__ParserDictionaryContext, "_ParserDictionaryContext"},
{&__pyx_n__TargetParserResult, "_TargetParserResult"},
{&__pyx_n___builtin__, "__builtin__"},
{&__pyx_n___call__, "__call__"},
{&__pyx_n___class__, "__class__"},
{&__pyx_n___cmp__, "__cmp__"},
{&__pyx_n___contains__, "__contains__"},
{&__pyx_n___copy__, "__copy__"},
{&__pyx_n___dealloc__, "__dealloc__"},
{&__pyx_n___deepcopy__, "__deepcopy__"},
{&__pyx_n___delitem__, "__delitem__"},
{&__pyx_n___dict__, "__dict__"},
{&__pyx_n___getitem__, "__getitem__"},
{&__pyx_n___hash__, "__hash__"},
{&__pyx_n___init__, "__init__"},
{&__pyx_n___iter__, "__iter__"},
{&__pyx_n___len__, "__len__"},
{&__pyx_n___next__, "__next__"},
{&__pyx_n___nonzero__, "__nonzero__"},
{&__pyx_n___repr__, "__repr__"},
{&__pyx_n___reversed__, "__reversed__"},
{&__pyx_n___richcmp__, "__richcmp__"},
{&__pyx_n___setitem__, "__setitem__"},
{&__pyx_n___setslice__, "__setslice__"},
{&__pyx_n___str__, "__str__"},
{&__pyx_n___unicode__, "__unicode__"},
{&__pyx_n___version__, "__version__"},
{&__pyx_n__accepted_domains, "_accepted_domains"},
{&__pyx_n__elementpath, "_elementpath"},
{&__pyx_n__getName, "_getName"},
{&__pyx_n__init, "_init"},
{&__pyx_n__names, "_names"},
{&__pyx_n__setroot, "_setroot"},
{&__pyx_n__superError, "_superError"},
{&__pyx_n_access_control, "access_control"},
{&__pyx_n_add, "add"},
{&__pyx_n_addnext, "addnext"},
{&__pyx_n_addprevious, "addprevious"},
{&__pyx_n_alpha, "alpha"},
{&__pyx_n_append, "append"},
{&__pyx_n_apply, "apply"},
{&__pyx_n_ascii, "ascii"},
{&__pyx_n_assertValid, "assertValid"},
{&__pyx_n_assert_, "assert_"},
{&__pyx_n_attribute_defaults, "attribute_defaults"},
{&__pyx_n_beta, "beta"},
{&__pyx_n_clear, "clear"},
{&__pyx_n_close, "close"},
{&__pyx_n_code, "code"},
{&__pyx_n_comment, "comment"},
{&__pyx_n_compact, "compact"},
{&__pyx_n_compile, "compile"},
{&__pyx_n_copy, "copy"},
{&__pyx_n_data, "data"},
{&__pyx_n_dc, "dc"},
{&__pyx_n_dev, "dev"},
{&__pyx_n_discard, "discard"},
{&__pyx_n_doctype, "doctype"},
{&__pyx_n_domain, "domain"},
{&__pyx_n_domain_name, "domain_name"},
{&__pyx_n_dtd_validation, "dtd_validation"},
{&__pyx_n_element, "element"},
{&__pyx_n_encoding, "encoding"},
{&__pyx_n_end, "end"},
{&__pyx_n_entity, "entity"},
{&__pyx_n_error_log, "error_log"},
{&__pyx_n_evaluate, "evaluate"},
{&__pyx_n_events, "events"},
{&__pyx_n_exc_info, "exc_info"},
{&__pyx_n_extend, "extend"},
{&__pyx_n_extensions, "extensions"},
{&__pyx_n_feed, "feed"},
{&__pyx_n_filename, "filename"},
{&__pyx_n_filter_domains, "filter_domains"},
{&__pyx_n_filter_from_errors, "filter_from_errors"},
{&__pyx_n_filter_from_fatals, "filter_from_fatals"},
{&__pyx_n_filter_from_level, "filter_from_level"},
{&__pyx_n_filter_from_warnings, "filter_from_warnings"},
{&__pyx_n_filter_levels, "filter_levels"},
{&__pyx_n_filter_types, "filter_types"},
{&__pyx_n_find, "find"},
{&__pyx_n_findall, "findall"},
{&__pyx_n_findtext, "findtext"},
{&__pyx_n_g, "g"},
{&__pyx_n_get, "get"},
{&__pyx_n_getLogger, "getLogger"},
{&__pyx_n_get_default_parser, "get_default_parser"},
{&__pyx_n_get_namespace, "get_namespace"},
{&__pyx_n_getargspec, "getargspec"},
{&__pyx_n_getchildren, "getchildren"},
{&__pyx_n_getdefaultencoding, "getdefaultencoding"},
{&__pyx_n_getfilesystemencoding, "getfilesystemencoding"},
{&__pyx_n_getiterator, "getiterator"},
{&__pyx_n_getnext, "getnext"},
{&__pyx_n_getparent, "getparent"},
{&__pyx_n_getpath, "getpath"},
{&__pyx_n_getprevious, "getprevious"},
{&__pyx_n_getroot, "getroot"},
{&__pyx_n_getroottree, "getroottree"},
{&__pyx_n_geturl, "geturl"},
{&__pyx_n_getvalue, "getvalue"},
{&__pyx_n_group, "group"},
{&__pyx_n_groups, "groups"},
{&__pyx_n_has_key, "has_key"},
{&__pyx_n_href, "href"},
{&__pyx_n_html, "html"},
{&__pyx_n_i, "i"},
{&__pyx_n_id, "id"},
{&__pyx_n_inclusive, "inclusive"},
{&__pyx_n_index, "index"},
{&__pyx_n_insert, "insert"},
{&__pyx_n_inspect, "inspect"},
{&__pyx_n_items, "items"},
{&__pyx_n_iter, "iter"},
{&__pyx_n_iterancestors, "iterancestors"},
{&__pyx_n_iterchildren, "iterchildren"},
{&__pyx_n_iterdescendants, "iterdescendants"},
{&__pyx_n_iterfind, "iterfind"},
{&__pyx_n_iteritems, "iteritems"},
{&__pyx_n_iterkeys, "iterkeys"},
{&__pyx_n_itersiblings, "itersiblings"},
{&__pyx_n_itertext, "itertext"},
{&__pyx_n_itervalues, "itervalues"},
{&__pyx_n_join, "join"},
{&__pyx_n_keys, "keys"},
{&__pyx_n_level, "level"},
{&__pyx_n_level_name, "level_name"},
{&__pyx_n_line, "line"},
{&__pyx_n_load_dtd, "load_dtd"},
{&__pyx_n_log, "log"},
{&__pyx_n_logging, "logging"},
{&__pyx_n_lookup, "lookup"},
{&__pyx_n_lower, "lower"},
{&__pyx_n_makeelement, "makeelement"},
{&__pyx_n_match, "match"},
{&__pyx_n_matches, "matches"},
{&__pyx_n_message, "message"},
{&__pyx_n_name, "name"},
{&__pyx_n_namespaces, "namespaces"},
{&__pyx_n_next, "next"},
{&__pyx_n_no_network, "no_network"},
{&__pyx_n_ns_clean, "ns_clean"},
{&__pyx_n_open, "open"},
{&__pyx_n_parse, "parse"},
{&__pyx_n_parseXSL, "parseXSL"},
{&__pyx_n_pi, "pi"},
{&__pyx_n_pop, "pop"},
{&__pyx_n_position, "position"},
{&__pyx_n_preceding, "preceding"},
{&__pyx_n_profile_run, "profile_run"},
{&__pyx_n_rb, "rb"},
{&__pyx_n_rdf, "rdf"},
{&__pyx_n_re, "re"},
{&__pyx_n_read, "read"},
{&__pyx_n_receive, "receive"},
{&__pyx_n_recover, "recover"},
{&__pyx_n_regexp, "regexp"},
{&__pyx_n_registerNamespace, "registerNamespace"},
{&__pyx_n_registerNamespaces, "registerNamespaces"},
{&__pyx_n_relaxng, "relaxng"},
{&__pyx_n_remove, "remove"},
{&__pyx_n_remove_blank_text, "remove_blank_text"},
{&__pyx_n_remove_comments, "remove_comments"},
{&__pyx_n_remove_pis, "remove_pis"},
{&__pyx_n_replace, "replace"},
{&__pyx_n_resolve, "resolve"},
{&__pyx_n_resolve_empty, "resolve_empty"},
{&__pyx_n_resolve_entities, "resolve_entities"},
{&__pyx_n_resolve_file, "resolve_file"},
{&__pyx_n_resolve_filename, "resolve_filename"},
{&__pyx_n_resolve_string, "resolve_string"},
{&__pyx_n_resolvers, "resolvers"},
{&__pyx_n_result, "result"},
{&__pyx_n_reversed, "reversed"},
{&__pyx_n_search, "search"},
{&__pyx_n_set, "set"},
{&__pyx_n_setElementClassLookup, "setElementClassLookup"},
{&__pyx_n_setFallback, "setFallback"},
{&__pyx_n_set_default_parser, "set_default_parser"},
{&__pyx_n_set_element_class_lookup, "set_element_class_lookup"},
{&__pyx_n_sets, "sets"},
{&__pyx_n_split, "split"},
{&__pyx_n_start, "start"},
{&__pyx_n_startswith, "startswith"},
{&__pyx_n_stdout, "stdout"},
{&__pyx_n_strip, "strip"},
{&__pyx_n_sub, "sub"},
{&__pyx_n_super, "super"},
{&__pyx_n_sys, "sys"},
{&__pyx_n_tag, "tag"},
{&__pyx_n_tail, "tail"},
{&__pyx_n_target, "target"},
{&__pyx_n_tell, "tell"},
{&__pyx_n_test, "test"},
{&__pyx_n_text, "text"},
{&__pyx_n_tostring, "tostring"},
{&__pyx_n_type, "type"},
{&__pyx_n_type_name, "type_name"},
{&__pyx_n_unknown, "unknown"},
{&__pyx_n_update, "update"},
{&__pyx_n_upper, "upper"},
{&__pyx_n_validate, "validate"},
{&__pyx_n_values, "values"},
{&__pyx_n_warn, "warn"},
{&__pyx_n_warnings, "warnings"},
{&__pyx_n_wb, "wb"},
{&__pyx_n_with_tail, "with_tail"},
{&__pyx_n_write, "write"},
{&__pyx_n_write_c14n, "write_c14n"},
{&__pyx_n_wsdl, "wsdl"},
{&__pyx_n_xinclude, "xinclude"},
{&__pyx_n_xml, "xml"},
{&__pyx_n_xmlschema, "xmlschema"},
{&__pyx_n_xpath, "xpath"},
{&__pyx_n_xs, "xs"},
{&__pyx_n_xsi, "xsi"},
{&__pyx_n_xsl, "xsl"},
{&__pyx_n_xslt, "xslt"},
{0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k28p, __pyx_k28, sizeof(__pyx_k28), 0},
{&__pyx_k34p, __pyx_k34, sizeof(__pyx_k34), 0},
{&__pyx_k36p, __pyx_k36, sizeof(__pyx_k36), 0},
{&__pyx_k38p, __pyx_k38, sizeof(__pyx_k38), 0},
{&__pyx_k40p, __pyx_k40, sizeof(__pyx_k40), 0},
{&__pyx_k42p, __pyx_k42, sizeof(__pyx_k42), 0},
{&__pyx_k44p, __pyx_k44, sizeof(__pyx_k44), 0},
{&__pyx_k48p, __pyx_k48, sizeof(__pyx_k48), 0},
{&__pyx_k50p, __pyx_k50, sizeof(__pyx_k50), 0},
{&__pyx_k52p, __pyx_k52, sizeof(__pyx_k52), 0},
{&__pyx_k54p, __pyx_k54, sizeof(__pyx_k54), 0},
{&__pyx_k55p, __pyx_k55, sizeof(__pyx_k55), 0},
{&__pyx_k56p, __pyx_k56, sizeof(__pyx_k56), 0},
{&__pyx_k126p, __pyx_k126, sizeof(__pyx_k126), 0},
{&__pyx_k129p, __pyx_k129, sizeof(__pyx_k129), 0},
{&__pyx_k131p, __pyx_k131, sizeof(__pyx_k131), 0},
{&__pyx_k133p, __pyx_k133, sizeof(__pyx_k133), 0},
{&__pyx_k134p, __pyx_k134, sizeof(__pyx_k134), 0},
{&__pyx_k135p, __pyx_k135, sizeof(__pyx_k135), 0},
{&__pyx_k136p, __pyx_k136, sizeof(__pyx_k136), 0},
{&__pyx_k137p, __pyx_k137, sizeof(__pyx_k137), 0},
{&__pyx_k138p, __pyx_k138, sizeof(__pyx_k138), 0},
{&__pyx_k139p, __pyx_k139, sizeof(__pyx_k139), 0},
{&__pyx_k140p, __pyx_k140, sizeof(__pyx_k140), 0},
{&__pyx_k141p, __pyx_k141, sizeof(__pyx_k141), 0},
{&__pyx_k142p, __pyx_k142, sizeof(__pyx_k142), 0},
{&__pyx_k143p, __pyx_k143, sizeof(__pyx_k143), 0},
{&__pyx_k144p, __pyx_k144, sizeof(__pyx_k144), 0},
{&__pyx_k145p, __pyx_k145, sizeof(__pyx_k145), 0},
{&__pyx_k157p, __pyx_k157, sizeof(__pyx_k157), 0},
{&__pyx_k159p, __pyx_k159, sizeof(__pyx_k159), 0},
{&__pyx_k164p, __pyx_k164, sizeof(__pyx_k164), 0},
{&__pyx_k166p, __pyx_k166, sizeof(__pyx_k166), 0},
{&__pyx_k168p, __pyx_k168, sizeof(__pyx_k168), 0},
{&__pyx_k233p, __pyx_k233, sizeof(__pyx_k233), 0},
{&__pyx_k235p, __pyx_k235, sizeof(__pyx_k235), 0},
{&__pyx_k237p, __pyx_k237, sizeof(__pyx_k237), 0},
{&__pyx_k239p, __pyx_k239, sizeof(__pyx_k239), 0},
{&__pyx_k242p, __pyx_k242, sizeof(__pyx_k242), 0},
{&__pyx_k244p, __pyx_k244, sizeof(__pyx_k244), 0},
{&__pyx_k259p, __pyx_k259, sizeof(__pyx_k259), 0},
{&__pyx_k260p, __pyx_k260, sizeof(__pyx_k260), 0},
{&__pyx_k264p, __pyx_k264, sizeof(__pyx_k264), 0},
{&__pyx_k266p, __pyx_k266, sizeof(__pyx_k266), 0},
{&__pyx_k268p, __pyx_k268, sizeof(__pyx_k268), 0},
{&__pyx_k270p, __pyx_k270, sizeof(__pyx_k270), 0},
{&__pyx_k272p, __pyx_k272, sizeof(__pyx_k272), 0},
{&__pyx_k283p, __pyx_k283, sizeof(__pyx_k283), 0},
{&__pyx_k284p, __pyx_k284, sizeof(__pyx_k284), 0},
{&__pyx_k288p, __pyx_k288, sizeof(__pyx_k288), 0},
{&__pyx_k290p, __pyx_k290, sizeof(__pyx_k290), 0},
{&__pyx_k292p, __pyx_k292, sizeof(__pyx_k292), 0},
{&__pyx_k294p, __pyx_k294, sizeof(__pyx_k294), 0},
{&__pyx_k298p, __pyx_k298, sizeof(__pyx_k298), 0},
{&__pyx_k300p, __pyx_k300, sizeof(__pyx_k300), 0},
{&__pyx_k302p, __pyx_k302, sizeof(__pyx_k302), 0},
{&__pyx_k306p, __pyx_k306, sizeof(__pyx_k306), 0},
{&__pyx_k308p, __pyx_k308, sizeof(__pyx_k308), 0},
{&__pyx_k310p, __pyx_k310, sizeof(__pyx_k310), 0},
{&__pyx_k314p, __pyx_k314, sizeof(__pyx_k314), 0},
{&__pyx_k316p, __pyx_k316, sizeof(__pyx_k316), 0},
{&__pyx_k318p, __pyx_k318, sizeof(__pyx_k318), 0},
{&__pyx_k321p, __pyx_k321, sizeof(__pyx_k321), 0},
{&__pyx_k322p, __pyx_k322, sizeof(__pyx_k322), 0},
{&__pyx_k323p, __pyx_k323, sizeof(__pyx_k323), 0},
{&__pyx_k327p, __pyx_k327, sizeof(__pyx_k327), 0},
{&__pyx_k331p, __pyx_k331, sizeof(__pyx_k331), 0},
{&__pyx_k332p, __pyx_k332, sizeof(__pyx_k332), 0},
{&__pyx_k333p, __pyx_k333, sizeof(__pyx_k333), 0},
{&__pyx_k334p, __pyx_k334, sizeof(__pyx_k334), 0},
{&__pyx_k335p, __pyx_k335, sizeof(__pyx_k335), 0},
{&__pyx_k336p, __pyx_k336, sizeof(__pyx_k336), 0},
{&__pyx_k337p, __pyx_k337, sizeof(__pyx_k337), 0},
{&__pyx_k338p, __pyx_k338, sizeof(__pyx_k338), 0},
{&__pyx_k339p, __pyx_k339, sizeof(__pyx_k339), 0},
{&__pyx_k340p, __pyx_k340, sizeof(__pyx_k340), 0},
{&__pyx_k341p, __pyx_k341, sizeof(__pyx_k341), 0},
{&__pyx_k342p, __pyx_k342, sizeof(__pyx_k342), 0},
{&__pyx_k345p, __pyx_k345, sizeof(__pyx_k345), 0},
{&__pyx_k346p, __pyx_k346, sizeof(__pyx_k346), 0},
{&__pyx_k348p, __pyx_k348, sizeof(__pyx_k348), 0},
{&__pyx_k350p, __pyx_k350, sizeof(__pyx_k350), 0},
{&__pyx_k351p, __pyx_k351, sizeof(__pyx_k351), 0},
{&__pyx_k352p, __pyx_k352, sizeof(__pyx_k352), 0},
{&__pyx_k353p, __pyx_k353, sizeof(__pyx_k353), 0},
{&__pyx_k354p, __pyx_k354, sizeof(__pyx_k354), 0},
{&__pyx_k355p, __pyx_k355, sizeof(__pyx_k355), 0},
{&__pyx_k362p, __pyx_k362, sizeof(__pyx_k362), 0},
{&__pyx_k363p, __pyx_k363, sizeof(__pyx_k363), 0},
{&__pyx_k364p, __pyx_k364, sizeof(__pyx_k364), 0},
{&__pyx_k365p, __pyx_k365, sizeof(__pyx_k365), 0},
{&__pyx_k366p, __pyx_k366, sizeof(__pyx_k366), 0},
{&__pyx_k367p, __pyx_k367, sizeof(__pyx_k367), 0},
{&__pyx_k368p, __pyx_k368, sizeof(__pyx_k368), 0},
{&__pyx_k369p, __pyx_k369, sizeof(__pyx_k369), 0},
{&__pyx_k370p, __pyx_k370, sizeof(__pyx_k370), 0},
{&__pyx_k373p, __pyx_k373, sizeof(__pyx_k373), 0},
{&__pyx_k376p, __pyx_k376, sizeof(__pyx_k376), 0},
{&__pyx_k377p, __pyx_k377, sizeof(__pyx_k377), 0},
{&__pyx_k378p, __pyx_k378, sizeof(__pyx_k378), 0},
{&__pyx_k379p, __pyx_k379, sizeof(__pyx_k379), 0},
{&__pyx_k380p, __pyx_k380, sizeof(__pyx_k380), 0},
{&__pyx_k381p, __pyx_k381, sizeof(__pyx_k381), 0},
{&__pyx_k382p, __pyx_k382, sizeof(__pyx_k382), 0},
{&__pyx_k383p, __pyx_k383, sizeof(__pyx_k383), 0},
{&__pyx_k384p, __pyx_k384, sizeof(__pyx_k384), 0},
{&__pyx_k385p, __pyx_k385, sizeof(__pyx_k385), 0},
{&__pyx_k386p, __pyx_k386, sizeof(__pyx_k386), 0},
{&__pyx_k391p, __pyx_k391, sizeof(__pyx_k391), 0},
{&__pyx_k392p, __pyx_k392, sizeof(__pyx_k392), 0},
{&__pyx_k399p, __pyx_k399, sizeof(__pyx_k399), 0},
{&__pyx_k400p, __pyx_k400, sizeof(__pyx_k400), 0},
{&__pyx_k402p, __pyx_k402, sizeof(__pyx_k402), 0},
{&__pyx_k404p, __pyx_k404, sizeof(__pyx_k404), 0},
{&__pyx_k406p, __pyx_k406, sizeof(__pyx_k406), 0},
{&__pyx_k407p, __pyx_k407, sizeof(__pyx_k407), 0},
{&__pyx_k408p, __pyx_k408, sizeof(__pyx_k408), 0},
{&__pyx_k409p, __pyx_k409, sizeof(__pyx_k409), 0},
{&__pyx_k410p, __pyx_k410, sizeof(__pyx_k410), 0},
{&__pyx_k411p, __pyx_k411, sizeof(__pyx_k411), 0},
{&__pyx_k412p, __pyx_k412, sizeof(__pyx_k412), 0},
{&__pyx_k413p, __pyx_k413, sizeof(__pyx_k413), 0},
{&__pyx_k414p, __pyx_k414, sizeof(__pyx_k414), 0},
{&__pyx_k416p, __pyx_k416, sizeof(__pyx_k416), 0},
{&__pyx_k417p, __pyx_k417, sizeof(__pyx_k417), 0},
{&__pyx_k418p, __pyx_k418, sizeof(__pyx_k418), 0},
{&__pyx_k419p, __pyx_k419, sizeof(__pyx_k419), 0},
{&__pyx_k420p, __pyx_k420, sizeof(__pyx_k420), 0},
{&__pyx_k421p, __pyx_k421, sizeof(__pyx_k421), 0},
{&__pyx_k422p, __pyx_k422, sizeof(__pyx_k422), 0},
{&__pyx_k423p, __pyx_k423, sizeof(__pyx_k423), 0},
{&__pyx_k424p, __pyx_k424, sizeof(__pyx_k424), 0},
{&__pyx_k425p, __pyx_k425, sizeof(__pyx_k425), 0},
{&__pyx_k426p, __pyx_k426, sizeof(__pyx_k426), 0},
{&__pyx_k427p, __pyx_k427, sizeof(__pyx_k427), 0},
{&__pyx_k428p, __pyx_k428, sizeof(__pyx_k428), 0},
{&__pyx_k429p, __pyx_k429, sizeof(__pyx_k429), 0},
{&__pyx_k430p, __pyx_k430, sizeof(__pyx_k430), 0},
{&__pyx_k431p, __pyx_k431, sizeof(__pyx_k431), 0},
{&__pyx_k432p, __pyx_k432, sizeof(__pyx_k432), 0},
{&__pyx_k433p, __pyx_k433, sizeof(__pyx_k433), 0},
{&__pyx_k434p, __pyx_k434, sizeof(__pyx_k434), 0},
{&__pyx_k435p, __pyx_k435, sizeof(__pyx_k435), 0},
{&__pyx_k436p, __pyx_k436, sizeof(__pyx_k436), 0},
{&__pyx_k437p, __pyx_k437, sizeof(__pyx_k437), 0},
{&__pyx_k438p, __pyx_k438, sizeof(__pyx_k438), 0},
{&__pyx_k439p, __pyx_k439, sizeof(__pyx_k439), 0},
{&__pyx_k442p, __pyx_k442, sizeof(__pyx_k442), 0},
{&__pyx_k445p, __pyx_k445, sizeof(__pyx_k445), 0},
{&__pyx_k450p, __pyx_k450, sizeof(__pyx_k450), 0},
{&__pyx_k451p, __pyx_k451, sizeof(__pyx_k451), 0},
{&__pyx_k455p, __pyx_k455, sizeof(__pyx_k455), 0},
{&__pyx_k456p, __pyx_k456, sizeof(__pyx_k456), 0},
{&__pyx_k457p, __pyx_k457, sizeof(__pyx_k457), 0},
{&__pyx_k458p, __pyx_k458, sizeof(__pyx_k458), 0},
{&__pyx_k459p, __pyx_k459, sizeof(__pyx_k459), 0},
{&__pyx_k460p, __pyx_k460, sizeof(__pyx_k460), 0},
{&__pyx_k469p, __pyx_k469, sizeof(__pyx_k469), 0},
{&__pyx_k470p, __pyx_k470, sizeof(__pyx_k470), 0},
{&__pyx_k471p, __pyx_k471, sizeof(__pyx_k471), 0},
{&__pyx_k472p, __pyx_k472, sizeof(__pyx_k472), 0},
{&__pyx_k473p, __pyx_k473, sizeof(__pyx_k473), 0},
{&__pyx_k477p, __pyx_k477, sizeof(__pyx_k477), 0},
{&__pyx_k485p, __pyx_k485, sizeof(__pyx_k485), 0},
{&__pyx_k486p, __pyx_k486, sizeof(__pyx_k486), 0},
{&__pyx_k487p, __pyx_k487, sizeof(__pyx_k487), 0},
{&__pyx_k488p, __pyx_k488, sizeof(__pyx_k488), 0},
{&__pyx_k489p, __pyx_k489, sizeof(__pyx_k489), 0},
{&__pyx_k490p, __pyx_k490, sizeof(__pyx_k490), 0},
{&__pyx_k491p, __pyx_k491, sizeof(__pyx_k491), 0},
{&__pyx_k492p, __pyx_k492, sizeof(__pyx_k492), 0},
{&__pyx_k493p, __pyx_k493, sizeof(__pyx_k493), 0},
{&__pyx_k494p, __pyx_k494, sizeof(__pyx_k494), 0},
{&__pyx_k506p, __pyx_k506, sizeof(__pyx_k506), 0},
{&__pyx_k507p, __pyx_k507, sizeof(__pyx_k507), 0},
{&__pyx_k508p, __pyx_k508, sizeof(__pyx_k508), 0},
{&__pyx_k509p, __pyx_k509, sizeof(__pyx_k509), 0},
{&__pyx_k510p, __pyx_k510, sizeof(__pyx_k510), 0},
{&__pyx_k511p, __pyx_k511, sizeof(__pyx_k511), 0},
{&__pyx_k512p, __pyx_k512, sizeof(__pyx_k512), 0},
{&__pyx_k513p, __pyx_k513, sizeof(__pyx_k513), 0},
{&__pyx_k514p, __pyx_k514, sizeof(__pyx_k514), 0},
{&__pyx_k516p, __pyx_k516, sizeof(__pyx_k516), 0},
{&__pyx_k517p, __pyx_k517, sizeof(__pyx_k517), 0},
{&__pyx_k518p, __pyx_k518, sizeof(__pyx_k518), 0},
{&__pyx_k519p, __pyx_k519, sizeof(__pyx_k519), 0},
{&__pyx_k520p, __pyx_k520, sizeof(__pyx_k520), 0},
{&__pyx_k521p, __pyx_k521, sizeof(__pyx_k521), 0},
{&__pyx_k523p, __pyx_k523, sizeof(__pyx_k523), 0},
{&__pyx_k524p, __pyx_k524, sizeof(__pyx_k524), 0},
{&__pyx_k525p, __pyx_k525, sizeof(__pyx_k525), 0},
{&__pyx_k526p, __pyx_k526, sizeof(__pyx_k526), 0},
{&__pyx_k527p, __pyx_k527, sizeof(__pyx_k527), 0},
{&__pyx_k528p, __pyx_k528, sizeof(__pyx_k528), 0},
{&__pyx_k529p, __pyx_k529, sizeof(__pyx_k529), 0},
{&__pyx_k547p, __pyx_k547, sizeof(__pyx_k547), 0},
{&__pyx_k548p, __pyx_k548, sizeof(__pyx_k548), 0},
{&__pyx_k553p, __pyx_k553, sizeof(__pyx_k553), 0},
{&__pyx_k554p, __pyx_k554, sizeof(__pyx_k554), 0},
{&__pyx_k560p, __pyx_k560, sizeof(__pyx_k560), 0},
{&__pyx_k563p, __pyx_k563, sizeof(__pyx_k563), 0},
{&__pyx_k579p, __pyx_k579, sizeof(__pyx_k579), 0},
{&__pyx_k580p, __pyx_k580, sizeof(__pyx_k580), 0},
{&__pyx_k584p, __pyx_k584, sizeof(__pyx_k584), 0},
{&__pyx_k586p, __pyx_k586, sizeof(__pyx_k586), 0},
{&__pyx_k587p, __pyx_k587, sizeof(__pyx_k587), 0},
{&__pyx_k588p, __pyx_k588, sizeof(__pyx_k588), 0},
{&__pyx_k592p, __pyx_k592, sizeof(__pyx_k592), 0},
{&__pyx_k593p, __pyx_k593, sizeof(__pyx_k593), 0},
{&__pyx_k594p, __pyx_k594, sizeof(__pyx_k594), 0},
{&__pyx_k595p, __pyx_k595, sizeof(__pyx_k595), 0},
{&__pyx_k596p, __pyx_k596, sizeof(__pyx_k596), 0},
{&__pyx_k597p, __pyx_k597, sizeof(__pyx_k597), 0},
{&__pyx_k598p, __pyx_k598, sizeof(__pyx_k598), 0},
{&__pyx_k601p, __pyx_k601, sizeof(__pyx_k601), 0},
{&__pyx_k611p, __pyx_k611, sizeof(__pyx_k611), 0},
{&__pyx_k612p, __pyx_k612, sizeof(__pyx_k612), 0},
{&__pyx_k613p, __pyx_k613, sizeof(__pyx_k613), 0},
{&__pyx_k614p, __pyx_k614, sizeof(__pyx_k614), 0},
{&__pyx_k615p, __pyx_k615, sizeof(__pyx_k615), 0},
{&__pyx_k618p, __pyx_k618, sizeof(__pyx_k618), 0},
{&__pyx_k619p, __pyx_k619, sizeof(__pyx_k619), 0},
{&__pyx_k621p, __pyx_k621, sizeof(__pyx_k621), 0},
{&__pyx_k622p, __pyx_k622, sizeof(__pyx_k622), 0},
{&__pyx_k623p, __pyx_k623, sizeof(__pyx_k623), 0},
{&__pyx_k624p, __pyx_k624, sizeof(__pyx_k624), 0},
{&__pyx_k625p, __pyx_k625, sizeof(__pyx_k625), 0},
{&__pyx_k626p, __pyx_k626, sizeof(__pyx_k626), 0},
{&__pyx_k627p, __pyx_k627, sizeof(__pyx_k627), 0},
{&__pyx_k628p, __pyx_k628, sizeof(__pyx_k628), 0},
{&__pyx_k629p, __pyx_k629, sizeof(__pyx_k629), 0},
{&__pyx_k630p, __pyx_k630, sizeof(__pyx_k630), 0},
{&__pyx_k631p, __pyx_k631, sizeof(__pyx_k631), 0},
{&__pyx_k632p, __pyx_k632, sizeof(__pyx_k632), 0},
{&__pyx_k634p, __pyx_k634, sizeof(__pyx_k634), 0},
{&__pyx_k638p, __pyx_k638, sizeof(__pyx_k638), 0},
{&__pyx_k640p, __pyx_k640, sizeof(__pyx_k640), 0},
{&__pyx_k644p, __pyx_k644, sizeof(__pyx_k644), 0},
{&__pyx_k648p, __pyx_k648, sizeof(__pyx_k648), 0},
{&__pyx_k649p, __pyx_k649, sizeof(__pyx_k649), 0},
{&__pyx_k650p, __pyx_k650, sizeof(__pyx_k650), 0},
{&__pyx_k651p, __pyx_k651, sizeof(__pyx_k651), 0},
{&__pyx_k652p, __pyx_k652, sizeof(__pyx_k652), 0},
{&__pyx_k653p, __pyx_k653, sizeof(__pyx_k653), 0},
{&__pyx_k654p, __pyx_k654, sizeof(__pyx_k654), 0},
{&__pyx_k656p, __pyx_k656, sizeof(__pyx_k656), 0},
{&__pyx_k657p, __pyx_k657, sizeof(__pyx_k657), 0},
{&__pyx_k658p, __pyx_k658, sizeof(__pyx_k658), 0},
{&__pyx_k659p, __pyx_k659, sizeof(__pyx_k659), 0},
{&__pyx_k660p, __pyx_k660, sizeof(__pyx_k660), 0},
{&__pyx_k673p, __pyx_k673, sizeof(__pyx_k673), 0},
{&__pyx_k677p, __pyx_k677, sizeof(__pyx_k677), 0},
{&__pyx_k683p, __pyx_k683, sizeof(__pyx_k683), 0},
{&__pyx_k684p, __pyx_k684, sizeof(__pyx_k684), 0},
{&__pyx_k685p, __pyx_k685, sizeof(__pyx_k685), 0},
{&__pyx_k686p, __pyx_k686, sizeof(__pyx_k686), 0},
{&__pyx_k687p, __pyx_k687, sizeof(__pyx_k687), 0},
{&__pyx_k689p, __pyx_k689, sizeof(__pyx_k689), 0},
{&__pyx_k690p, __pyx_k690, sizeof(__pyx_k690), 0},
{&__pyx_k691p, __pyx_k691, sizeof(__pyx_k691), 0},
{&__pyx_k692p, __pyx_k692, sizeof(__pyx_k692), 0},
{&__pyx_k693p, __pyx_k693, sizeof(__pyx_k693), 0},
{&__pyx_k694p, __pyx_k694, sizeof(__pyx_k694), 0},
{&__pyx_k695p, __pyx_k695, sizeof(__pyx_k695), 0},
{&__pyx_k698p, __pyx_k698, sizeof(__pyx_k698), 0},
{&__pyx_k701p, __pyx_k701, sizeof(__pyx_k701), 0},
{&__pyx_k703p, __pyx_k703, sizeof(__pyx_k703), 0},
{&__pyx_k704p, __pyx_k704, sizeof(__pyx_k704), 0},
{&__pyx_k705p, __pyx_k705, sizeof(__pyx_k705), 0},
{&__pyx_k706p, __pyx_k706, sizeof(__pyx_k706), 0},
{&__pyx_k707p, __pyx_k707, sizeof(__pyx_k707), 0},
{&__pyx_k709p, __pyx_k709, sizeof(__pyx_k709), 0},
{&__pyx_k710p, __pyx_k710, sizeof(__pyx_k710), 0},
{&__pyx_k711p, __pyx_k711, sizeof(__pyx_k711), 0},
{&__pyx_k712p, __pyx_k712, sizeof(__pyx_k712), 0},
{&__pyx_k713p, __pyx_k713, sizeof(__pyx_k713), 0},
{&__pyx_k714p, __pyx_k714, sizeof(__pyx_k714), 0},
{&__pyx_k715p, __pyx_k715, sizeof(__pyx_k715), 0},
{&__pyx_k716p, __pyx_k716, sizeof(__pyx_k716), 0},
{&__pyx_k717p, __pyx_k717, sizeof(__pyx_k717), 0},
{&__pyx_k718p, __pyx_k718, sizeof(__pyx_k718), 0},
{&__pyx_k720p, __pyx_k720, sizeof(__pyx_k720), 0},
{&__pyx_k721p, __pyx_k721, sizeof(__pyx_k721), 0},
{&__pyx_k722p, __pyx_k722, sizeof(__pyx_k722), 0},
{&__pyx_k723p, __pyx_k723, sizeof(__pyx_k723), 0},
{&__pyx_k724p, __pyx_k724, sizeof(__pyx_k724), 0},
{&__pyx_k725p, __pyx_k725, sizeof(__pyx_k725), 0},
{&__pyx_k727p, __pyx_k727, sizeof(__pyx_k727), 0},
{&__pyx_k728p, __pyx_k728, sizeof(__pyx_k728), 0},
{&__pyx_k729p, __pyx_k729, sizeof(__pyx_k729), 0},
{&__pyx_k730p, __pyx_k730, sizeof(__pyx_k730), 0},
{&__pyx_k731p, __pyx_k731, sizeof(__pyx_k731), 0},
{&__pyx_k733p, __pyx_k733, sizeof(__pyx_k733), 0},
{&__pyx_k734p, __pyx_k734, sizeof(__pyx_k734), 0},
{&__pyx_k735p, __pyx_k735, sizeof(__pyx_k735), 0},
{&__pyx_k736p, __pyx_k736, sizeof(__pyx_k736), 0},
{&__pyx_k737p, __pyx_k737, sizeof(__pyx_k737), 0},
{&__pyx_k738p, __pyx_k738, sizeof(__pyx_k738), 0},
{&__pyx_k739p, __pyx_k739, sizeof(__pyx_k739), 0},
{&__pyx_k740p, __pyx_k740, sizeof(__pyx_k740), 0},
{&__pyx_k741p, __pyx_k741, sizeof(__pyx_k741), 0},
{&__pyx_k742p, __pyx_k742, sizeof(__pyx_k742), 0},
{0, 0, 0, 0}
};
static struct __pyx_vtabstruct_4lxml_5etree__TempStore __pyx_vtable_4lxml_5etree__TempStore;

static PyObject *__pyx_tp_new_4lxml_5etree__TempStore(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__TempStore *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__TempStore *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__TempStore **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__TempStore;
p->_storage = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__TempStore(PyObject *o) {
struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
Py_XDECREF(p->_storage);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__TempStore(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
if (p->_storage) {
  e = (*v)(p->_storage, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__TempStore(PyObject *o) {
struct __pyx_obj_4lxml_5etree__TempStore *p = (struct __pyx_obj_4lxml_5etree__TempStore *)o;
Py_XDECREF(p->_storage);
p->_storage = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__TempStore[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__TempStore = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__TempStore = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__TempStore = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__TempStore = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__TempStore = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._TempStore", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__TempStore), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__TempStore, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__TempStore, /*tp_as_number*/
&__pyx_tp_as_sequence__TempStore, /*tp_as_sequence*/
&__pyx_tp_as_mapping__TempStore, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__TempStore, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__TempStore, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__TempStore, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__TempStore, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_10_TempStore___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__TempStore, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext __pyx_vtable_4lxml_5etree__ExceptionContext;

static PyObject *__pyx_tp_new_4lxml_5etree__ExceptionContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ExceptionContext *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ExceptionContext **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ExceptionContext;
p->_exc_info = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ExceptionContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
Py_XDECREF(p->_exc_info);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ExceptionContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
if (p->_exc_info) {
  e = (*v)(p->_exc_info, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ExceptionContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ExceptionContext *p = (struct __pyx_obj_4lxml_5etree__ExceptionContext *)o;
Py_XDECREF(p->_exc_info);
p->_exc_info = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ExceptionContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ExceptionContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ExceptionContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ExceptionContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ExceptionContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ExceptionContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ExceptionContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ExceptionContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ExceptionContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ExceptionContext, /*tp_as_number*/
&__pyx_tp_as_sequence__ExceptionContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ExceptionContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ExceptionContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ExceptionContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ExceptionContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ExceptionContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ExceptionContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_QName(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_QName *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_QName *)o);
p->text = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_QName(PyObject *o) {
struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
Py_XDECREF(p->text);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_QName(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
if (p->text) {
  e = (*v)(p->text, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_QName(PyObject *o) {
struct __pyx_obj_4lxml_5etree_QName *p = (struct __pyx_obj_4lxml_5etree_QName *)o;
Py_XDECREF(p->text);
p->text = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_QName[] = {
{"__str__", (PyCFunction)__pyx_pf_4lxml_5etree_5QName___str__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_QName[] = {
{"text", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_QName, text), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_QName = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_QName = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_QName = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_QName = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_QName = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.QName", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_QName), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_QName, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_QName, /*tp_as_number*/
&__pyx_tp_as_sequence_QName, /*tp_as_sequence*/
&__pyx_tp_as_mapping_QName, /*tp_as_mapping*/
__pyx_pf_4lxml_5etree_5QName___hash__, /*tp_hash*/
0, /*tp_call*/
__pyx_pf_4lxml_5etree_5QName___str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_QName, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"QName wrapper.\n\n    Pass a tag name by itself or a namespace URI and a tag name to\n    create a qualified name.  The ``text`` property holds the\n    qualified name in ``{namespace}tagname`` notation.\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*/
__pyx_tp_traverse_4lxml_5etree_QName, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_QName, /*tp_clear*/
__pyx_pf_4lxml_5etree_5QName___richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_QName, /*tp_methods*/
__pyx_members_4lxml_5etree_QName, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_5QName___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_QName, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__BaseParser __pyx_vtable_4lxml_5etree__BaseParser;

static PyObject *__pyx_tp_new_4lxml_5etree__BaseParser(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__BaseParser *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__BaseParser *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__BaseParser **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseParser;
p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
p->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
p->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
p->_filename = Py_None; Py_INCREF(Py_None);
p->_target = Py_None; Py_INCREF(Py_None);
p->_default_encoding = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__BaseParser(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
Py_XDECREF(((PyObject *)p->_class_lookup));
Py_XDECREF(((PyObject *)p->_resolvers));
Py_XDECREF(((PyObject *)p->_parser_context));
Py_XDECREF(((PyObject *)p->_push_parser_context));
Py_XDECREF(p->_filename);
Py_XDECREF(p->_target);
Py_XDECREF(p->_default_encoding);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__BaseParser(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
if (p->_class_lookup) {
  e = (*v)(((PyObject*)p->_class_lookup), a); if (e) return e;
}
if (p->_resolvers) {
  e = (*v)(((PyObject*)p->_resolvers), a); if (e) return e;
}
if (p->_parser_context) {
  e = (*v)(((PyObject*)p->_parser_context), a); if (e) return e;
}
if (p->_push_parser_context) {
  e = (*v)(((PyObject*)p->_push_parser_context), a); if (e) return e;
}
if (p->_filename) {
  e = (*v)(p->_filename, a); if (e) return e;
}
if (p->_target) {
  e = (*v)(p->_target, a); if (e) return e;
}
if (p->_default_encoding) {
  e = (*v)(p->_default_encoding, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__BaseParser(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseParser *p = (struct __pyx_obj_4lxml_5etree__BaseParser *)o;
Py_XDECREF(((PyObject *)p->_class_lookup));
p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_resolvers));
p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_parser_context));
p->_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_push_parser_context));
p->_push_parser_context = ((struct __pyx_obj_4lxml_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_filename);
p->_filename = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target);
p->_target = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_default_encoding);
p->_default_encoding = Py_None; Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_11_BaseParser_9error_log___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_resolvers(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_11_BaseParser_9resolvers___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_11_BaseParser_version(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_11_BaseParser_7version___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseParser[] = {
{"setElementClassLookup", (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_setElementClassLookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_11_BaseParser_setElementClassLookup},
{"set_element_class_lookup", (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_set_element_class_lookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_11_BaseParser_set_element_class_lookup},
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_copy, METH_NOARGS, __pyx_doc_4lxml_5etree_11_BaseParser_copy},
{"makeelement", (PyCFunction)__pyx_pf_4lxml_5etree_11_BaseParser_makeelement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_11_BaseParser_makeelement},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__BaseParser[] = {
{"error_log", __pyx_getprop_4lxml_5etree_11_BaseParser_error_log, 0, __pyx_k20, 0},
{"resolvers", __pyx_getprop_4lxml_5etree_11_BaseParser_resolvers, 0, 0, 0},
{"version", __pyx_getprop_4lxml_5etree_11_BaseParser_version, 0, __pyx_k21, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BaseParser = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__BaseParser = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__BaseParser = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BaseParser = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__BaseParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._BaseParser", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__BaseParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__BaseParser, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__BaseParser, /*tp_as_number*/
&__pyx_tp_as_sequence__BaseParser, /*tp_as_sequence*/
&__pyx_tp_as_mapping__BaseParser, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__BaseParser, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__BaseParser, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__BaseParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__BaseParser, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__BaseParser, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_11_BaseParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__BaseParser, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__Document __pyx_vtable_4lxml_5etree__Document;

static PyObject *__pyx_tp_new_4lxml_5etree__Document(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlDocument *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct LxmlDocument *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__Document **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__Document;
p->_prefix_tail = Py_None; Py_INCREF(Py_None);
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Document(PyObject *o) {
struct LxmlDocument *p = (struct LxmlDocument *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_9_Document___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(p->_prefix_tail);
Py_XDECREF(((PyObject *)p->_parser));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Document(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlDocument *p = (struct LxmlDocument *)o;
if (p->_prefix_tail) {
  e = (*v)(p->_prefix_tail, a); if (e) return e;
}
if (p->_parser) {
  e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Document(PyObject *o) {
struct LxmlDocument *p = (struct LxmlDocument *)o;
Py_XDECREF(p->_prefix_tail);
p->_prefix_tail = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_parser));
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Document[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Document = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Document = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Document = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Document = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlDocumentType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Document", /*tp_name*/
sizeof(struct LxmlDocument), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Document, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__Document, /*tp_as_number*/
&__pyx_tp_as_sequence__Document, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Document, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Document, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree__Document, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Document, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Document, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Document, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_DocInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_DocInfo *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_DocInfo *)o);
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_DocInfo(PyObject *o) {
struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
Py_XDECREF(((PyObject *)p->_doc));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_DocInfo(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_DocInfo(PyObject *o) {
struct __pyx_obj_4lxml_5etree_DocInfo *p = (struct __pyx_obj_4lxml_5etree_DocInfo *)o;
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_root_name(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_9root_name___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_public_id(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_9public_id___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_system_url(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_10system_url___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_xml_version(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_11xml_version___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_encoding(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_8encoding___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_URL(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_3URL___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_doctype(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_7doctype___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_internalDTD(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_11internalDTD___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7DocInfo_externalDTD(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7DocInfo_11externalDTD___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_DocInfo[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree_DocInfo[] = {
{"root_name", __pyx_getprop_4lxml_5etree_7DocInfo_root_name, 0, __pyx_k1, 0},
{"public_id", __pyx_getprop_4lxml_5etree_7DocInfo_public_id, 0, __pyx_k2, 0},
{"system_url", __pyx_getprop_4lxml_5etree_7DocInfo_system_url, 0, __pyx_k3, 0},
{"xml_version", __pyx_getprop_4lxml_5etree_7DocInfo_xml_version, 0, __pyx_k4, 0},
{"encoding", __pyx_getprop_4lxml_5etree_7DocInfo_encoding, 0, __pyx_k5, 0},
{"URL", __pyx_getprop_4lxml_5etree_7DocInfo_URL, 0, __pyx_k6, 0},
{"doctype", __pyx_getprop_4lxml_5etree_7DocInfo_doctype, 0, __pyx_k7, 0},
{"internalDTD", __pyx_getprop_4lxml_5etree_7DocInfo_internalDTD, 0, __pyx_k8, 0},
{"externalDTD", __pyx_getprop_4lxml_5etree_7DocInfo_externalDTD, 0, __pyx_k9, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DocInfo = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_DocInfo = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DocInfo = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DocInfo = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_DocInfo = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.DocInfo", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_DocInfo), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_DocInfo, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_DocInfo, /*tp_as_number*/
&__pyx_tp_as_sequence_DocInfo, /*tp_as_sequence*/
&__pyx_tp_as_mapping_DocInfo, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_DocInfo, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Document information provided by parser and DTD.", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_DocInfo, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_DocInfo, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_DocInfo, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree_DocInfo, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_7DocInfo___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_DocInfo, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree__Element(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlElement *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct LxmlElement *)o);
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
p->_tag = Py_None; Py_INCREF(Py_None);
p->_attrib = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Element(PyObject *o) {
struct LxmlElement *p = (struct LxmlElement *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_8_Element___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(p->_tag);
Py_XDECREF(p->_attrib);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Element(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlElement *p = (struct LxmlElement *)o;
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
if (p->_tag) {
  e = (*v)(p->_tag, a); if (e) return e;
}
if (p->_attrib) {
  e = (*v)(p->_attrib, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Element(PyObject *o) {
struct LxmlElement *p = (struct LxmlElement *)o;
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_tag);
p->_tag = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_attrib);
p->_attrib = Py_None; Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree__Element(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static int __pyx_mp_ass_subscript_4lxml_5etree__Element(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_8_Element___setitem__(o, i, v);
}
else {
  return __pyx_pf_4lxml_5etree_8_Element___delitem__(o, i);
}
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_tag(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_3tag___get__(o);
}

static int __pyx_setprop_4lxml_5etree_8_Element_tag(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_8_Element_3tag___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_attrib(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_6attrib___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_text(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_4text___get__(o);
}

static int __pyx_setprop_4lxml_5etree_8_Element_text(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_8_Element_4text___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_tail(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_4tail___get__(o);
}

static int __pyx_setprop_4lxml_5etree_8_Element_tail(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_8_Element_4tail___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_prefix(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_6prefix___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_sourceline(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_10sourceline___get__(o);
}

static int __pyx_setprop_4lxml_5etree_8_Element_sourceline(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_8_Element_10sourceline___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Element_nsmap(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Element_5nsmap___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Element[] = {
{"_init", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element__init, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element__init},
{"__deepcopy__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___deepcopy__, METH_O, 0},
{"__copy__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___copy__, METH_NOARGS, 0},
{"set", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_set},
{"append", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_append, METH_O, __pyx_doc_4lxml_5etree_8_Element_append},
{"addnext", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_addnext, METH_O, __pyx_doc_4lxml_5etree_8_Element_addnext},
{"addprevious", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_addprevious, METH_O, __pyx_doc_4lxml_5etree_8_Element_addprevious},
{"extend", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_extend, METH_O, __pyx_doc_4lxml_5etree_8_Element_extend},
{"clear", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_clear, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_clear},
{"insert", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_insert},
{"remove", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_remove, METH_O, __pyx_doc_4lxml_5etree_8_Element_remove},
{"replace", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_replace},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___repr__, METH_NOARGS|METH_COEXIST, 0},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___getitem__, METH_O|METH_COEXIST, __pyx_doc_4lxml_5etree_8_Element___getitem__},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__reversed__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element___reversed__, METH_NOARGS, 0},
{"index", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_index},
{"get", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_get},
{"keys", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_keys, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_keys},
{"values", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_values, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_values},
{"items", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_items, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_items},
{"getchildren", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getchildren, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_getchildren},
{"getparent", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getparent, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_getparent},
{"getnext", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getnext, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_getnext},
{"getprevious", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getprevious, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_getprevious},
{"itersiblings", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_itersiblings, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_itersiblings},
{"iterancestors", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterancestors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_iterancestors},
{"iterdescendants", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterdescendants, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_iterdescendants},
{"iterchildren", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterchildren, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_iterchildren},
{"getroottree", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getroottree, METH_NOARGS, __pyx_doc_4lxml_5etree_8_Element_getroottree},
{"getiterator", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_getiterator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_getiterator},
{"iter", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_iter},
{"itertext", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_itertext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_itertext},
{"makeelement", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_makeelement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_makeelement},
{"find", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_find, METH_O, __pyx_doc_4lxml_5etree_8_Element_find},
{"findtext", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_findtext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_findtext},
{"findall", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_findall, METH_O, __pyx_doc_4lxml_5etree_8_Element_findall},
{"iterfind", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_iterfind, METH_O, __pyx_doc_4lxml_5etree_8_Element_iterfind},
{"xpath", (PyCFunction)__pyx_pf_4lxml_5etree_8_Element_xpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8_Element_xpath},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Element[] = {
{"tag", __pyx_getprop_4lxml_5etree_8_Element_tag, __pyx_setprop_4lxml_5etree_8_Element_tag, __pyx_k10, 0},
{"attrib", __pyx_getprop_4lxml_5etree_8_Element_attrib, 0, __pyx_k11, 0},
{"text", __pyx_getprop_4lxml_5etree_8_Element_text, __pyx_setprop_4lxml_5etree_8_Element_text, __pyx_k12, 0},
{"tail", __pyx_getprop_4lxml_5etree_8_Element_tail, __pyx_setprop_4lxml_5etree_8_Element_tail, __pyx_k13, 0},
{"prefix", __pyx_getprop_4lxml_5etree_8_Element_prefix, 0, __pyx_k14, 0},
{"sourceline", __pyx_getprop_4lxml_5etree_8_Element_sourceline, __pyx_setprop_4lxml_5etree_8_Element_sourceline, __pyx_k15, 0},
{"nsmap", __pyx_getprop_4lxml_5etree_8_Element_nsmap, 0, __pyx_k16, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Element = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
__pyx_pf_4lxml_5etree_8_Element___nonzero__, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Element = {
__pyx_pf_4lxml_5etree_8_Element___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree__Element, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_pf_4lxml_5etree_8_Element___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Element = {
__pyx_pf_4lxml_5etree_8_Element___len__, /*mp_length*/
__pyx_pf_4lxml_5etree_8_Element___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree__Element, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Element = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Element", /*tp_name*/
sizeof(struct LxmlElement), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Element, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_8_Element___repr__, /*tp_repr*/
&__pyx_tp_as_number__Element, /*tp_as_number*/
&__pyx_tp_as_sequence__Element, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Element, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Element, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Element class.  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*/
__pyx_tp_traverse_4lxml_5etree__Element, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Element, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_8_Element___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Element, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__Element, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Element, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement __pyx_vtable_4lxml_5etree___ContentOnlyElement;

static PyObject *__pyx_tp_new_4lxml_5etree___ContentOnlyElement(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree___ContentOnlyElement *p;
PyObject *o = __pyx_ptype_4lxml_5etree__Element->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree___ContentOnlyElement *)o);
*(struct __pyx_vtabstruct_4lxml_5etree___ContentOnlyElement **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree___ContentOnlyElement(PyObject *o) {
__pyx_ptype_4lxml_5etree__Element->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree___ContentOnlyElement(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Element->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree___ContentOnlyElement(PyObject *o) {
__pyx_ptype_4lxml_5etree__Element->tp_clear(o);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree___ContentOnlyElement(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static int __pyx_mp_ass_subscript_4lxml_5etree___ContentOnlyElement(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_4lxml_5etree__Element->tp_as_mapping && __pyx_ptype_4lxml_5etree__Element->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_4lxml_5etree__Element->tp_as_mapping->mp_ass_subscript(o, i, v);
  PyErr_Format(PyExc_NotImplementedError,
    "Subscript deletion not supported by %s", o->ob_type->tp_name);
  return -1;
}
}

static int __pyx_sq_ass_slice_4lxml_5etree___ContentOnlyElement(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_20__ContentOnlyElement___setslice__(o, i, j, v);
}
else {
  if (__pyx_ptype_4lxml_5etree__Element->tp_as_sequence && __pyx_ptype_4lxml_5etree__Element->tp_as_sequence->sq_ass_slice)
    return __pyx_ptype_4lxml_5etree__Element->tp_as_sequence->sq_ass_slice(o, i, j, v);
  PyErr_Format(PyExc_NotImplementedError,
    "2-element slice deletion not supported by %s", o->ob_type->tp_name);
  return -1;
}
}

static PyObject *__pyx_getprop_4lxml_5etree_20__ContentOnlyElement_attrib(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_6attrib___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_20__ContentOnlyElement_text(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___get__(o);
}

static int __pyx_setprop_4lxml_5etree_20__ContentOnlyElement_text(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_20__ContentOnlyElement_4text___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree___ContentOnlyElement[] = {
{"set", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_set, METH_VARARGS|METH_KEYWORDS, 0},
{"append", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_append, METH_O, 0},
{"insert", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_insert, METH_VARARGS|METH_KEYWORDS, 0},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__, METH_O|METH_COEXIST, 0},
{"get", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_get, METH_VARARGS|METH_KEYWORDS, 0},
{"keys", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_keys, METH_NOARGS, 0},
{"items", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_items, METH_NOARGS, 0},
{"values", (PyCFunction)__pyx_pf_4lxml_5etree_20__ContentOnlyElement_values, METH_NOARGS, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree___ContentOnlyElement[] = {
{"attrib", __pyx_getprop_4lxml_5etree_20__ContentOnlyElement_attrib, 0, 0, 0},
{"text", __pyx_getprop_4lxml_5etree_20__ContentOnlyElement_text, __pyx_setprop_4lxml_5etree_20__ContentOnlyElement_text, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number___ContentOnlyElement = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence___ContentOnlyElement = {
__pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree___ContentOnlyElement, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
__pyx_sq_ass_slice_4lxml_5etree___ContentOnlyElement, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___ContentOnlyElement = {
__pyx_pf_4lxml_5etree_20__ContentOnlyElement___len__, /*mp_length*/
__pyx_pf_4lxml_5etree_20__ContentOnlyElement___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree___ContentOnlyElement, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer___ContentOnlyElement = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree___ContentOnlyElement = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.__ContentOnlyElement", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree___ContentOnlyElement), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree___ContentOnlyElement, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number___ContentOnlyElement, /*tp_as_number*/
&__pyx_tp_as_sequence___ContentOnlyElement, /*tp_as_sequence*/
&__pyx_tp_as_mapping___ContentOnlyElement, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer___ContentOnlyElement, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree___ContentOnlyElement, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree___ContentOnlyElement, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree___ContentOnlyElement, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree___ContentOnlyElement, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree___ContentOnlyElement, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__Comment __pyx_vtable_4lxml_5etree__Comment;

static PyObject *__pyx_tp_new_4lxml_5etree__Comment(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__Comment *p;
PyObject *o = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__Comment *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__Comment **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__Comment;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Comment(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Comment(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Comment(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_8_Comment_tag(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_8_Comment_3tag___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Comment[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_8_Comment___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Comment[] = {
{"tag", __pyx_getprop_4lxml_5etree_8_Comment_tag, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Comment = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Comment = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Comment = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Comment = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__Comment = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Comment", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__Comment), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Comment, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_8_Comment___repr__, /*tp_repr*/
&__pyx_tp_as_number__Comment, /*tp_as_number*/
&__pyx_tp_as_sequence__Comment, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Comment, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Comment, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__Comment, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Comment, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Comment, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__Comment, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Comment, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction __pyx_vtable_4lxml_5etree__ProcessingInstruction;

static PyObject *__pyx_tp_new_4lxml_5etree__ProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ProcessingInstruction *p;
PyObject *o = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ProcessingInstruction *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ProcessingInstruction **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ProcessingInstruction(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ProcessingInstruction(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ProcessingInstruction(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_22_ProcessingInstruction_tag(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_3tag___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_22_ProcessingInstruction_target(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___get__(o);
}

static int __pyx_setprop_4lxml_5etree_22_ProcessingInstruction_target(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_22_ProcessingInstruction_6target___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ProcessingInstruction[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__ProcessingInstruction[] = {
{"tag", __pyx_getprop_4lxml_5etree_22_ProcessingInstruction_tag, 0, 0, 0},
{"target", __pyx_getprop_4lxml_5etree_22_ProcessingInstruction_target, __pyx_setprop_4lxml_5etree_22_ProcessingInstruction_target, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ProcessingInstruction = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ProcessingInstruction = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ProcessingInstruction = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ProcessingInstruction = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ProcessingInstruction = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ProcessingInstruction", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ProcessingInstruction), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ProcessingInstruction, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_22_ProcessingInstruction___repr__, /*tp_repr*/
&__pyx_tp_as_number__ProcessingInstruction, /*tp_as_number*/
&__pyx_tp_as_sequence__ProcessingInstruction, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ProcessingInstruction, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ProcessingInstruction, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ProcessingInstruction, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ProcessingInstruction, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ProcessingInstruction, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__ProcessingInstruction, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ProcessingInstruction, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__Entity __pyx_vtable_4lxml_5etree__Entity;

static PyObject *__pyx_tp_new_4lxml_5etree__Entity(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__Entity *p;
PyObject *o = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__Entity *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__Entity **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__Entity;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Entity(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Entity(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Entity(PyObject *o) {
__pyx_ptype_4lxml_5etree___ContentOnlyElement->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_7_Entity_tag(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7_Entity_3tag___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_7_Entity_name(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_7_Entity_4name___get__(o);
}

static int __pyx_setprop_4lxml_5etree_7_Entity_name(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_7_Entity_4name___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Entity[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_7_Entity___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Entity[] = {
{"tag", __pyx_getprop_4lxml_5etree_7_Entity_tag, 0, 0, 0},
{"name", __pyx_getprop_4lxml_5etree_7_Entity_name, __pyx_setprop_4lxml_5etree_7_Entity_name, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Entity = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Entity = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Entity = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Entity = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__Entity = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Entity", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__Entity), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Entity, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_7_Entity___repr__, /*tp_repr*/
&__pyx_tp_as_number__Entity, /*tp_as_number*/
&__pyx_tp_as_sequence__Entity, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Entity, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Entity, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__Entity, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Entity, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Entity, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__Entity, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Entity, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ElementTree __pyx_vtable_4lxml_5etree__ElementTree;

static PyObject *__pyx_tp_new_4lxml_5etree__ElementTree(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlElementTree *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct LxmlElementTree *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ElementTree **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ElementTree;
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
p->_context_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ElementTree(PyObject *o) {
struct LxmlElementTree *p = (struct LxmlElementTree *)o;
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(((PyObject *)p->_context_node));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ElementTree(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlElementTree *p = (struct LxmlElementTree *)o;
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
if (p->_context_node) {
  e = (*v)(((PyObject*)p->_context_node), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ElementTree(PyObject *o) {
struct LxmlElementTree *p = (struct LxmlElementTree *)o;
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_context_node));
p->_context_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_12_ElementTree_docinfo(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_12_ElementTree_7docinfo___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_12_ElementTree_parser(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_12_ElementTree_6parser___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementTree[] = {
{"parse", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_parse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_parse},
{"_setroot", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree__setroot, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree__setroot},
{"getroot", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getroot, METH_NOARGS, __pyx_doc_4lxml_5etree_12_ElementTree_getroot},
{"__copy__", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree___copy__, METH_NOARGS, 0},
{"__deepcopy__", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree___deepcopy__, METH_O, 0},
{"write", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_write},
{"getpath", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getpath, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_getpath},
{"getiterator", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_getiterator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_getiterator},
{"iter", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_iter, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_iter},
{"find", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_find, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_find},
{"findtext", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_findtext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_findtext},
{"findall", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_findall, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_findall},
{"iterfind", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_iterfind, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_iterfind},
{"xpath", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_xpath},
{"xslt", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xslt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_12_ElementTree_xslt},
{"relaxng", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_relaxng, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_relaxng},
{"xmlschema", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xmlschema, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_xmlschema},
{"xinclude", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_xinclude, METH_NOARGS, __pyx_doc_4lxml_5etree_12_ElementTree_xinclude},
{"write_c14n", (PyCFunction)__pyx_pf_4lxml_5etree_12_ElementTree_write_c14n, METH_O, __pyx_doc_4lxml_5etree_12_ElementTree_write_c14n},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__ElementTree[] = {
{"docinfo", __pyx_getprop_4lxml_5etree_12_ElementTree_docinfo, 0, __pyx_k17, 0},
{"parser", __pyx_getprop_4lxml_5etree_12_ElementTree_parser, 0, __pyx_k18, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ElementTree = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ElementTree = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ElementTree = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ElementTree = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementTreeType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ElementTree", /*tp_name*/
sizeof(struct LxmlElementTree), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ElementTree, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ElementTree, /*tp_as_number*/
&__pyx_tp_as_sequence__ElementTree, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ElementTree, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ElementTree, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ElementTree, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ElementTree, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ElementTree, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__ElementTree, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ElementTree, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree__Attrib(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__Attrib *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__Attrib *)o);
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Attrib(PyObject *o) {
struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
Py_XDECREF(((PyObject *)p->_element));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Attrib(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
if (p->_element) {
  e = (*v)(((PyObject*)p->_element), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Attrib(PyObject *o) {
struct __pyx_obj_4lxml_5etree__Attrib *p = (struct __pyx_obj_4lxml_5etree__Attrib *)o;
Py_XDECREF(((PyObject *)p->_element));
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree__Attrib(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static int __pyx_mp_ass_subscript_4lxml_5etree__Attrib(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_7_Attrib___setitem__(o, i, v);
}
else {
  return __pyx_pf_4lxml_5etree_7_Attrib___delitem__(o, i);
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Attrib[] = {
{"update", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_update, METH_O, 0},
{"pop", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_pop, METH_VARARGS|METH_KEYWORDS, 0},
{"clear", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_clear, METH_NOARGS, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___repr__, METH_NOARGS|METH_COEXIST, 0},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___getitem__, METH_O|METH_COEXIST, 0},
{"get", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_get, METH_VARARGS|METH_KEYWORDS, 0},
{"keys", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_keys, METH_NOARGS, 0},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib___iter__, METH_NOARGS|METH_COEXIST, 0},
{"iterkeys", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_iterkeys, METH_NOARGS, 0},
{"values", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_values, METH_NOARGS, 0},
{"itervalues", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_itervalues, METH_NOARGS, 0},
{"items", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_items, METH_NOARGS, 0},
{"iteritems", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_iteritems, METH_NOARGS, 0},
{"has_key", (PyCFunction)__pyx_pf_4lxml_5etree_7_Attrib_has_key, METH_O, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Attrib = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
__pyx_pf_4lxml_5etree_7_Attrib___nonzero__, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Attrib = {
__pyx_pf_4lxml_5etree_7_Attrib___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree__Attrib, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_pf_4lxml_5etree_7_Attrib___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Attrib = {
__pyx_pf_4lxml_5etree_7_Attrib___len__, /*mp_length*/
__pyx_pf_4lxml_5etree_7_Attrib___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree__Attrib, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Attrib = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__Attrib = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Attrib", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__Attrib), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Attrib, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_7_Attrib___repr__, /*tp_repr*/
&__pyx_tp_as_number__Attrib, /*tp_as_number*/
&__pyx_tp_as_sequence__Attrib, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Attrib, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Attrib, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__Attrib, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Attrib, /*tp_clear*/
__pyx_pf_4lxml_5etree_7_Attrib___richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_7_Attrib___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Attrib, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_7_Attrib___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Attrib, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree__AttribIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__AttribIterator *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__AttribIterator *)o);
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__AttribIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
Py_XDECREF(((PyObject *)p->_node));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__AttribIterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
if (p->_node) {
  e = (*v)(((PyObject*)p->_node), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__AttribIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree__AttribIterator *p = (struct __pyx_obj_4lxml_5etree__AttribIterator *)o;
Py_XDECREF(((PyObject *)p->_node));
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__AttribIterator[] = {
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_15_AttribIterator___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_15_AttribIterator___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__AttribIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__AttribIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__AttribIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__AttribIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__AttribIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._AttribIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__AttribIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__AttribIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__AttribIterator, /*tp_as_number*/
&__pyx_tp_as_sequence__AttribIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping__AttribIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__AttribIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Attribute iterator - for internal use only!\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__AttribIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__AttribIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_15_AttribIterator___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_15_AttribIterator___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree__AttribIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__AttribIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher __pyx_vtable_4lxml_5etree__ElementTagMatcher;

static PyObject *__pyx_tp_new_4lxml_5etree__ElementTagMatcher(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlElementTagMatcher *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct LxmlElementTagMatcher *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ElementTagMatcher **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
p->_pystrings = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher(PyObject *o) {
struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
Py_XDECREF(p->_pystrings);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ElementTagMatcher(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
if (p->_pystrings) {
  e = (*v)(p->_pystrings, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ElementTagMatcher(PyObject *o) {
struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
Py_XDECREF(p->_pystrings);
p->_pystrings = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementTagMatcher[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ElementTagMatcher = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ElementTagMatcher = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ElementTagMatcher = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ElementTagMatcher = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ElementTagMatcher", /*tp_name*/
sizeof(struct LxmlElementTagMatcher), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ElementTagMatcher, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ElementTagMatcher, /*tp_as_number*/
&__pyx_tp_as_sequence__ElementTagMatcher, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ElementTagMatcher, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ElementTagMatcher, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ElementTagMatcher, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ElementTagMatcher, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ElementTagMatcher, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ElementTagMatcher, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ElementIterator __pyx_vtable_4lxml_5etree__ElementIterator;

static PyObject *__pyx_tp_new_4lxml_5etree__ElementIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlElementIterator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_new(t, a, k);
if (!o) return 0;
p = ((struct LxmlElementIterator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ElementIterator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ElementIterator;
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ElementIterator(PyObject *o) {
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
Py_XDECREF(((PyObject *)p->_node));
__pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ElementIterator(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
e = __pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_traverse(o, v, a); if (e) return e;
if (p->_node) {
  e = (*v)(((PyObject*)p->_node), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ElementIterator(PyObject *o) {
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
__pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_clear(o);
Py_XDECREF(((PyObject *)p->_node));
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ElementIterator[] = {
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_16_ElementIterator___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_16_ElementIterator___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ElementIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ElementIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ElementIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ElementIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementIteratorType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ElementIterator", /*tp_name*/
sizeof(struct LxmlElementIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ElementIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ElementIterator, /*tp_as_number*/
&__pyx_tp_as_sequence__ElementIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ElementIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ElementIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ElementIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ElementIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_16_ElementIterator___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_16_ElementIterator___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ElementIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ElementIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator __pyx_vtable_4lxml_5etree_ElementChildIterator;

static PyObject *__pyx_tp_new_4lxml_5etree_ElementChildIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ElementChildIterator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementIterator->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ElementChildIterator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ElementChildIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ElementChildIterator;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementChildIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementChildIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementChildIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementChildIterator[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementChildIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementChildIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementChildIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementChildIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ElementChildIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementChildIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ElementChildIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementChildIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementChildIterator, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementChildIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementChildIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementChildIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Iterates over the children of an element.", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ElementChildIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementChildIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementChildIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_20ElementChildIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementChildIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator __pyx_vtable_4lxml_5etree_SiblingsIterator;

static PyObject *__pyx_tp_new_4lxml_5etree_SiblingsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_SiblingsIterator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementIterator->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_SiblingsIterator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_SiblingsIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_SiblingsIterator;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_SiblingsIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_SiblingsIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_SiblingsIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_SiblingsIterator[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SiblingsIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_SiblingsIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SiblingsIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SiblingsIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_SiblingsIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.SiblingsIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_SiblingsIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_SiblingsIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_SiblingsIterator, /*tp_as_number*/
&__pyx_tp_as_sequence_SiblingsIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_SiblingsIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_SiblingsIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Iterates over the siblings of an element.\n\n    You can pass the boolean keyword ``preceding`` to specify the direction.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_SiblingsIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_SiblingsIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_SiblingsIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_16SiblingsIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_SiblingsIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator __pyx_vtable_4lxml_5etree_AncestorsIterator;

static PyObject *__pyx_tp_new_4lxml_5etree_AncestorsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_AncestorsIterator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementIterator->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_AncestorsIterator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_AncestorsIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_AncestorsIterator;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_AncestorsIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_AncestorsIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_AncestorsIterator(PyObject *o) {
__pyx_ptype_4lxml_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_AncestorsIterator[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_AncestorsIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_AncestorsIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_AncestorsIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_AncestorsIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_AncestorsIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.AncestorsIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_AncestorsIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_AncestorsIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_AncestorsIterator, /*tp_as_number*/
&__pyx_tp_as_sequence_AncestorsIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_AncestorsIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_AncestorsIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Iterates over the ancestors of an element (from parent to parent).", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_AncestorsIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_AncestorsIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_AncestorsIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17AncestorsIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_AncestorsIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator __pyx_vtable_4lxml_5etree_ElementDepthFirstIterator;

static PyObject *__pyx_tp_new_4lxml_5etree_ElementDepthFirstIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ElementDepthFirstIterator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator;
p->_next_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
p->_top_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementDepthFirstIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
Py_XDECREF(((PyObject *)p->_next_node));
Py_XDECREF(((PyObject *)p->_top_node));
__pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementDepthFirstIterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
e = __pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_traverse(o, v, a); if (e) return e;
if (p->_next_node) {
  e = (*v)(((PyObject*)p->_next_node), a); if (e) return e;
}
if (p->_top_node) {
  e = (*v)(((PyObject*)p->_top_node), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementDepthFirstIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator *)o;
__pyx_ptype_4lxml_5etree__ElementTagMatcher->tp_clear(o);
Py_XDECREF(((PyObject *)p->_next_node));
p->_next_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_top_node));
p->_top_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementDepthFirstIterator[] = {
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementDepthFirstIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementDepthFirstIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementDepthFirstIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementDepthFirstIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ElementDepthFirstIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementDepthFirstIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ElementDepthFirstIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementDepthFirstIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementDepthFirstIterator, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementDepthFirstIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementDepthFirstIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementDepthFirstIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Iterates over an element and its sub-elements in document order (depth\n    first pre-order).  Note that this also includes comments, entities and\n    processing instructions.  To filter them out, check if the ``tag``\n    property of the returned element is a string (i.e. not None and not a\n    factory function).\n\n    If the optional \'tag\' argument is not None, the iterator returns only the\n    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*/
__pyx_tp_traverse_4lxml_5etree_ElementDepthFirstIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementDepthFirstIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementDepthFirstIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_25ElementDepthFirstIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementDepthFirstIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_ElementTextIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ElementTextIterator *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o);
p->_nextEvent = Py_None; Py_INCREF(Py_None);
p->_start_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementTextIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
Py_XDECREF(p->_nextEvent);
Py_XDECREF(((PyObject *)p->_start_element));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementTextIterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
if (p->_nextEvent) {
  e = (*v)(p->_nextEvent, a); if (e) return e;
}
if (p->_start_element) {
  e = (*v)(((PyObject*)p->_start_element), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementTextIterator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementTextIterator *p = (struct __pyx_obj_4lxml_5etree_ElementTextIterator *)o;
Py_XDECREF(p->_nextEvent);
p->_nextEvent = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_start_element));
p->_start_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementTextIterator[] = {
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_19ElementTextIterator___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementTextIterator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementTextIterator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementTextIterator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementTextIterator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ElementTextIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementTextIterator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ElementTextIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementTextIterator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementTextIterator, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementTextIterator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementTextIterator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementTextIterator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree_ElementTextIterator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementTextIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_19ElementTextIterator___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_19ElementTextIterator___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementTextIterator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_19ElementTextIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementTextIterator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__LogEntry __pyx_vtable_4lxml_5etree__LogEntry;

static PyObject *__pyx_tp_new_4lxml_5etree__LogEntry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__LogEntry *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__LogEntry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__LogEntry **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__LogEntry;
p->domain = Py_None; Py_INCREF(Py_None);
p->type = Py_None; Py_INCREF(Py_None);
p->level = Py_None; Py_INCREF(Py_None);
p->line = Py_None; Py_INCREF(Py_None);
p->column = Py_None; Py_INCREF(Py_None);
p->message = Py_None; Py_INCREF(Py_None);
p->filename = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__LogEntry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
Py_XDECREF(p->domain);
Py_XDECREF(p->type);
Py_XDECREF(p->level);
Py_XDECREF(p->line);
Py_XDECREF(p->column);
Py_XDECREF(p->message);
Py_XDECREF(p->filename);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__LogEntry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
if (p->domain) {
  e = (*v)(p->domain, a); if (e) return e;
}
if (p->type) {
  e = (*v)(p->type, a); if (e) return e;
}
if (p->level) {
  e = (*v)(p->level, a); if (e) return e;
}
if (p->line) {
  e = (*v)(p->line, a); if (e) return e;
}
if (p->column) {
  e = (*v)(p->column, a); if (e) return e;
}
if (p->message) {
  e = (*v)(p->message, a); if (e) return e;
}
if (p->filename) {
  e = (*v)(p->filename, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__LogEntry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__LogEntry *p = (struct __pyx_obj_4lxml_5etree__LogEntry *)o;
Py_XDECREF(p->domain);
p->domain = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->type);
p->type = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->level);
p->level = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->line);
p->line = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->column);
p->column = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->message);
p->message = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->filename);
p->filename = Py_None; Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_domain_name(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_9_LogEntry_11domain_name___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_type_name(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_9_LogEntry_9type_name___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_9_LogEntry_level_name(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_9_LogEntry_10level_name___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__LogEntry[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_9_LogEntry___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree__LogEntry[] = {
{"domain", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, domain), READONLY, 0},
{"type", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, type), READONLY, 0},
{"level", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, level), READONLY, 0},
{"line", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, line), READONLY, 0},
{"column", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, column), READONLY, 0},
{"message", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, message), READONLY, 0},
{"filename", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__LogEntry, filename), READONLY, 0},
{0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__LogEntry[] = {
{"domain_name", __pyx_getprop_4lxml_5etree_9_LogEntry_domain_name, 0, 0, 0},
{"type_name", __pyx_getprop_4lxml_5etree_9_LogEntry_type_name, 0, 0, 0},
{"level_name", __pyx_getprop_4lxml_5etree_9_LogEntry_level_name, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__LogEntry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__LogEntry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__LogEntry = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__LogEntry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__LogEntry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._LogEntry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__LogEntry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__LogEntry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_9_LogEntry___repr__, /*tp_repr*/
&__pyx_tp_as_number__LogEntry, /*tp_as_number*/
&__pyx_tp_as_sequence__LogEntry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__LogEntry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__LogEntry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__LogEntry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__LogEntry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__LogEntry, /*tp_methods*/
__pyx_members_4lxml_5etree__LogEntry, /*tp_members*/
__pyx_getsets_4lxml_5etree__LogEntry, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__LogEntry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog __pyx_vtable_4lxml_5etree__BaseErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree__BaseErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__BaseErrorLog **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseErrorLog;
p->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
p->last_error = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__BaseErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
Py_XDECREF(((PyObject *)p->_first_error));
Py_XDECREF(p->last_error);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__BaseErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
if (p->_first_error) {
  e = (*v)(((PyObject*)p->_first_error), a); if (e) return e;
}
if (p->last_error) {
  e = (*v)(p->last_error, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__BaseErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseErrorLog *p = (struct __pyx_obj_4lxml_5etree__BaseErrorLog *)o;
Py_XDECREF(((PyObject *)p->_first_error));
p->_first_error = ((struct __pyx_obj_4lxml_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->last_error);
p->last_error = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseErrorLog[] = {
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_13_BaseErrorLog_copy, METH_NOARGS, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree__BaseErrorLog[] = {
{"last_error", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree__BaseErrorLog, last_error), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BaseErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__BaseErrorLog = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__BaseErrorLog = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BaseErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__BaseErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._BaseErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__BaseErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__BaseErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_13_BaseErrorLog___repr__, /*tp_repr*/
&__pyx_tp_as_number__BaseErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence__BaseErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping__BaseErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__BaseErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__BaseErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__BaseErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__BaseErrorLog, /*tp_methods*/
__pyx_members_4lxml_5etree__BaseErrorLog, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_13_BaseErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__BaseErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog __pyx_vtable_4lxml_5etree__ListErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree__ListErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ListErrorLog *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseErrorLog->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ListErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ListErrorLog **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ListErrorLog;
p->_entries = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ListErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
Py_XDECREF(p->_entries);
__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ListErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
e = __pyx_ptype_4lxml_5etree__BaseErrorLog->tp_traverse(o, v, a); if (e) return e;
if (p->_entries) {
  e = (*v)(p->_entries, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ListErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ListErrorLog *p = (struct __pyx_obj_4lxml_5etree__ListErrorLog *)o;
__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_clear(o);
Py_XDECREF(p->_entries);
p->_entries = Py_None; Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree__ListErrorLog(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ListErrorLog[] = {
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_copy, METH_NOARGS, __pyx_doc_4lxml_5etree_13_ListErrorLog_copy},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__, METH_NOARGS|METH_COEXIST, 0},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__, METH_O|METH_COEXIST, 0},
{"filter_domains", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_domains, METH_O, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_domains},
{"filter_types", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_types, METH_O, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_types},
{"filter_levels", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_levels, METH_O, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_levels},
{"filter_from_level", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_level, METH_O, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_level},
{"filter_from_fatals", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_fatals, METH_NOARGS, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_fatals},
{"filter_from_errors", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_errors, METH_NOARGS, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_errors},
{"filter_from_warnings", (PyCFunction)__pyx_pf_4lxml_5etree_13_ListErrorLog_filter_from_warnings, METH_NOARGS, __pyx_doc_4lxml_5etree_13_ListErrorLog_filter_from_warnings},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ListErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___nonzero__, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ListErrorLog = {
__pyx_pf_4lxml_5etree_13_ListErrorLog___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree__ListErrorLog, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ListErrorLog = {
__pyx_pf_4lxml_5etree_13_ListErrorLog___len__, /*mp_length*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ListErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ListErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ListErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ListErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ListErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___repr__, /*tp_repr*/
&__pyx_tp_as_number__ListErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence__ListErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ListErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ListErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Immutable base version of a list based error log.", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ListErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ListErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ListErrorLog, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_13_ListErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ListErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ErrorLog __pyx_vtable_4lxml_5etree__ErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree__ErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ErrorLog *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ListErrorLog->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ErrorLog **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ErrorLog;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ListErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ListErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ListErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ErrorLog[] = {
{"clear", (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_clear, METH_NOARGS, 0},
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_copy, METH_NOARGS, __pyx_doc_4lxml_5etree_9_ErrorLog_copy},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog___iter__, METH_NOARGS|METH_COEXIST, 0},
{"receive", (PyCFunction)__pyx_pf_4lxml_5etree_9_ErrorLog_receive, METH_O, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ErrorLog = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ErrorLog = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence__ErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_9_ErrorLog___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ErrorLog, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_9_ErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog __pyx_vtable_4lxml_5etree__DomainErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree__DomainErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__DomainErrorLog *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ErrorLog->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__DomainErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__DomainErrorLog **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__DomainErrorLog;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__DomainErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__DomainErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__DomainErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__DomainErrorLog[] = {
{"receive", (PyCFunction)__pyx_pf_4lxml_5etree_15_DomainErrorLog_receive, METH_O, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__DomainErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__DomainErrorLog = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__DomainErrorLog = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__DomainErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__DomainErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._DomainErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__DomainErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__DomainErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__DomainErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence__DomainErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping__DomainErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__DomainErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__DomainErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__DomainErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__DomainErrorLog, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_15_DomainErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__DomainErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog __pyx_vtable_4lxml_5etree__RotatingErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree__RotatingErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__RotatingErrorLog *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ErrorLog->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__RotatingErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__RotatingErrorLog **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__RotatingErrorLog;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__RotatingErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__RotatingErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__RotatingErrorLog(PyObject *o) {
__pyx_ptype_4lxml_5etree__ErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__RotatingErrorLog[] = {
{"receive", (PyCFunction)__pyx_pf_4lxml_5etree_17_RotatingErrorLog_receive, METH_O, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__RotatingErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__RotatingErrorLog = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__RotatingErrorLog = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__RotatingErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__RotatingErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._RotatingErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__RotatingErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__RotatingErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__RotatingErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence__RotatingErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping__RotatingErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__RotatingErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__RotatingErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__RotatingErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__RotatingErrorLog, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17_RotatingErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__RotatingErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog __pyx_vtable_4lxml_5etree_PyErrorLog;

static PyObject *__pyx_tp_new_4lxml_5etree_PyErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_PyErrorLog *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseErrorLog->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_PyErrorLog *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_PyErrorLog **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_PyErrorLog;
p->level_map = Py_None; Py_INCREF(Py_None);
p->_map_level = Py_None; Py_INCREF(Py_None);
p->_log = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_PyErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
Py_XDECREF(p->level_map);
Py_XDECREF(p->_map_level);
Py_XDECREF(p->_log);
__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_PyErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
e = __pyx_ptype_4lxml_5etree__BaseErrorLog->tp_traverse(o, v, a); if (e) return e;
if (p->level_map) {
  e = (*v)(p->level_map, a); if (e) return e;
}
if (p->_map_level) {
  e = (*v)(p->_map_level, a); if (e) return e;
}
if (p->_log) {
  e = (*v)(p->_log, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_PyErrorLog(PyObject *o) {
struct __pyx_obj_4lxml_5etree_PyErrorLog *p = (struct __pyx_obj_4lxml_5etree_PyErrorLog *)o;
__pyx_ptype_4lxml_5etree__BaseErrorLog->tp_clear(o);
Py_XDECREF(p->level_map);
p->level_map = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_map_level);
p->_map_level = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_log);
p->_log = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_PyErrorLog[] = {
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_copy, METH_NOARGS, __pyx_doc_4lxml_5etree_10PyErrorLog_copy},
{"log", (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_log, METH_VARARGS|METH_KEYWORDS, 0},
{"receive", (PyCFunction)__pyx_pf_4lxml_5etree_10PyErrorLog_receive, METH_O, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_PyErrorLog[] = {
{"level_map", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_PyErrorLog, level_map), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_PyErrorLog = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_PyErrorLog = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_PyErrorLog = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_PyErrorLog = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_PyErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.PyErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_PyErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_PyErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_PyErrorLog, /*tp_as_number*/
&__pyx_tp_as_sequence_PyErrorLog, /*tp_as_sequence*/
&__pyx_tp_as_mapping_PyErrorLog, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_PyErrorLog, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree_PyErrorLog, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_PyErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_PyErrorLog, /*tp_methods*/
__pyx_members_4lxml_5etree_PyErrorLog, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_10PyErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_PyErrorLog, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_ElementBase(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_4lxml_5etree__Element->tp_new(t, a, k);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Element->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Element->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Element->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementBase[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementBase = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementBase = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementBase = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementBase = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementBaseType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementBase", /*tp_name*/
sizeof(struct LxmlElementBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementBase, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementBase, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementBase, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementBase, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementBase, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"All custom Element classes must inherit from this one.\n\n    Note that subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or destroyed.  All\n    persistent state of Elements must be stored in the underlying XML.  If you\n    really need to initialize the object after creation, you can implement an\n    ``_init(self)`` method that will be called after object creation.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ElementBase, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementBase, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementBase, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_CommentBase __pyx_vtable_4lxml_5etree_CommentBase;

static PyObject *__pyx_tp_new_4lxml_5etree_CommentBase(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_CommentBase *p;
PyObject *o = __pyx_ptype_4lxml_5etree__Comment->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_CommentBase *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_CommentBase **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_CommentBase;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_CommentBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Comment->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_CommentBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Comment->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_CommentBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Comment->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_CommentBase[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CommentBase = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_CommentBase = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CommentBase = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CommentBase = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_CommentBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.CommentBase", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_CommentBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_CommentBase, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_CommentBase, /*tp_as_number*/
&__pyx_tp_as_sequence_CommentBase, /*tp_as_sequence*/
&__pyx_tp_as_mapping_CommentBase, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_CommentBase, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"All custom Comment classes must inherit from this one.\n\n    Note that subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or destroyed.  All\n    persistent state of Comments must be stored in the underlying XML.  If you\n    really need to initialize the object after creation, you can implement an\n    ``_init(self)`` method that will be called after object creation.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_CommentBase, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_CommentBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_CommentBase, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_CommentBase, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_PIBase __pyx_vtable_4lxml_5etree_PIBase;

static PyObject *__pyx_tp_new_4lxml_5etree_PIBase(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_PIBase *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_PIBase *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_PIBase **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_PIBase;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_PIBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_PIBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_PIBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__ProcessingInstruction->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_PIBase[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_PIBase = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_PIBase = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_PIBase = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_PIBase = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_PIBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.PIBase", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_PIBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_PIBase, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_PIBase, /*tp_as_number*/
&__pyx_tp_as_sequence_PIBase, /*tp_as_sequence*/
&__pyx_tp_as_mapping_PIBase, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_PIBase, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"All custom Processing Instruction classes must inherit from this one.\n\n    Note that subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or destroyed.  All\n    persistent state of PIs must be stored in the underlying XML.  If you\n    really need to initialize the object after creation, you can implement an\n    ``_init(self)`` method that will be called after object creation.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_PIBase, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_PIBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_PIBase, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_PIBase, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_EntityBase __pyx_vtable_4lxml_5etree_EntityBase;

static PyObject *__pyx_tp_new_4lxml_5etree_EntityBase(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_EntityBase *p;
PyObject *o = __pyx_ptype_4lxml_5etree__Entity->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_EntityBase *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_EntityBase **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_EntityBase;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_EntityBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Entity->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_EntityBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Entity->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_EntityBase(PyObject *o) {
__pyx_ptype_4lxml_5etree__Entity->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_EntityBase[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_EntityBase = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_EntityBase = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_EntityBase = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_EntityBase = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_EntityBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.EntityBase", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_EntityBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_EntityBase, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_EntityBase, /*tp_as_number*/
&__pyx_tp_as_sequence_EntityBase, /*tp_as_sequence*/
&__pyx_tp_as_mapping_EntityBase, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_EntityBase, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"All custom Entity classes must inherit from this one.\n\n    Note that subclasses *must not* override __init__ or __new__ as it is\n    absolutely undefined when these objects will be created or destroyed.  All\n    persistent state of Entities must be stored in the underlying XML.  If you\n    really need to initialize the object after creation, you can implement an\n    ``_init(self)`` method that will be called after object creation.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_EntityBase, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_EntityBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_EntityBase, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_EntityBase, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_ElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementClassLookup(PyObject *o) {
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementClassLookup(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementClassLookup(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementClassLookup[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlElementClassLookupType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementClassLookup", /*tp_name*/
sizeof(struct LxmlElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Superclass of Element class lookups.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementClassLookup, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_18ElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup __pyx_vtable_4lxml_5etree_FallbackElementClassLookup;

static PyObject *__pyx_tp_new_4lxml_5etree_FallbackElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct LxmlFallbackElementClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct LxmlFallbackElementClassLookup *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_FallbackElementClassLookup **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
p->fallback = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup(PyObject *o) {
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
Py_XDECREF(((PyObject *)p->fallback));
__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
e = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse(o, v, a); if (e) return e;
if (p->fallback) {
  e = (*v)(((PyObject*)p->fallback), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup(PyObject *o) {
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear(o);
Py_XDECREF(((PyObject *)p->fallback));
p->fallback = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_FallbackElementClassLookup[] = {
{"setFallback", (PyCFunction)__pyx_pf_4lxml_5etree_26FallbackElementClassLookup_setFallback, METH_O, __pyx_doc_4lxml_5etree_26FallbackElementClassLookup_setFallback},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_FallbackElementClassLookup[] = {
{"fallback", T_OBJECT, offsetof(struct LxmlFallbackElementClassLookup, fallback), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FallbackElementClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_FallbackElementClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FallbackElementClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FallbackElementClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.FallbackElementClassLookup", /*tp_name*/
sizeof(struct LxmlFallbackElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_FallbackElementClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_FallbackElementClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_FallbackElementClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_FallbackElementClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_FallbackElementClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Superclass of Element class lookups with additional fallback.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_FallbackElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_FallbackElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_FallbackElementClassLookup, /*tp_methods*/
__pyx_members_4lxml_5etree_FallbackElementClassLookup, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_26FallbackElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_FallbackElementClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_ElementDefaultClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o);
p->element_class = Py_None; Py_INCREF(Py_None);
p->comment_class = Py_None; Py_INCREF(Py_None);
p->pi_class = Py_None; Py_INCREF(Py_None);
p->entity_class = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementDefaultClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
Py_XDECREF(p->element_class);
Py_XDECREF(p->comment_class);
Py_XDECREF(p->pi_class);
Py_XDECREF(p->entity_class);
__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementDefaultClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
e = __pyx_ptype_4lxml_5etree_ElementClassLookup->tp_traverse(o, v, a); if (e) return e;
if (p->element_class) {
  e = (*v)(p->element_class, a); if (e) return e;
}
if (p->comment_class) {
  e = (*v)(p->comment_class, a); if (e) return e;
}
if (p->pi_class) {
  e = (*v)(p->pi_class, a); if (e) return e;
}
if (p->entity_class) {
  e = (*v)(p->entity_class, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementDefaultClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup *)o;
__pyx_ptype_4lxml_5etree_ElementClassLookup->tp_clear(o);
Py_XDECREF(p->element_class);
p->element_class = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->comment_class);
p->comment_class = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->pi_class);
p->pi_class = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->entity_class);
p->entity_class = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementDefaultClassLookup[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_ElementDefaultClassLookup[] = {
{"element_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, element_class), READONLY, 0},
{"comment_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, comment_class), READONLY, 0},
{"pi_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, pi_class), READONLY, 0},
{"entity_class", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup, entity_class), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementDefaultClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementDefaultClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementDefaultClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementDefaultClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ElementDefaultClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementDefaultClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ElementDefaultClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementDefaultClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementDefaultClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementDefaultClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementDefaultClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementDefaultClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree_ElementDefaultClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementDefaultClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementDefaultClassLookup, /*tp_methods*/
__pyx_members_4lxml_5etree_ElementDefaultClassLookup, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_25ElementDefaultClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementDefaultClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup __pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;

static PyObject *__pyx_tp_new_4lxml_5etree_AttributeBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_AttributeBasedElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup;
p->_class_mapping = Py_None; Py_INCREF(Py_None);
p->_pytag = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
Py_XDECREF(p->_class_mapping);
Py_XDECREF(p->_pytag);
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
e = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
if (p->_class_mapping) {
  e = (*v)(p->_class_mapping, a); if (e) return e;
}
if (p->_pytag) {
  e = (*v)(p->_pytag, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_AttributeBasedElementClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup *)o;
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_clear(o);
Py_XDECREF(p->_class_mapping);
p->_class_mapping = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_pytag);
p->_pytag = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_AttributeBasedElementClassLookup[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_AttributeBasedElementClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_AttributeBasedElementClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_AttributeBasedElementClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_AttributeBasedElementClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_AttributeBasedElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.AttributeBasedElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_AttributeBasedElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_AttributeBasedElementClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_AttributeBasedElementClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_AttributeBasedElementClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_AttributeBasedElementClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Checks an attribute of an Element and looks up the value in a class\n    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*/
__pyx_tp_traverse_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_32AttributeBasedElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_AttributeBasedElementClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup __pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;

static PyObject *__pyx_tp_new_4lxml_5etree_ParserBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ParserBasedElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ParserBasedElementClassLookup(PyObject *o) {
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ParserBasedElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ParserBasedElementClassLookup(PyObject *o) {
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ParserBasedElementClassLookup[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ParserBasedElementClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ParserBasedElementClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ParserBasedElementClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ParserBasedElementClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ParserBasedElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ParserBasedElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ParserBasedElementClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ParserBasedElementClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_ParserBasedElementClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ParserBasedElementClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ParserBasedElementClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Element class lookup based on the XML parser.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ParserBasedElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ParserBasedElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ParserBasedElementClassLookup, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_29ParserBasedElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ParserBasedElementClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup __pyx_vtable_4lxml_5etree_CustomElementClassLookup;

static PyObject *__pyx_tp_new_4lxml_5etree_CustomElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_CustomElementClassLookup *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_CustomElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_CustomElementClassLookup(PyObject *o) {
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_CustomElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_CustomElementClassLookup(PyObject *o) {
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_CustomElementClassLookup[] = {
{"lookup", (PyCFunction)__pyx_pf_4lxml_5etree_24CustomElementClassLookup_lookup, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_CustomElementClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_CustomElementClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_CustomElementClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_CustomElementClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_CustomElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.CustomElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_CustomElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_CustomElementClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_CustomElementClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_CustomElementClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_CustomElementClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_CustomElementClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree_CustomElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_CustomElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_CustomElementClassLookup, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_24CustomElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_CustomElementClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry __pyx_vtable_4lxml_5etree__NamespaceRegistry;

static PyObject *__pyx_tp_new_4lxml_5etree__NamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__NamespaceRegistry **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
p->_ns_uri = Py_None; Py_INCREF(Py_None);
p->_ns_uri_utf = Py_None; Py_INCREF(Py_None);
p->_entries = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
Py_XDECREF(p->_ns_uri);
Py_XDECREF(p->_ns_uri_utf);
Py_XDECREF(p->_entries);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__NamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
if (p->_ns_uri) {
  e = (*v)(p->_ns_uri, a); if (e) return e;
}
if (p->_ns_uri_utf) {
  e = (*v)(p->_ns_uri_utf, a); if (e) return e;
}
if (p->_entries) {
  e = (*v)(p->_entries, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__NamespaceRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__NamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__NamespaceRegistry *)o;
Py_XDECREF(p->_ns_uri);
p->_ns_uri = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_ns_uri_utf);
p->_ns_uri_utf = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_entries);
p->_entries = Py_None; Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree__NamespaceRegistry(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static int __pyx_mp_ass_subscript_4lxml_5etree__NamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  PyErr_Format(PyExc_NotImplementedError,
    "Subscript assignment not supported by %s", o->ob_type->tp_name);
  return -1;
}
else {
  return __pyx_pf_4lxml_5etree_18_NamespaceRegistry___delitem__(o, i);
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__NamespaceRegistry[] = {
{"update", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_update, METH_O, __pyx_doc_4lxml_5etree_18_NamespaceRegistry_update},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__, METH_O|METH_COEXIST, 0},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__, METH_NOARGS|METH_COEXIST, 0},
{"items", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_items, METH_NOARGS, 0},
{"iteritems", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_iteritems, METH_NOARGS, 0},
{"clear", (PyCFunction)__pyx_pf_4lxml_5etree_18_NamespaceRegistry_clear, METH_NOARGS, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__NamespaceRegistry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__NamespaceRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree__NamespaceRegistry, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__NamespaceRegistry = {
0, /*mp_length*/
__pyx_pf_4lxml_5etree_18_NamespaceRegistry___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree__NamespaceRegistry, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__NamespaceRegistry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__NamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._NamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__NamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__NamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__NamespaceRegistry, /*tp_as_number*/
&__pyx_tp_as_sequence__NamespaceRegistry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__NamespaceRegistry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__NamespaceRegistry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Dictionary-like namespace registry", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__NamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__NamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_18_NamespaceRegistry___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__NamespaceRegistry, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_18_NamespaceRegistry___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__NamespaceRegistry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry __pyx_vtable_4lxml_5etree__ClassNamespaceRegistry;

static PyObject *__pyx_tp_new_4lxml_5etree__ClassNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *p;
PyObject *o = __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ClassNamespaceRegistry **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ClassNamespaceRegistry(PyObject *o) {
__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ClassNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ClassNamespaceRegistry(PyObject *o) {
__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_clear(o);
return 0;
}

static int __pyx_mp_ass_subscript_4lxml_5etree__ClassNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript(o, i, v);
  PyErr_Format(PyExc_NotImplementedError,
    "Subscript deletion not supported by %s", o->ob_type->tp_name);
  return -1;
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ClassNamespaceRegistry[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ClassNamespaceRegistry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ClassNamespaceRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ClassNamespaceRegistry = {
0, /*mp_length*/
0, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree__ClassNamespaceRegistry, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ClassNamespaceRegistry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ClassNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ClassNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ClassNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ClassNamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_23_ClassNamespaceRegistry___repr__, /*tp_repr*/
&__pyx_tp_as_number__ClassNamespaceRegistry, /*tp_as_number*/
&__pyx_tp_as_sequence__ClassNamespaceRegistry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ClassNamespaceRegistry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ClassNamespaceRegistry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Dictionary-like registry for namespace implementation classes", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ClassNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ClassNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ClassNamespaceRegistry, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ClassNamespaceRegistry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup __pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup;

static PyObject *__pyx_tp_new_4lxml_5etree_ElementNamespaceClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p;
PyObject *o = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ElementNamespaceClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup;
p->_namespace_registries = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
Py_XDECREF(p->_namespace_registries);
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
e = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
if (p->_namespace_registries) {
  e = (*v)(p->_namespace_registries, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ElementNamespaceClassLookup(PyObject *o) {
struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup *)o;
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup->tp_clear(o);
Py_XDECREF(p->_namespace_registries);
p->_namespace_registries = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ElementNamespaceClassLookup[] = {
{"get_namespace", (PyCFunction)__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace, METH_O, __pyx_doc_4lxml_5etree_27ElementNamespaceClassLookup_get_namespace},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ElementNamespaceClassLookup = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ElementNamespaceClassLookup = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ElementNamespaceClassLookup = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ElementNamespaceClassLookup = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ElementNamespaceClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ElementNamespaceClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ElementNamespaceClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ElementNamespaceClassLookup, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ElementNamespaceClassLookup, /*tp_as_number*/
&__pyx_tp_as_sequence_ElementNamespaceClassLookup, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ElementNamespaceClassLookup, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ElementNamespaceClassLookup, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Element class lookup scheme that searches the Element class in the\n    Namespace registry.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ElementNamespaceClassLookup, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ElementNamespaceClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ElementNamespaceClassLookup, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_27ElementNamespaceClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ElementNamespaceClassLookup, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry __pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry;

static PyObject *__pyx_tp_new_4lxml_5etree__FunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *p;
PyObject *o = __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__FunctionNamespaceRegistry **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__FunctionNamespaceRegistry(PyObject *o) {
__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__FunctionNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__FunctionNamespaceRegistry(PyObject *o) {
__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_clear(o);
return 0;
}

static int __pyx_mp_ass_subscript_4lxml_5etree__FunctionNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_4lxml_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript(o, i, v);
  PyErr_Format(PyExc_NotImplementedError,
    "Subscript deletion not supported by %s", o->ob_type->tp_name);
  return -1;
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__FunctionNamespaceRegistry[] = {
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FunctionNamespaceRegistry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__FunctionNamespaceRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__FunctionNamespaceRegistry = {
0, /*mp_length*/
0, /*mp_subscript*/
__pyx_mp_ass_subscript_4lxml_5etree__FunctionNamespaceRegistry, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FunctionNamespaceRegistry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__FunctionNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._FunctionNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__FunctionNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__FunctionNamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_26_FunctionNamespaceRegistry___repr__, /*tp_repr*/
&__pyx_tp_as_number__FunctionNamespaceRegistry, /*tp_as_number*/
&__pyx_tp_as_sequence__FunctionNamespaceRegistry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__FunctionNamespaceRegistry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__FunctionNamespaceRegistry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__FunctionNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__FunctionNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__FunctionNamespaceRegistry, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__FunctionNamespaceRegistry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry __pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry;

static PyObject *__pyx_tp_new_4lxml_5etree__XPathFunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p;
PyObject *o = __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XPathFunctionNamespaceRegistry **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry;
p->_prefix = Py_None; Py_INCREF(Py_None);
p->_prefix_utf = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
Py_XDECREF(p->_prefix);
Py_XDECREF(p->_prefix_utf);
__pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
e = __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry->tp_traverse(o, v, a); if (e) return e;
if (p->_prefix) {
  e = (*v)(p->_prefix, a); if (e) return e;
}
if (p->_prefix_utf) {
  e = (*v)(p->_prefix_utf, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry *)o;
__pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry->tp_clear(o);
Py_XDECREF(p->_prefix);
p->_prefix = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_prefix_utf);
p->_prefix_utf = Py_None; Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(o);
}

static int __pyx_setprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(o, v);
}
else {
  return __pyx_pf_4lxml_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(o);
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathFunctionNamespaceRegistry[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XPathFunctionNamespaceRegistry[] = {
{"prefix", __pyx_getprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_setprop_4lxml_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_k19, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XPathFunctionNamespaceRegistry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XPathFunctionNamespaceRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XPathFunctionNamespaceRegistry = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XPathFunctionNamespaceRegistry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XPathFunctionNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XPathFunctionNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XPathFunctionNamespaceRegistry, /*tp_as_number*/
&__pyx_tp_as_sequence__XPathFunctionNamespaceRegistry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XPathFunctionNamespaceRegistry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XPathFunctionNamespaceRegistry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XPathFunctionNamespaceRegistry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree__InputDocument(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__InputDocument *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__InputDocument *)o);
p->_data_bytes = Py_None; Py_INCREF(Py_None);
p->_filename = Py_None; Py_INCREF(Py_None);
p->_file = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__InputDocument(PyObject *o) {
struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
Py_XDECREF(p->_data_bytes);
Py_XDECREF(p->_filename);
Py_XDECREF(p->_file);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__InputDocument(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
if (p->_data_bytes) {
  e = (*v)(p->_data_bytes, a); if (e) return e;
}
if (p->_filename) {
  e = (*v)(p->_filename, a); if (e) return e;
}
if (p->_file) {
  e = (*v)(p->_file, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__InputDocument(PyObject *o) {
struct __pyx_obj_4lxml_5etree__InputDocument *p = (struct __pyx_obj_4lxml_5etree__InputDocument *)o;
Py_XDECREF(p->_data_bytes);
p->_data_bytes = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_filename);
p->_filename = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_file);
p->_file = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__InputDocument[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__InputDocument = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__InputDocument = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__InputDocument = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__InputDocument = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__InputDocument = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._InputDocument", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__InputDocument), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__InputDocument, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__InputDocument, /*tp_as_number*/
&__pyx_tp_as_sequence__InputDocument, /*tp_as_sequence*/
&__pyx_tp_as_mapping__InputDocument, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__InputDocument, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__InputDocument, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__InputDocument, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__InputDocument, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__InputDocument, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_Resolver(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_Resolver(PyObject *o) {
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_Resolver(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_Resolver(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_Resolver[] = {
{"resolve", (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8Resolver_resolve},
{"resolve_empty", (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_empty, METH_O, __pyx_doc_4lxml_5etree_8Resolver_resolve_empty},
{"resolve_string", (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8Resolver_resolve_string},
{"resolve_filename", (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_filename, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8Resolver_resolve_filename},
{"resolve_file", (PyCFunction)__pyx_pf_4lxml_5etree_8Resolver_resolve_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_8Resolver_resolve_file},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Resolver = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_Resolver = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Resolver = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Resolver = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_Resolver = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.Resolver", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_Resolver), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_Resolver, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_Resolver, /*tp_as_number*/
&__pyx_tp_as_sequence_Resolver, /*tp_as_sequence*/
&__pyx_tp_as_mapping_Resolver, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_Resolver, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"This is the base class of all resolvers.", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_Resolver, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_Resolver, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_Resolver, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_Resolver, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry __pyx_vtable_4lxml_5etree__ResolverRegistry;

static PyObject *__pyx_tp_new_4lxml_5etree__ResolverRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ResolverRegistry *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ResolverRegistry **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ResolverRegistry;
p->_resolvers = Py_None; Py_INCREF(Py_None);
p->_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ResolverRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
Py_XDECREF(p->_resolvers);
Py_XDECREF(((PyObject *)p->_default_resolver));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ResolverRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
if (p->_resolvers) {
  e = (*v)(p->_resolvers, a); if (e) return e;
}
if (p->_default_resolver) {
  e = (*v)(((PyObject*)p->_default_resolver), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ResolverRegistry(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ResolverRegistry *p = (struct __pyx_obj_4lxml_5etree__ResolverRegistry *)o;
Py_XDECREF(p->_resolvers);
p->_resolvers = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_default_resolver));
p->_default_resolver = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ResolverRegistry[] = {
{"add", (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_add, METH_O, __pyx_doc_4lxml_5etree_17_ResolverRegistry_add},
{"remove", (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_remove, METH_O, 0},
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_copy, METH_NOARGS, 0},
{"resolve", (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry_resolve, METH_VARARGS|METH_KEYWORDS, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ResolverRegistry = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ResolverRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ResolverRegistry = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ResolverRegistry = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ResolverRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ResolverRegistry", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ResolverRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ResolverRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_17_ResolverRegistry___repr__, /*tp_repr*/
&__pyx_tp_as_number__ResolverRegistry, /*tp_as_number*/
&__pyx_tp_as_sequence__ResolverRegistry, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ResolverRegistry, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ResolverRegistry, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ResolverRegistry, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ResolverRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ResolverRegistry, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17_ResolverRegistry___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ResolverRegistry, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ResolverContext __pyx_vtable_4lxml_5etree__ResolverContext;

static PyObject *__pyx_tp_new_4lxml_5etree__ResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ResolverContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ExceptionContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ResolverContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ResolverContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ResolverContext;
p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
p->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ResolverContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
Py_XDECREF(((PyObject *)p->_resolvers));
Py_XDECREF(((PyObject *)p->_storage));
__pyx_ptype_4lxml_5etree__ExceptionContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ResolverContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
e = __pyx_ptype_4lxml_5etree__ExceptionContext->tp_traverse(o, v, a); if (e) return e;
if (p->_resolvers) {
  e = (*v)(((PyObject*)p->_resolvers), a); if (e) return e;
}
if (p->_storage) {
  e = (*v)(((PyObject*)p->_storage), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ResolverContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ResolverContext *p = (struct __pyx_obj_4lxml_5etree__ResolverContext *)o;
__pyx_ptype_4lxml_5etree__ExceptionContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_resolvers));
p->_resolvers = ((struct __pyx_obj_4lxml_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_storage));
p->_storage = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ResolverContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ResolverContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ResolverContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ResolverContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ResolverContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ResolverContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ResolverContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ResolverContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ResolverContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ResolverContext, /*tp_as_number*/
&__pyx_tp_as_sequence__ResolverContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ResolverContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ResolverContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ResolverContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ResolverContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ResolverContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ResolverContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext __pyx_vtable_4lxml_5etree__ParserDictionaryContext;

static PyObject *__pyx_tp_new_4lxml_5etree__ParserDictionaryContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ParserDictionaryContext;
p->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ParserDictionaryContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_24_ParserDictionaryContext___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_default_parser));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ParserDictionaryContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
if (p->_default_parser) {
  e = (*v)(((PyObject*)p->_default_parser), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ParserDictionaryContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *p = (struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)o;
Py_XDECREF(((PyObject *)p->_default_parser));
p->_default_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ParserDictionaryContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ParserDictionaryContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ParserDictionaryContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ParserDictionaryContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ParserDictionaryContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ParserDictionaryContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ParserDictionaryContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ParserDictionaryContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ParserDictionaryContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ParserDictionaryContext, /*tp_as_number*/
&__pyx_tp_as_sequence__ParserDictionaryContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ParserDictionaryContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ParserDictionaryContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ParserDictionaryContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ParserDictionaryContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ParserDictionaryContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ParserDictionaryContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext __pyx_vtable_4lxml_5etree__FileReaderContext;

static PyObject *__pyx_tp_new_4lxml_5etree__FileReaderContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__FileReaderContext *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__FileReaderContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__FileReaderContext **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FileReaderContext;
p->_filelike = Py_None; Py_INCREF(Py_None);
p->_encoding = Py_None; Py_INCREF(Py_None);
p->_url = Py_None; Py_INCREF(Py_None);
p->_bytes = Py_None; Py_INCREF(Py_None);
p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__FileReaderContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
Py_XDECREF(p->_filelike);
Py_XDECREF(p->_encoding);
Py_XDECREF(p->_url);
Py_XDECREF(p->_bytes);
Py_XDECREF(((PyObject *)p->_exc_context));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__FileReaderContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
if (p->_filelike) {
  e = (*v)(p->_filelike, a); if (e) return e;
}
if (p->_encoding) {
  e = (*v)(p->_encoding, a); if (e) return e;
}
if (p->_url) {
  e = (*v)(p->_url, a); if (e) return e;
}
if (p->_bytes) {
  e = (*v)(p->_bytes, a); if (e) return e;
}
if (p->_exc_context) {
  e = (*v)(((PyObject*)p->_exc_context), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__FileReaderContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__FileReaderContext *p = (struct __pyx_obj_4lxml_5etree__FileReaderContext *)o;
Py_XDECREF(p->_filelike);
p->_filelike = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_encoding);
p->_encoding = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_url);
p->_url = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_bytes);
p->_bytes = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_exc_context));
p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__FileReaderContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FileReaderContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__FileReaderContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__FileReaderContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FileReaderContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__FileReaderContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._FileReaderContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__FileReaderContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__FileReaderContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__FileReaderContext, /*tp_as_number*/
&__pyx_tp_as_sequence__FileReaderContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__FileReaderContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__FileReaderContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__FileReaderContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__FileReaderContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__FileReaderContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_18_FileReaderContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__FileReaderContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ParserContext __pyx_vtable_4lxml_5etree__ParserContext;

static PyObject *__pyx_tp_new_4lxml_5etree__ParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ParserContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ResolverContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ParserContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ParserContext **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ParserContext;
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_14_ParserContext___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_error_log));
__pyx_ptype_4lxml_5etree__ResolverContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ParserContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
e = __pyx_ptype_4lxml_5etree__ResolverContext->tp_traverse(o, v, a); if (e) return e;
if (p->_error_log) {
  e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ParserContext *p = (struct __pyx_obj_4lxml_5etree__ParserContext *)o;
__pyx_ptype_4lxml_5etree__ResolverContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ParserContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ParserContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ParserContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ParserContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ParserContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ParserContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ParserContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ParserContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ParserContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ParserContext, /*tp_as_number*/
&__pyx_tp_as_sequence__ParserContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ParserContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ParserContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ParserContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ParserContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ParserContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ParserContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext __pyx_vtable_4lxml_5etree__SaxParserContext;

static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ParserContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__SaxParserContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__SaxParserContext **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__SaxParserContext;
p->_target = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__SaxParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
Py_XDECREF(((PyObject *)p->_target));
__pyx_ptype_4lxml_5etree__ParserContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__SaxParserContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
e = __pyx_ptype_4lxml_5etree__ParserContext->tp_traverse(o, v, a); if (e) return e;
if (p->_target) {
  e = (*v)(((PyObject*)p->_target), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__SaxParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__SaxParserContext *p = (struct __pyx_obj_4lxml_5etree__SaxParserContext *)o;
__pyx_ptype_4lxml_5etree__ParserContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_target));
p->_target = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__SaxParserContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__SaxParserContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__SaxParserContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__SaxParserContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__SaxParserContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__SaxParserContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._SaxParserContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__SaxParserContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__SaxParserContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__SaxParserContext, /*tp_as_number*/
&__pyx_tp_as_sequence__SaxParserContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__SaxParserContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__SaxParserContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"This class maps SAX2 events to method calls.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__SaxParserContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__SaxParserContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__SaxParserContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__SaxParserContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext __pyx_vtable_4lxml_5etree__TargetParserContext;

static PyObject *__pyx_tp_new_4lxml_5etree__TargetParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__TargetParserContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__SaxParserContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__TargetParserContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__TargetParserContext **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__TargetParserContext;
p->_python_target = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__TargetParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
Py_XDECREF(p->_python_target);
__pyx_ptype_4lxml_5etree__SaxParserContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__TargetParserContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
e = __pyx_ptype_4lxml_5etree__SaxParserContext->tp_traverse(o, v, a); if (e) return e;
if (p->_python_target) {
  e = (*v)(p->_python_target, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__TargetParserContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__TargetParserContext *p = (struct __pyx_obj_4lxml_5etree__TargetParserContext *)o;
__pyx_ptype_4lxml_5etree__SaxParserContext->tp_clear(o);
Py_XDECREF(p->_python_target);
p->_python_target = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__TargetParserContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__TargetParserContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__TargetParserContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__TargetParserContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__TargetParserContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__TargetParserContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._TargetParserContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__TargetParserContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__TargetParserContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__TargetParserContext, /*tp_as_number*/
&__pyx_tp_as_sequence__TargetParserContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__TargetParserContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__TargetParserContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"This class maps SAX2 events to the ET parser target interface.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__TargetParserContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__TargetParserContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__TargetParserContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__TargetParserContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__FeedParser __pyx_vtable_4lxml_5etree__FeedParser;

static PyObject *__pyx_tp_new_4lxml_5etree__FeedParser(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__FeedParser *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseParser->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__FeedParser *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__FeedParser **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FeedParser;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__FeedParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__BaseParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__FeedParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__BaseParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__FeedParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__BaseParser->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_11_FeedParser_feed_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_11_FeedParser_14feed_error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__FeedParser[] = {
{"feed", (PyCFunction)__pyx_pf_4lxml_5etree_11_FeedParser_feed, METH_O, __pyx_doc_4lxml_5etree_11_FeedParser_feed},
{"close", (PyCFunction)__pyx_pf_4lxml_5etree_11_FeedParser_close, METH_NOARGS, __pyx_doc_4lxml_5etree_11_FeedParser_close},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__FeedParser[] = {
{"feed_error_log", __pyx_getprop_4lxml_5etree_11_FeedParser_feed_error_log, 0, __pyx_k22, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FeedParser = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__FeedParser = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__FeedParser = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FeedParser = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__FeedParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._FeedParser", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__FeedParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__FeedParser, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__FeedParser, /*tp_as_number*/
&__pyx_tp_as_sequence__FeedParser, /*tp_as_sequence*/
&__pyx_tp_as_mapping__FeedParser, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__FeedParser, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__FeedParser, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__FeedParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__FeedParser, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__FeedParser, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__FeedParser, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget __pyx_vtable_4lxml_5etree__SaxParserTarget;

static PyObject *__pyx_tp_new_4lxml_5etree__SaxParserTarget(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__SaxParserTarget *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__SaxParserTarget *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__SaxParserTarget **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__SaxParserTarget;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__SaxParserTarget(PyObject *o) {
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__SaxParserTarget(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__SaxParserTarget(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__SaxParserTarget[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__SaxParserTarget = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__SaxParserTarget = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__SaxParserTarget = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__SaxParserTarget = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__SaxParserTarget = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._SaxParserTarget", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__SaxParserTarget), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__SaxParserTarget, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__SaxParserTarget, /*tp_as_number*/
&__pyx_tp_as_sequence__SaxParserTarget, /*tp_as_sequence*/
&__pyx_tp_as_mapping__SaxParserTarget, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__SaxParserTarget, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__SaxParserTarget, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__SaxParserTarget, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__SaxParserTarget, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__SaxParserTarget, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder __pyx_vtable_4lxml_5etree_TreeBuilder;

static PyObject *__pyx_tp_new_4lxml_5etree_TreeBuilder(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_TreeBuilder *p;
PyObject *o = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_TreeBuilder *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_TreeBuilder **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_TreeBuilder;
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
p->_factory = Py_None; Py_INCREF(Py_None);
p->_data = Py_None; Py_INCREF(Py_None);
p->_element_stack = Py_None; Py_INCREF(Py_None);
p->_element_stack_pop = Py_None; Py_INCREF(Py_None);
p->_last = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_TreeBuilder(PyObject *o) {
struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
Py_XDECREF(((PyObject *)p->_parser));
Py_XDECREF(p->_factory);
Py_XDECREF(p->_data);
Py_XDECREF(p->_element_stack);
Py_XDECREF(p->_element_stack_pop);
Py_XDECREF(((PyObject *)p->_last));
__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_TreeBuilder(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
e = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse(o, v, a); if (e) return e;
if (p->_parser) {
  e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
}
if (p->_factory) {
  e = (*v)(p->_factory, a); if (e) return e;
}
if (p->_data) {
  e = (*v)(p->_data, a); if (e) return e;
}
if (p->_element_stack) {
  e = (*v)(p->_element_stack, a); if (e) return e;
}
if (p->_element_stack_pop) {
  e = (*v)(p->_element_stack_pop, a); if (e) return e;
}
if (p->_last) {
  e = (*v)(((PyObject*)p->_last), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_TreeBuilder(PyObject *o) {
struct __pyx_obj_4lxml_5etree_TreeBuilder *p = (struct __pyx_obj_4lxml_5etree_TreeBuilder *)o;
__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear(o);
Py_XDECREF(((PyObject *)p->_parser));
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_factory);
p->_factory = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_data);
p->_data = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_element_stack);
p->_element_stack = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_element_stack_pop);
p->_element_stack_pop = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_last));
p->_last = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_TreeBuilder[] = {
{"close", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_close, METH_NOARGS, __pyx_doc_4lxml_5etree_11TreeBuilder_close},
{"data", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_data, METH_O, __pyx_doc_4lxml_5etree_11TreeBuilder_data},
{"start", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_start, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_11TreeBuilder_start},
{"end", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_end, METH_O, __pyx_doc_4lxml_5etree_11TreeBuilder_end},
{"pi", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_pi, METH_VARARGS|METH_KEYWORDS, 0},
{"comment", (PyCFunction)__pyx_pf_4lxml_5etree_11TreeBuilder_comment, METH_O, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_TreeBuilder = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_TreeBuilder = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_TreeBuilder = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_TreeBuilder = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_TreeBuilder = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.TreeBuilder", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_TreeBuilder), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_TreeBuilder, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_TreeBuilder, /*tp_as_number*/
&__pyx_tp_as_sequence_TreeBuilder, /*tp_as_sequence*/
&__pyx_tp_as_mapping_TreeBuilder, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_TreeBuilder, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Parser target that builds a tree.\n\n    The final tree is returned by the ``close()`` method.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_TreeBuilder, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_TreeBuilder, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_TreeBuilder, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_11TreeBuilder___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_TreeBuilder, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XMLParser __pyx_vtable_4lxml_5etree_XMLParser;

static PyObject *__pyx_tp_new_4lxml_5etree_XMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XMLParser *p;
PyObject *o = __pyx_ptype_4lxml_5etree__FeedParser->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XMLParser *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XMLParser **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XMLParser;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__FeedParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XMLParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__FeedParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__FeedParser->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XMLParser[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XMLParser = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XMLParser = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XMLParser = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XMLParser = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XMLParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XMLParser", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XMLParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XMLParser, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XMLParser, /*tp_as_number*/
&__pyx_tp_as_sequence_XMLParser, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XMLParser, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XMLParser, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"The XML parser.  Parsers can be supplied as additional argument to\n    various parse functions of the lxml API.  A default parser is always\n    available and can be replaced by a call to the global function\n    \'set_default_parser\'.  New parsers can be created at any time without a\n    major run-time overhead.\n\n    The keyword arguments in the constructor are mainly based on the libxml2\n    parser configuration.  A DTD will also be loaded if validation or\n    attribute default values are requested.\n\n    Available 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 (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    * compact            - safe memory for short text content (default: True)\n    * resolve_entities   - replace entities by their text value (default: True)\n\n    Other keyword arguments:\n    * encoding - override the document encoding\n    * target   - a parser target object that will receive the parse events\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*/
__pyx_tp_traverse_4lxml_5etree_XMLParser, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XMLParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XMLParser, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_9XMLParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XMLParser, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser __pyx_vtable_4lxml_5etree_ETCompatXMLParser;

static PyObject *__pyx_tp_new_4lxml_5etree_ETCompatXMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ETCompatXMLParser *p;
PyObject *o = __pyx_ptype_4lxml_5etree_XMLParser->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ETCompatXMLParser *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ETCompatXMLParser **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ETCompatXMLParser;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ETCompatXMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree_XMLParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ETCompatXMLParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_XMLParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ETCompatXMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree_XMLParser->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ETCompatXMLParser[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ETCompatXMLParser = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ETCompatXMLParser = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ETCompatXMLParser = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ETCompatXMLParser = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ETCompatXMLParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ETCompatXMLParser", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ETCompatXMLParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ETCompatXMLParser, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ETCompatXMLParser, /*tp_as_number*/
&__pyx_tp_as_sequence_ETCompatXMLParser, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ETCompatXMLParser, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ETCompatXMLParser, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"An XML parser with an ElementTree compatible default setup.  See the\n    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*/
__pyx_tp_traverse_4lxml_5etree_ETCompatXMLParser, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ETCompatXMLParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ETCompatXMLParser, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17ETCompatXMLParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ETCompatXMLParser, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_HTMLParser __pyx_vtable_4lxml_5etree_HTMLParser;

static PyObject *__pyx_tp_new_4lxml_5etree_HTMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_HTMLParser *p;
PyObject *o = __pyx_ptype_4lxml_5etree__FeedParser->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_HTMLParser **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_HTMLParser;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_HTMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__FeedParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_HTMLParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__FeedParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_HTMLParser(PyObject *o) {
__pyx_ptype_4lxml_5etree__FeedParser->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_HTMLParser[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_HTMLParser = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_HTMLParser = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_HTMLParser = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_HTMLParser = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_HTMLParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.HTMLParser", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_HTMLParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_HTMLParser, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_HTMLParser, /*tp_as_number*/
&__pyx_tp_as_sequence_HTMLParser, /*tp_as_sequence*/
&__pyx_tp_as_mapping_HTMLParser, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_HTMLParser, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"The HTML parser.  This parser allows reading HTML into a normal XML\n    tree.  By default, it can read broken (non well-formed) HTML, depending on\n    the capabilities of libxml2.  Use the \'recover\' option to switch this off.\n\n    Available boolean keyword arguments:\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    * compact            - safe memory for short text content (default: True)\n\n    Other keyword arguments:\n    * encoding - override the document encoding\n    * target   - a parser target object that will receive the parse events\n\n    Note that you should avoid sharing parsers between threads for performance\n    reasons.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_HTMLParser, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_HTMLParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_HTMLParser, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_10HTMLParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_HTMLParser, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget __pyx_vtable_4lxml_5etree__PythonSaxParserTarget;

static PyObject *__pyx_tp_new_4lxml_5etree__PythonSaxParserTarget(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p;
PyObject *o = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__PythonSaxParserTarget **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget;
p->_target_start = Py_None; Py_INCREF(Py_None);
p->_target_end = Py_None; Py_INCREF(Py_None);
p->_target_data = Py_None; Py_INCREF(Py_None);
p->_target_doctype = Py_None; Py_INCREF(Py_None);
p->_target_pi = Py_None; Py_INCREF(Py_None);
p->_target_comment = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__PythonSaxParserTarget(PyObject *o) {
struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
Py_XDECREF(p->_target_start);
Py_XDECREF(p->_target_end);
Py_XDECREF(p->_target_data);
Py_XDECREF(p->_target_doctype);
Py_XDECREF(p->_target_pi);
Py_XDECREF(p->_target_comment);
__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__PythonSaxParserTarget(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
e = __pyx_ptype_4lxml_5etree__SaxParserTarget->tp_traverse(o, v, a); if (e) return e;
if (p->_target_start) {
  e = (*v)(p->_target_start, a); if (e) return e;
}
if (p->_target_end) {
  e = (*v)(p->_target_end, a); if (e) return e;
}
if (p->_target_data) {
  e = (*v)(p->_target_data, a); if (e) return e;
}
if (p->_target_doctype) {
  e = (*v)(p->_target_doctype, a); if (e) return e;
}
if (p->_target_pi) {
  e = (*v)(p->_target_pi, a); if (e) return e;
}
if (p->_target_comment) {
  e = (*v)(p->_target_comment, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__PythonSaxParserTarget(PyObject *o) {
struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *p = (struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget *)o;
__pyx_ptype_4lxml_5etree__SaxParserTarget->tp_clear(o);
Py_XDECREF(p->_target_start);
p->_target_start = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target_end);
p->_target_end = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target_data);
p->_target_data = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target_doctype);
p->_target_doctype = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target_pi);
p->_target_pi = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_target_comment);
p->_target_comment = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__PythonSaxParserTarget[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__PythonSaxParserTarget = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__PythonSaxParserTarget = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__PythonSaxParserTarget = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__PythonSaxParserTarget = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__PythonSaxParserTarget = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._PythonSaxParserTarget", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__PythonSaxParserTarget), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__PythonSaxParserTarget, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__PythonSaxParserTarget, /*tp_as_number*/
&__pyx_tp_as_sequence__PythonSaxParserTarget, /*tp_as_sequence*/
&__pyx_tp_as_mapping__PythonSaxParserTarget, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__PythonSaxParserTarget, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__PythonSaxParserTarget, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__PythonSaxParserTarget, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__PythonSaxParserTarget, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_22_PythonSaxParserTarget___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__PythonSaxParserTarget, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter __pyx_vtable_4lxml_5etree__FilelikeWriter;

static PyObject *__pyx_tp_new_4lxml_5etree__FilelikeWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__FilelikeWriter *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__FilelikeWriter **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__FilelikeWriter;
p->_filelike = Py_None; Py_INCREF(Py_None);
p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
p->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__FilelikeWriter(PyObject *o) {
struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
Py_XDECREF(p->_filelike);
Py_XDECREF(((PyObject *)p->_exc_context));
Py_XDECREF(((PyObject *)p->error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__FilelikeWriter(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
if (p->_filelike) {
  e = (*v)(p->_filelike, a); if (e) return e;
}
if (p->_exc_context) {
  e = (*v)(((PyObject*)p->_exc_context), a); if (e) return e;
}
if (p->error_log) {
  e = (*v)(((PyObject*)p->error_log), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__FilelikeWriter(PyObject *o) {
struct __pyx_obj_4lxml_5etree__FilelikeWriter *p = (struct __pyx_obj_4lxml_5etree__FilelikeWriter *)o;
Py_XDECREF(p->_filelike);
p->_filelike = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_exc_context));
p->_exc_context = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->error_log));
p->error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__FilelikeWriter[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FilelikeWriter = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__FilelikeWriter = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__FilelikeWriter = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FilelikeWriter = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__FilelikeWriter = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._FilelikeWriter", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__FilelikeWriter), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__FilelikeWriter, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__FilelikeWriter, /*tp_as_number*/
&__pyx_tp_as_sequence__FilelikeWriter, /*tp_as_sequence*/
&__pyx_tp_as_mapping__FilelikeWriter, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__FilelikeWriter, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__FilelikeWriter, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__FilelikeWriter, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__FilelikeWriter, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_15_FilelikeWriter___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__FilelikeWriter, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__IterparseContext __pyx_vtable_4lxml_5etree__IterparseContext;

static PyObject *__pyx_tp_new_4lxml_5etree__IterparseContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__IterparseContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ParserContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__IterparseContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__IterparseContext **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__IterparseContext;
p->_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
p->_events = Py_None; Py_INCREF(Py_None);
p->_ns_stack = Py_None; Py_INCREF(Py_None);
p->_pop_ns = Py_None; Py_INCREF(Py_None);
p->_node_stack = Py_None; Py_INCREF(Py_None);
p->_pop_node = Py_None; Py_INCREF(Py_None);
p->_tag_tuple = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__IterparseContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
Py_XDECREF(((PyObject *)p->_root));
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(p->_events);
Py_XDECREF(p->_ns_stack);
Py_XDECREF(p->_pop_ns);
Py_XDECREF(p->_node_stack);
Py_XDECREF(p->_pop_node);
Py_XDECREF(p->_tag_tuple);
__pyx_ptype_4lxml_5etree__ParserContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__IterparseContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
e = __pyx_ptype_4lxml_5etree__ParserContext->tp_traverse(o, v, a); if (e) return e;
if (p->_root) {
  e = (*v)(((PyObject*)p->_root), a); if (e) return e;
}
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
if (p->_events) {
  e = (*v)(p->_events, a); if (e) return e;
}
if (p->_ns_stack) {
  e = (*v)(p->_ns_stack, a); if (e) return e;
}
if (p->_pop_ns) {
  e = (*v)(p->_pop_ns, a); if (e) return e;
}
if (p->_node_stack) {
  e = (*v)(p->_node_stack, a); if (e) return e;
}
if (p->_pop_node) {
  e = (*v)(p->_pop_node, a); if (e) return e;
}
if (p->_tag_tuple) {
  e = (*v)(p->_tag_tuple, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__IterparseContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__IterparseContext *p = (struct __pyx_obj_4lxml_5etree__IterparseContext *)o;
__pyx_ptype_4lxml_5etree__ParserContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_root));
p->_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_events);
p->_events = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_ns_stack);
p->_ns_stack = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_pop_ns);
p->_pop_ns = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_node_stack);
p->_node_stack = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_pop_node);
p->_pop_node = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_tag_tuple);
p->_tag_tuple = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__IterparseContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__IterparseContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__IterparseContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__IterparseContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__IterparseContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__IterparseContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._IterparseContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__IterparseContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__IterparseContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__IterparseContext, /*tp_as_number*/
&__pyx_tp_as_sequence__IterparseContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__IterparseContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__IterparseContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__IterparseContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__IterparseContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__IterparseContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17_IterparseContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__IterparseContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_iterparse __pyx_vtable_4lxml_5etree_iterparse;

static PyObject *__pyx_tp_new_4lxml_5etree_iterparse(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_iterparse *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseParser->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_iterparse *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_iterparse **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_iterparse;
p->_source = Py_None; Py_INCREF(Py_None);
p->root = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_iterparse(PyObject *o) {
struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
Py_XDECREF(p->_source);
Py_XDECREF(p->root);
__pyx_ptype_4lxml_5etree__BaseParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_iterparse(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
e = __pyx_ptype_4lxml_5etree__BaseParser->tp_traverse(o, v, a); if (e) return e;
if (p->_source) {
  e = (*v)(p->_source, a); if (e) return e;
}
if (p->root) {
  e = (*v)(p->root, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_iterparse(PyObject *o) {
struct __pyx_obj_4lxml_5etree_iterparse *p = (struct __pyx_obj_4lxml_5etree_iterparse *)o;
__pyx_ptype_4lxml_5etree__BaseParser->tp_clear(o);
Py_XDECREF(p->_source);
p->_source = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->root);
p->root = Py_None; Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_9iterparse_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_9iterparse_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_iterparse[] = {
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse_copy, METH_NOARGS, 0},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_9iterparse___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_iterparse[] = {
{"root", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_iterparse, root), READONLY, 0},
{0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree_iterparse[] = {
{"error_log", __pyx_getprop_4lxml_5etree_9iterparse_error_log, 0, __pyx_k23, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_iterparse = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_iterparse = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_iterparse = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_iterparse = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_iterparse = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.iterparse", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_iterparse), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_iterparse, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_iterparse, /*tp_as_number*/
&__pyx_tp_as_sequence_iterparse, /*tp_as_sequence*/
&__pyx_tp_as_mapping_iterparse, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_iterparse, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Incremental parser.  Parses XML into a tree and generates tuples\n    (event, element) in a SAX-like fashion. ``event`` is any of \'start\',\n    \'end\', \'start-ns\', \'end-ns\'.\n\n    For \'start\' and \'end\', ``element`` is the Element that the parser just\n    found opening or closing.  For \'start-ns\', it is a tuple (prefix, URI) of\n    a new namespace declaration.  For \'end-ns\', it is simply None.  Note that\n    all start and end events are guaranteed to be properly nested.\n\n    The keyword argument ``events`` specifies a sequence of event type names\n    that should be generated.  By default, only \'end\' events will be\n    generated.\n\n    The additional ``tag`` argument restricts the \'start\' and \'end\' events to\n    those elements that match the given tag.  By default, events are generated\n    for all elements.  Note that the \'start-ns\' and \'end-ns\' events are not\n    impacted by this restriction.\n\n    The other keyword arguments in the constructor are mainly based on the\n    libxml2 parser configuration.  A DTD will also be loaded if validation or\n    attribute default values are requested.\n\n    Available 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\n    Other keyword arguments:\n    * encoding           - override the document encoding\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_iterparse, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_iterparse, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_9iterparse___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_9iterparse___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree_iterparse, /*tp_methods*/
__pyx_members_4lxml_5etree_iterparse, /*tp_members*/
__pyx_getsets_4lxml_5etree_iterparse, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_9iterparse___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_iterparse, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_iterwalk __pyx_vtable_4lxml_5etree_iterwalk;

static PyObject *__pyx_tp_new_4lxml_5etree_iterwalk(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_iterwalk *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_iterwalk *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_iterwalk **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_iterwalk;
p->_node_stack = Py_None; Py_INCREF(Py_None);
p->_pop_node = Py_None; Py_INCREF(Py_None);
p->_events = Py_None; Py_INCREF(Py_None);
p->_pop_event = Py_None; Py_INCREF(Py_None);
p->_tag_tuple = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_iterwalk(PyObject *o) {
struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
Py_XDECREF(p->_node_stack);
Py_XDECREF(p->_pop_node);
Py_XDECREF(p->_events);
Py_XDECREF(p->_pop_event);
Py_XDECREF(p->_tag_tuple);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_iterwalk(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
if (p->_node_stack) {
  e = (*v)(p->_node_stack, a); if (e) return e;
}
if (p->_pop_node) {
  e = (*v)(p->_pop_node, a); if (e) return e;
}
if (p->_events) {
  e = (*v)(p->_events, a); if (e) return e;
}
if (p->_pop_event) {
  e = (*v)(p->_pop_event, a); if (e) return e;
}
if (p->_tag_tuple) {
  e = (*v)(p->_tag_tuple, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_iterwalk(PyObject *o) {
struct __pyx_obj_4lxml_5etree_iterwalk *p = (struct __pyx_obj_4lxml_5etree_iterwalk *)o;
Py_XDECREF(p->_node_stack);
p->_node_stack = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_pop_node);
p->_pop_node = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_events);
p->_events = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_pop_event);
p->_pop_event = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_tag_tuple);
p->_tag_tuple = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_iterwalk[] = {
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_8iterwalk___iter__, METH_NOARGS|METH_COEXIST, 0},
{"__next__", (PyCFunction)__pyx_pf_4lxml_5etree_8iterwalk___next__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_iterwalk = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_iterwalk = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_iterwalk = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_iterwalk = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_iterwalk = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.iterwalk", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_iterwalk), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_iterwalk, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_iterwalk, /*tp_as_number*/
&__pyx_tp_as_sequence_iterwalk, /*tp_as_sequence*/
&__pyx_tp_as_mapping_iterwalk, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_iterwalk, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"A tree walker that generates events from an existing tree as if it was\n    parsing XML data with ``iterparse()``.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_iterwalk, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_iterwalk, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_8iterwalk___iter__, /*tp_iter*/
__pyx_pf_4lxml_5etree_8iterwalk___next__, /*tp_iternext*/
__pyx_methods_4lxml_5etree_iterwalk, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_8iterwalk___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_iterwalk, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__IDDict __pyx_vtable_4lxml_5etree__IDDict;

static PyObject *__pyx_tp_new_4lxml_5etree__IDDict(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__IDDict *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__IDDict *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__IDDict **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__IDDict;
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
p->_keys = Py_None; Py_INCREF(Py_None);
p->_items = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__IDDict(PyObject *o) {
struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(p->_keys);
Py_XDECREF(p->_items);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__IDDict(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
if (p->_keys) {
  e = (*v)(p->_keys, a); if (e) return e;
}
if (p->_items) {
  e = (*v)(p->_items, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__IDDict(PyObject *o) {
struct __pyx_obj_4lxml_5etree__IDDict *p = (struct __pyx_obj_4lxml_5etree__IDDict *)o;
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_keys);
p->_keys = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_items);
p->_items = Py_None; Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_4lxml_5etree__IDDict(PyObject *o, Py_ssize_t i) {
PyObject *r;
PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
r = o->ob_type->tp_as_mapping->mp_subscript(o, x);
Py_DECREF(x);
return r;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__IDDict[] = {
{"copy", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_copy, METH_NOARGS, 0},
{"__getitem__", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___getitem__, METH_O|METH_COEXIST, 0},
{"get", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_get, METH_O, 0},
{"has_key", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_has_key, METH_O, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___repr__, METH_NOARGS|METH_COEXIST, 0},
{"keys", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_keys, METH_NOARGS, 0},
{"__iter__", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict___iter__, METH_NOARGS|METH_COEXIST, 0},
{"iterkeys", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_iterkeys, METH_NOARGS, 0},
{"items", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_items, METH_NOARGS, 0},
{"iteritems", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_iteritems, METH_NOARGS, 0},
{"values", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_values, METH_NOARGS, 0},
{"itervalues", (PyCFunction)__pyx_pf_4lxml_5etree_7_IDDict_itervalues, METH_NOARGS, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__IDDict = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__IDDict = {
__pyx_pf_4lxml_5etree_7_IDDict___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_4lxml_5etree__IDDict, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_pf_4lxml_5etree_7_IDDict___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__IDDict = {
__pyx_pf_4lxml_5etree_7_IDDict___len__, /*mp_length*/
__pyx_pf_4lxml_5etree_7_IDDict___getitem__, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__IDDict = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__IDDict = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._IDDict", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__IDDict), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__IDDict, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
__pyx_pf_4lxml_5etree_7_IDDict___cmp__, /*tp_compare*/
__pyx_pf_4lxml_5etree_7_IDDict___repr__, /*tp_repr*/
&__pyx_tp_as_number__IDDict, /*tp_as_number*/
&__pyx_tp_as_sequence__IDDict, /*tp_as_sequence*/
&__pyx_tp_as_mapping__IDDict, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__IDDict, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree__IDDict, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__IDDict, /*tp_clear*/
__pyx_pf_4lxml_5etree_7_IDDict___richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_pf_4lxml_5etree_7_IDDict___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__IDDict, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_7_IDDict___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__IDDict, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp __pyx_vtable_4lxml_5etree__ExsltRegExp;

static PyObject *__pyx_tp_new_4lxml_5etree__ExsltRegExp(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__ExsltRegExp *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__ExsltRegExp **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__ExsltRegExp;
p->_compile_map = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__ExsltRegExp(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
Py_XDECREF(p->_compile_map);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__ExsltRegExp(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
if (p->_compile_map) {
  e = (*v)(p->_compile_map, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__ExsltRegExp(PyObject *o) {
struct __pyx_obj_4lxml_5etree__ExsltRegExp *p = (struct __pyx_obj_4lxml_5etree__ExsltRegExp *)o;
Py_XDECREF(p->_compile_map);
p->_compile_map = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__ExsltRegExp[] = {
{"test", (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_test, METH_VARARGS|METH_KEYWORDS, 0},
{"match", (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_match, METH_VARARGS|METH_KEYWORDS, 0},
{"replace", (PyCFunction)__pyx_pf_4lxml_5etree_12_ExsltRegExp_replace, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__ExsltRegExp = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__ExsltRegExp = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__ExsltRegExp = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__ExsltRegExp = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__ExsltRegExp = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._ExsltRegExp", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__ExsltRegExp), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__ExsltRegExp, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__ExsltRegExp, /*tp_as_number*/
&__pyx_tp_as_sequence__ExsltRegExp, /*tp_as_sequence*/
&__pyx_tp_as_mapping__ExsltRegExp, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__ExsltRegExp, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__ExsltRegExp, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__ExsltRegExp, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__ExsltRegExp, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_12_ExsltRegExp___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__ExsltRegExp, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__BaseContext __pyx_vtable_4lxml_5etree__BaseContext;

static PyObject *__pyx_tp_new_4lxml_5etree__BaseContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__BaseContext *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__BaseContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__BaseContext **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__BaseContext;
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
p->_extensions = Py_None; Py_INCREF(Py_None);
p->_namespaces = Py_None; Py_INCREF(Py_None);
p->_global_namespaces = Py_None; Py_INCREF(Py_None);
p->_utf_refs = Py_None; Py_INCREF(Py_None);
p->_function_cache = Py_None; Py_INCREF(Py_None);
p->_eval_context_dict = Py_None; Py_INCREF(Py_None);
p->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
p->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__BaseContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(p->_extensions);
Py_XDECREF(p->_namespaces);
Py_XDECREF(p->_global_namespaces);
Py_XDECREF(p->_utf_refs);
Py_XDECREF(p->_function_cache);
Py_XDECREF(p->_eval_context_dict);
Py_XDECREF(((PyObject *)p->_temp_refs));
Py_XDECREF(((PyObject *)p->_exc));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__BaseContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
if (p->_doc) {
  e = (*v)(((PyObject*)p->_doc), a); if (e) return e;
}
if (p->_extensions) {
  e = (*v)(p->_extensions, a); if (e) return e;
}
if (p->_namespaces) {
  e = (*v)(p->_namespaces, a); if (e) return e;
}
if (p->_global_namespaces) {
  e = (*v)(p->_global_namespaces, a); if (e) return e;
}
if (p->_utf_refs) {
  e = (*v)(p->_utf_refs, a); if (e) return e;
}
if (p->_function_cache) {
  e = (*v)(p->_function_cache, a); if (e) return e;
}
if (p->_eval_context_dict) {
  e = (*v)(p->_eval_context_dict, a); if (e) return e;
}
if (p->_temp_refs) {
  e = (*v)(((PyObject*)p->_temp_refs), a); if (e) return e;
}
if (p->_exc) {
  e = (*v)(((PyObject*)p->_exc), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__BaseContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__BaseContext *p = (struct __pyx_obj_4lxml_5etree__BaseContext *)o;
Py_XDECREF(((PyObject *)p->_doc));
p->_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(p->_extensions);
p->_extensions = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_namespaces);
p->_namespaces = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_global_namespaces);
p->_global_namespaces = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_utf_refs);
p->_utf_refs = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_function_cache);
p->_function_cache = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_eval_context_dict);
p->_eval_context_dict = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_temp_refs));
p->_temp_refs = ((struct __pyx_obj_4lxml_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_exc));
p->_exc = ((struct __pyx_obj_4lxml_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_12_BaseContext_context_node(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_12_BaseContext_12context_node___get__(o);
}

static PyObject *__pyx_getprop_4lxml_5etree_12_BaseContext_eval_context(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_12_BaseContext_12eval_context___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__BaseContext[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__BaseContext[] = {
{"context_node", __pyx_getprop_4lxml_5etree_12_BaseContext_context_node, 0, 0, 0},
{"eval_context", __pyx_getprop_4lxml_5etree_12_BaseContext_eval_context, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__BaseContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__BaseContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__BaseContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__BaseContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__BaseContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._BaseContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__BaseContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__BaseContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__BaseContext, /*tp_as_number*/
&__pyx_tp_as_sequence__BaseContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__BaseContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__BaseContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__BaseContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__BaseContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__BaseContext, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__BaseContext, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_12_BaseContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__BaseContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XPathContext __pyx_vtable_4lxml_5etree__XPathContext;

static PyObject *__pyx_tp_new_4lxml_5etree__XPathContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XPathContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XPathContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XPathContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XPathContext;
p->_variables = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XPathContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
Py_XDECREF(p->_variables);
__pyx_ptype_4lxml_5etree__BaseContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XPathContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
e = __pyx_ptype_4lxml_5etree__BaseContext->tp_traverse(o, v, a); if (e) return e;
if (p->_variables) {
  e = (*v)(p->_variables, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XPathContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathContext *p = (struct __pyx_obj_4lxml_5etree__XPathContext *)o;
__pyx_ptype_4lxml_5etree__BaseContext->tp_clear(o);
Py_XDECREF(p->_variables);
p->_variables = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XPathContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XPathContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XPathContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XPathContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XPathContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XPathContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XPathContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XPathContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XPathContext, /*tp_as_number*/
&__pyx_tp_as_sequence__XPathContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XPathContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XPathContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XPathContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XPathContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XPathContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_13_XPathContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XPathContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase __pyx_vtable_4lxml_5etree__XPathEvaluatorBase;

static PyObject *__pyx_tp_new_4lxml_5etree__XPathEvaluatorBase(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XPathEvaluatorBase **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
p->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_context));
Py_XDECREF(((PyObject *)p->_error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
if (p->_context) {
  e = (*v)(((PyObject*)p->_context), a); if (e) return e;
}
if (p->_error_log) {
  e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase *)o;
Py_XDECREF(((PyObject *)p->_context));
p->_context = ((struct __pyx_obj_4lxml_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_19_XPathEvaluatorBase_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XPathEvaluatorBase[] = {
{"evaluate", (PyCFunction)__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase_evaluate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_19_XPathEvaluatorBase_evaluate},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XPathEvaluatorBase[] = {
{"error_log", __pyx_getprop_4lxml_5etree_19_XPathEvaluatorBase_error_log, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XPathEvaluatorBase = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XPathEvaluatorBase = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XPathEvaluatorBase = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XPathEvaluatorBase = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XPathEvaluatorBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XPathEvaluatorBase", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XPathEvaluatorBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XPathEvaluatorBase, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XPathEvaluatorBase, /*tp_as_number*/
&__pyx_tp_as_sequence__XPathEvaluatorBase, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XPathEvaluatorBase, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XPathEvaluatorBase, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XPathEvaluatorBase, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XPathEvaluatorBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XPathEvaluatorBase, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__XPathEvaluatorBase, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_19_XPathEvaluatorBase___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XPathEvaluatorBase, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator __pyx_vtable_4lxml_5etree_XPathElementEvaluator;

static PyObject *__pyx_tp_new_4lxml_5etree_XPathElementEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p;
PyObject *o = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XPathElementEvaluator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
Py_XDECREF(((PyObject *)p->_element));
__pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XPathElementEvaluator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
e = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_traverse(o, v, a); if (e) return e;
if (p->_element) {
  e = (*v)(((PyObject*)p->_element), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XPathElementEvaluator(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *p = (struct __pyx_obj_4lxml_5etree_XPathElementEvaluator *)o;
__pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_clear(o);
Py_XDECREF(((PyObject *)p->_element));
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XPathElementEvaluator[] = {
{"registerNamespace", (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_21XPathElementEvaluator_registerNamespace},
{"registerNamespaces", (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator_registerNamespaces, METH_O, __pyx_doc_4lxml_5etree_21XPathElementEvaluator_registerNamespaces},
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_21XPathElementEvaluator___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XPathElementEvaluator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XPathElementEvaluator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XPathElementEvaluator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XPathElementEvaluator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XPathElementEvaluator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XPathElementEvaluator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XPathElementEvaluator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XPathElementEvaluator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XPathElementEvaluator, /*tp_as_number*/
&__pyx_tp_as_sequence_XPathElementEvaluator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XPathElementEvaluator, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_21XPathElementEvaluator___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XPathElementEvaluator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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 \'namespace\'\n    keyword argument.  EXSLT regular expression support can be disabled with\n    the \'regexp\' boolean keyword (defaults to True).\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XPathElementEvaluator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XPathElementEvaluator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XPathElementEvaluator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_21XPathElementEvaluator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XPathElementEvaluator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator __pyx_vtable_4lxml_5etree_XPathDocumentEvaluator;

static PyObject *__pyx_tp_new_4lxml_5etree_XPathDocumentEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *p;
PyObject *o = __pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XPathDocumentEvaluator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XPathDocumentEvaluator(PyObject *o) {
__pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XPathDocumentEvaluator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XPathDocumentEvaluator(PyObject *o) {
__pyx_ptype_4lxml_5etree_XPathElementEvaluator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XPathDocumentEvaluator[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_22XPathDocumentEvaluator___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XPathDocumentEvaluator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XPathDocumentEvaluator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XPathDocumentEvaluator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XPathDocumentEvaluator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XPathDocumentEvaluator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XPathDocumentEvaluator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XPathDocumentEvaluator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XPathDocumentEvaluator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XPathDocumentEvaluator, /*tp_as_number*/
&__pyx_tp_as_sequence_XPathDocumentEvaluator, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XPathDocumentEvaluator, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XPathDocumentEvaluator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Create an XPath evaluator for an ElementTree.\n\n    Additional namespace declarations can be passed with the \'namespace\'\n    keyword argument.  EXSLT regular expression support can be disabled with\n    the \'regexp\' boolean keyword (defaults to True).\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XPathDocumentEvaluator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XPathDocumentEvaluator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XPathDocumentEvaluator, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_22XPathDocumentEvaluator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XPathDocumentEvaluator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XPath __pyx_vtable_4lxml_5etree_XPath;

static PyObject *__pyx_tp_new_4lxml_5etree_XPath(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XPath *p;
PyObject *o = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XPath *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XPath **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XPath;
p->path = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XPath(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_5XPath___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(p->path);
__pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XPath(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
e = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_traverse(o, v, a); if (e) return e;
if (p->path) {
  e = (*v)(p->path, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XPath(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XPath *p = (struct __pyx_obj_4lxml_5etree_XPath *)o;
__pyx_ptype_4lxml_5etree__XPathEvaluatorBase->tp_clear(o);
Py_XDECREF(p->path);
p->path = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XPath[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_5XPath___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, 0},
{"__repr__", (PyCFunction)__pyx_pf_4lxml_5etree_5XPath___repr__, METH_NOARGS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_4lxml_5etree_XPath[] = {
{"path", T_OBJECT, offsetof(struct __pyx_obj_4lxml_5etree_XPath, path), READONLY, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XPath = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XPath = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XPath = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XPath = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XPath = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XPath", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XPath), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XPath, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_pf_4lxml_5etree_5XPath___repr__, /*tp_repr*/
&__pyx_tp_as_number_XPath, /*tp_as_number*/
&__pyx_tp_as_sequence_XPath, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XPath, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_5XPath___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XPath, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"A compiled XPath expression that can be called on Elements and\n    ElementTrees.\n\n    Besides the XPath expression, you can pass prefix-namespace mappings and\n    extension functions to the constructor through the keyword arguments\n    ``namespaces`` and ``extensions``.  EXSLT regular expression support can\n    be disabled with the \'regexp\' boolean keyword (defaults to True).\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XPath, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XPath, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XPath, /*tp_methods*/
__pyx_members_4lxml_5etree_XPath, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_5XPath___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XPath, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_ETXPath __pyx_vtable_4lxml_5etree_ETXPath;

static PyObject *__pyx_tp_new_4lxml_5etree_ETXPath(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_ETXPath *p;
PyObject *o = __pyx_ptype_4lxml_5etree_XPath->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_ETXPath *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_ETXPath **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree_ETXPath;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_ETXPath(PyObject *o) {
__pyx_ptype_4lxml_5etree_XPath->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_ETXPath(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_XPath->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_ETXPath(PyObject *o) {
__pyx_ptype_4lxml_5etree_XPath->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_ETXPath[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_ETXPath = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_ETXPath = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_ETXPath = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_ETXPath = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_ETXPath = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.ETXPath", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_ETXPath), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_ETXPath, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_ETXPath, /*tp_as_number*/
&__pyx_tp_as_sequence_ETXPath, /*tp_as_sequence*/
&__pyx_tp_as_mapping_ETXPath, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_ETXPath, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Special XPath class that supports the ElementTree {uri} notation for\n    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 string.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_ETXPath, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_ETXPath, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_ETXPath, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_7ETXPath___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_ETXPath, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext __pyx_vtable_4lxml_5etree__XSLTResolverContext;

static PyObject *__pyx_tp_new_4lxml_5etree__XSLTResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ResolverContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XSLTResolverContext **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XSLTResolverContext;
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XSLTResolverContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
Py_XDECREF(((PyObject *)p->_parser));
__pyx_ptype_4lxml_5etree__ResolverContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XSLTResolverContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
e = __pyx_ptype_4lxml_5etree__ResolverContext->tp_traverse(o, v, a); if (e) return e;
if (p->_parser) {
  e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XSLTResolverContext(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XSLTResolverContext *p = (struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)o;
__pyx_ptype_4lxml_5etree__ResolverContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_parser));
p->_parser = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTResolverContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XSLTResolverContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XSLTResolverContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XSLTResolverContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XSLTResolverContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XSLTResolverContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XSLTResolverContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XSLTResolverContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XSLTResolverContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XSLTResolverContext, /*tp_as_number*/
&__pyx_tp_as_sequence__XSLTResolverContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XSLTResolverContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XSLTResolverContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XSLTResolverContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XSLTResolverContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XSLTResolverContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XSLTResolverContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl __pyx_vtable_4lxml_5etree_XSLTAccessControl;

static PyObject *__pyx_tp_new_4lxml_5etree_XSLTAccessControl(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XSLTAccessControl *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XSLTAccessControl **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XSLTAccessControl;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XSLTAccessControl(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_17XSLTAccessControl___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XSLTAccessControl(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XSLTAccessControl(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XSLTAccessControl[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XSLTAccessControl = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XSLTAccessControl = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XSLTAccessControl = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XSLTAccessControl = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XSLTAccessControl = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XSLTAccessControl", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XSLTAccessControl), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XSLTAccessControl, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XSLTAccessControl, /*tp_as_number*/
&__pyx_tp_as_sequence_XSLTAccessControl, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XSLTAccessControl, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XSLTAccessControl, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Access control for XSLT: reading/writing files, directories and network\n    I/O.  Access to a type of resource is granted or denied by passing any of\n    the following keyword arguments.  All of them default to True to allow\n    access.\n\n    * read_file\n    * write_file\n    * create_dir\n    * read_network\n    * write_network\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XSLTAccessControl, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XSLTAccessControl, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XSLTAccessControl, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_17XSLTAccessControl___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XSLTAccessControl, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XSLTContext __pyx_vtable_4lxml_5etree__XSLTContext;

static PyObject *__pyx_tp_new_4lxml_5etree__XSLTContext(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XSLTContext *p;
PyObject *o = __pyx_ptype_4lxml_5etree__BaseContext->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XSLTContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XSLTContext;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XSLTContext(PyObject *o) {
__pyx_ptype_4lxml_5etree__BaseContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XSLTContext(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__BaseContext->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XSLTContext(PyObject *o) {
__pyx_ptype_4lxml_5etree__BaseContext->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XSLTContext = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XSLTContext = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XSLTContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XSLTContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XSLTContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XSLTContext", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XSLTContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XSLTContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XSLTContext, /*tp_as_number*/
&__pyx_tp_as_sequence__XSLTContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XSLTContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XSLTContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XSLTContext, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XSLTContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XSLTContext, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_12_XSLTContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XSLTContext, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree_XSLT __pyx_vtable_4lxml_5etree_XSLT;

static PyObject *__pyx_tp_new_4lxml_5etree_XSLT(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree_XSLT *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree_XSLT *)o);
*(struct __pyx_vtabstruct_4lxml_5etree_XSLT **)&p->__pyx_vtab = __pyx_vtabptr_4lxml_5etree_XSLT;
p->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
p->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
p->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XSLT(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_4XSLT___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_context));
Py_XDECREF(((PyObject *)p->_xslt_resolver_context));
Py_XDECREF(((PyObject *)p->_access_control));
Py_XDECREF(((PyObject *)p->_error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XSLT(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
if (p->_context) {
  e = (*v)(((PyObject*)p->_context), a); if (e) return e;
}
if (p->_xslt_resolver_context) {
  e = (*v)(((PyObject*)p->_xslt_resolver_context), a); if (e) return e;
}
if (p->_access_control) {
  e = (*v)(((PyObject*)p->_access_control), a); if (e) return e;
}
if (p->_error_log) {
  e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XSLT(PyObject *o) {
struct __pyx_obj_4lxml_5etree_XSLT *p = (struct __pyx_obj_4lxml_5etree_XSLT *)o;
Py_XDECREF(((PyObject *)p->_context));
p->_context = ((struct __pyx_obj_4lxml_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_xslt_resolver_context));
p->_xslt_resolver_context = ((struct __pyx_obj_4lxml_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_access_control));
p->_access_control = ((struct __pyx_obj_4lxml_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_4XSLT_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_4XSLT_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XSLT[] = {
{"apply", (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT_apply, METH_VARARGS|METH_KEYWORDS, 0},
{"tostring", (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT_tostring, METH_O, __pyx_doc_4lxml_5etree_4XSLT_tostring},
{"__deepcopy__", (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___deepcopy__, METH_O, 0},
{"__copy__", (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___copy__, METH_NOARGS, 0},
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_4XSLT___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree_XSLT[] = {
{"error_log", __pyx_getprop_4lxml_5etree_4XSLT_error_log, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XSLT = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XSLT = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XSLT = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XSLT = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XSLT = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XSLT", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XSLT), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XSLT, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XSLT, /*tp_as_number*/
&__pyx_tp_as_sequence_XSLT, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XSLT, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_4XSLT___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XSLT, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Turn a document into an XSLT object.\n\n    Keyword arguments of the constructor:\n    * regexp - enable exslt regular expression support in XPath (default: True)\n    * access_control - access restrictions for network or file system\n\n    Keyword arguments of the XSLT run:\n    * profile_run - enable XSLT profiling\n\n    Other keyword arguments are passed to the stylesheet.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XSLT, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XSLT, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XSLT, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree_XSLT, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_4XSLT___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XSLT, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree __pyx_vtable_4lxml_5etree__XSLTResultTree;

static PyObject *__pyx_tp_new_4lxml_5etree__XSLTResultTree(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XSLTResultTree *p;
PyObject *o = __pyx_ptype_4lxml_5etree__ElementTree->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XSLTResultTree **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XSLTResultTree;
p->_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); Py_INCREF(Py_None);
p->_profile = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XSLTResultTree(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
Py_XDECREF(((PyObject *)p->_xslt));
Py_XDECREF(((PyObject *)p->_profile));
__pyx_ptype_4lxml_5etree__ElementTree->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XSLTResultTree(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
e = __pyx_ptype_4lxml_5etree__ElementTree->tp_traverse(o, v, a); if (e) return e;
if (p->_xslt) {
  e = (*v)(((PyObject*)p->_xslt), a); if (e) return e;
}
if (p->_profile) {
  e = (*v)(((PyObject*)p->_profile), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XSLTResultTree(PyObject *o) {
struct __pyx_obj_4lxml_5etree__XSLTResultTree *p = (struct __pyx_obj_4lxml_5etree__XSLTResultTree *)o;
__pyx_ptype_4lxml_5etree__ElementTree->tp_clear(o);
Py_XDECREF(((PyObject *)p->_xslt));
p->_xslt = ((struct __pyx_obj_4lxml_5etree_XSLT *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_profile));
p->_profile = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___get__(o);
}

static int __pyx_setprop_4lxml_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, PyObject *v, void *x) {
if (v) {
  PyErr_SetString(PyExc_NotImplementedError, "__set__");
  return -1;
}
else {
  return __pyx_pf_4lxml_5etree_15_XSLTResultTree_12xslt_profile___del__(o);
}
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTResultTree[] = {
{"__str__", (PyCFunction)__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__, METH_NOARGS|METH_COEXIST, 0},
{"__unicode__", (PyCFunction)__pyx_pf_4lxml_5etree_15_XSLTResultTree___unicode__, METH_NOARGS, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__XSLTResultTree[] = {
{"xslt_profile", __pyx_getprop_4lxml_5etree_15_XSLTResultTree_xslt_profile, __pyx_setprop_4lxml_5etree_15_XSLTResultTree_xslt_profile, __pyx_k24, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XSLTResultTree = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XSLTResultTree = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XSLTResultTree = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XSLTResultTree = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XSLTResultTree = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XSLTResultTree", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XSLTResultTree), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XSLTResultTree, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XSLTResultTree, /*tp_as_number*/
&__pyx_tp_as_sequence__XSLTResultTree, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XSLTResultTree, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
__pyx_pf_4lxml_5etree_15_XSLTResultTree___str__, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XSLTResultTree, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XSLTResultTree, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XSLTResultTree, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XSLTResultTree, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__XSLTResultTree, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XSLTResultTree, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction __pyx_vtable_4lxml_5etree__XSLTProcessingInstruction;

static PyObject *__pyx_tp_new_4lxml_5etree__XSLTProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *p;
PyObject *o = __pyx_ptype_4lxml_5etree_PIBase->tp_new(t, a, k);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction *)o);
*(struct __pyx_vtabstruct_4lxml_5etree__XSLTProcessingInstruction **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__XSLTProcessingInstruction(PyObject *o) {
__pyx_ptype_4lxml_5etree_PIBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree__XSLTProcessingInstruction(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree_PIBase->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__XSLTProcessingInstruction(PyObject *o) {
__pyx_ptype_4lxml_5etree_PIBase->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__XSLTProcessingInstruction[] = {
{"parseXSL", (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_26_XSLTProcessingInstruction_parseXSL},
{"set", (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_set, METH_VARARGS|METH_KEYWORDS, 0},
{"get", (PyCFunction)__pyx_pf_4lxml_5etree_26_XSLTProcessingInstruction_get, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__XSLTProcessingInstruction = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__XSLTProcessingInstruction = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__XSLTProcessingInstruction = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__XSLTProcessingInstruction = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__XSLTProcessingInstruction = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._XSLTProcessingInstruction", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__XSLTProcessingInstruction), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__XSLTProcessingInstruction, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__XSLTProcessingInstruction, /*tp_as_number*/
&__pyx_tp_as_sequence__XSLTProcessingInstruction, /*tp_as_sequence*/
&__pyx_tp_as_mapping__XSLTProcessingInstruction, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__XSLTProcessingInstruction, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__XSLTProcessingInstruction, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__XSLTProcessingInstruction, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__XSLTProcessingInstruction, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
0, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__XSLTProcessingInstruction, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree__Validator(PyTypeObject *t, PyObject *a, PyObject *k) {
struct __pyx_obj_4lxml_5etree__Validator *p;
PyObject *o = (*t->tp_alloc)(t, 0);
if (!o) return 0;
p = ((struct __pyx_obj_4lxml_5etree__Validator *)o);
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree__Validator(PyObject *o) {
struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
Py_XDECREF(((PyObject *)p->_error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_4lxml_5etree__Validator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
if (p->_error_log) {
  e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_4lxml_5etree__Validator(PyObject *o) {
struct __pyx_obj_4lxml_5etree__Validator *p = (struct __pyx_obj_4lxml_5etree__Validator *)o;
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_4lxml_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_4lxml_5etree_10_Validator_error_log(PyObject *o, void *x) {
return __pyx_pf_4lxml_5etree_10_Validator_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_4lxml_5etree__Validator[] = {
{"validate", (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_validate, METH_O, __pyx_doc_4lxml_5etree_10_Validator_validate},
{"assertValid", (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_assertValid, METH_O, __pyx_doc_4lxml_5etree_10_Validator_assertValid},
{"assert_", (PyCFunction)__pyx_pf_4lxml_5etree_10_Validator_assert_, METH_O, __pyx_doc_4lxml_5etree_10_Validator_assert_},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_4lxml_5etree__Validator[] = {
{"error_log", __pyx_getprop_4lxml_5etree_10_Validator_error_log, 0, 0, 0},
{0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__Validator = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence__Validator = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Validator = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__Validator = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree__Validator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree._Validator", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree__Validator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree__Validator, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__Validator, /*tp_as_number*/
&__pyx_tp_as_sequence__Validator, /*tp_as_sequence*/
&__pyx_tp_as_mapping__Validator, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__Validator, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Base class for XML validators.", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree__Validator, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree__Validator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree__Validator, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_4lxml_5etree__Validator, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_10_Validator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree__Validator, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_DTD(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_4lxml_5etree__Validator->tp_new(t, a, k);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_DTD(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_3DTD___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_4lxml_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_DTD(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_DTD(PyObject *o) {
__pyx_ptype_4lxml_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_DTD[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_3DTD___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_3DTD___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_DTD = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_DTD = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_DTD = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_DTD = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_DTD = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.DTD", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_DTD), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_DTD, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_DTD, /*tp_as_number*/
&__pyx_tp_as_sequence_DTD, /*tp_as_sequence*/
&__pyx_tp_as_mapping_DTD, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_3DTD___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_DTD, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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*/
__pyx_tp_traverse_4lxml_5etree_DTD, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_DTD, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_DTD, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_3DTD___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_DTD, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_RelaxNG(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_4lxml_5etree__Validator->tp_new(t, a, k);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_RelaxNG(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_7RelaxNG___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_4lxml_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_RelaxNG(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_RelaxNG(PyObject *o) {
__pyx_ptype_4lxml_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_RelaxNG[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_7RelaxNG___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_7RelaxNG___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_RelaxNG = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_RelaxNG = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_RelaxNG = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_RelaxNG = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_RelaxNG = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.RelaxNG", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_RelaxNG), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_RelaxNG, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_RelaxNG, /*tp_as_number*/
&__pyx_tp_as_sequence_RelaxNG, /*tp_as_sequence*/
&__pyx_tp_as_mapping_RelaxNG, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_7RelaxNG___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_RelaxNG, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Turn a document into a Relax NG validator.\n    Can also load from filesystem directly given file object or filename.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_RelaxNG, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_RelaxNG, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_RelaxNG, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_7RelaxNG___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_RelaxNG, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_XMLSchema(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_4lxml_5etree__Validator->tp_new(t, a, k);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_XMLSchema(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_9XMLSchema___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_4lxml_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_XMLSchema(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_XMLSchema(PyObject *o) {
__pyx_ptype_4lxml_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_XMLSchema[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_9XMLSchema___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_9XMLSchema___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_XMLSchema = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_XMLSchema = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_XMLSchema = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_XMLSchema = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_XMLSchema = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.XMLSchema", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_XMLSchema), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_XMLSchema, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_XMLSchema, /*tp_as_number*/
&__pyx_tp_as_sequence_XMLSchema, /*tp_as_sequence*/
&__pyx_tp_as_mapping_XMLSchema, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_9XMLSchema___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_XMLSchema, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"Turn a document into an XML Schema validator.\n    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_XMLSchema, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_XMLSchema, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_XMLSchema, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_9XMLSchema___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_XMLSchema, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_4lxml_5etree_Schematron(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_4lxml_5etree__Validator->tp_new(t, a, k);
if (!o) return 0;
return o;
}

static void __pyx_tp_dealloc_4lxml_5etree_Schematron(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_pf_4lxml_5etree_10Schematron___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_4lxml_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_4lxml_5etree_Schematron(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_4lxml_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_4lxml_5etree_Schematron(PyObject *o) {
__pyx_ptype_4lxml_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_4lxml_5etree_Schematron[] = {
{"__call__", (PyCFunction)__pyx_pf_4lxml_5etree_10Schematron___call__, METH_VARARGS|METH_KEYWORDS|METH_COEXIST, __pyx_doc_4lxml_5etree_10Schematron___call__},
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Schematron = {
0, /*nb_add*/
0, /*nb_subtract*/
0, /*nb_multiply*/
0, /*nb_divide*/
0, /*nb_remainder*/
0, /*nb_divmod*/
0, /*nb_power*/
0, /*nb_negative*/
0, /*nb_positive*/
0, /*nb_absolute*/
0, /*nb_nonzero*/
0, /*nb_invert*/
0, /*nb_lshift*/
0, /*nb_rshift*/
0, /*nb_and*/
0, /*nb_xor*/
0, /*nb_or*/
0, /*nb_coerce*/
0, /*nb_int*/
0, /*nb_long*/
0, /*nb_float*/
0, /*nb_oct*/
0, /*nb_hex*/
0, /*nb_inplace_add*/
0, /*nb_inplace_subtract*/
0, /*nb_inplace_multiply*/
0, /*nb_inplace_divide*/
0, /*nb_inplace_remainder*/
0, /*nb_inplace_power*/
0, /*nb_inplace_lshift*/
0, /*nb_inplace_rshift*/
0, /*nb_inplace_and*/
0, /*nb_inplace_xor*/
0, /*nb_inplace_or*/
0, /*nb_floor_divide*/
0, /*nb_true_divide*/
0, /*nb_inplace_floor_divide*/
0, /*nb_inplace_true_divide*/
#if Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX
0, /*nb_index*/
#endif
};

static PySequenceMethods __pyx_tp_as_sequence_Schematron = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
0, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Schematron = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Schematron = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_4lxml_5etree_Schematron = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"lxml.etree.Schematron", /*tp_name*/
sizeof(struct __pyx_obj_4lxml_5etree_Schematron), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_4lxml_5etree_Schematron, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number_Schematron, /*tp_as_number*/
&__pyx_tp_as_sequence_Schematron, /*tp_as_sequence*/
&__pyx_tp_as_mapping_Schematron, /*tp_as_mapping*/
0, /*tp_hash*/
__pyx_pf_4lxml_5etree_10Schematron___call__, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer_Schematron, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
"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    ", /*tp_doc*/
__pyx_tp_traverse_4lxml_5etree_Schematron, /*tp_traverse*/
__pyx_tp_clear_4lxml_5etree_Schematron, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_4lxml_5etree_Schematron, /*tp_methods*/
0, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_pf_4lxml_5etree_10Schematron___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_4lxml_5etree_Schematron, /*tp_new*/
0, /*tp_free*/
0, /*tp_is_gc*/
0, /*tp_bases*/
0, /*tp_mro*/
0, /*tp_cache*/
0, /*tp_subclasses*/
0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
{"_superError", (PyCFunction)__pyx_pf_4lxml_5etree__superError, METH_VARARGS|METH_KEYWORDS, 0},
{"Element", (PyCFunction)__pyx_pf_4lxml_5etree_Element, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_Element},
{"Comment", (PyCFunction)__pyx_pf_4lxml_5etree_Comment, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_Comment},
{"ProcessingInstruction", (PyCFunction)__pyx_pf_4lxml_5etree_ProcessingInstruction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_ProcessingInstruction},
{"Entity", (PyCFunction)__pyx_pf_4lxml_5etree_Entity, METH_O, __pyx_doc_4lxml_5etree_Entity},
{"SubElement", (PyCFunction)__pyx_pf_4lxml_5etree_SubElement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_SubElement},
{"ElementTree", (PyCFunction)__pyx_pf_4lxml_5etree_ElementTree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_ElementTree},
{"HTML", (PyCFunction)__pyx_pf_4lxml_5etree_HTML, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_HTML},
{"XML", (PyCFunction)__pyx_pf_4lxml_5etree_XML, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_XML},
{"fromstring", (PyCFunction)__pyx_pf_4lxml_5etree_fromstring, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_fromstring},
{"fromstringlist", (PyCFunction)__pyx_pf_4lxml_5etree_fromstringlist, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_fromstringlist},
{"iselement", (PyCFunction)__pyx_pf_4lxml_5etree_iselement, METH_O, __pyx_doc_4lxml_5etree_iselement},
{"dump", (PyCFunction)__pyx_pf_4lxml_5etree_dump, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_dump},
{"tostring", (PyCFunction)__pyx_pf_4lxml_5etree_tostring, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_tostring},
{"tostringlist", (PyCFunction)__pyx_pf_4lxml_5etree_tostringlist, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_tostringlist},
{"tounicode", (PyCFunction)__pyx_pf_4lxml_5etree_tounicode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_tounicode},
{"parse", (PyCFunction)__pyx_pf_4lxml_5etree_parse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_parse},
{"clearErrorLog", (PyCFunction)__pyx_pf_4lxml_5etree_clearErrorLog, METH_NOARGS, __pyx_doc_4lxml_5etree_clearErrorLog},
{"useGlobalPythonLog", (PyCFunction)__pyx_pf_4lxml_5etree_useGlobalPythonLog, METH_O, __pyx_doc_4lxml_5etree_useGlobalPythonLog},
{"setElementClassLookup", (PyCFunction)__pyx_pf_4lxml_5etree_setElementClassLookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_setElementClassLookup},
{"set_element_class_lookup", (PyCFunction)__pyx_pf_4lxml_5etree_set_element_class_lookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_set_element_class_lookup},
{"FunctionNamespace", (PyCFunction)__pyx_pf_4lxml_5etree_FunctionNamespace, METH_O, __pyx_doc_4lxml_5etree_FunctionNamespace},
{"setDefaultParser", (PyCFunction)__pyx_pf_4lxml_5etree_setDefaultParser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_setDefaultParser},
{"getDefaultParser", (PyCFunction)__pyx_pf_4lxml_5etree_getDefaultParser, METH_NOARGS, __pyx_doc_4lxml_5etree_getDefaultParser},
{"set_default_parser", (PyCFunction)__pyx_pf_4lxml_5etree_set_default_parser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_set_default_parser},
{"get_default_parser", (PyCFunction)__pyx_pf_4lxml_5etree_get_default_parser, METH_NOARGS, 0},
{"XMLID", (PyCFunction)__pyx_pf_4lxml_5etree_XMLID, METH_O, __pyx_doc_4lxml_5etree_XMLID},
{"XMLDTDID", (PyCFunction)__pyx_pf_4lxml_5etree_XMLDTDID, METH_O, __pyx_doc_4lxml_5etree_XMLDTDID},
{"parseid", (PyCFunction)__pyx_pf_4lxml_5etree_parseid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_parseid},
{"Extension", (PyCFunction)__pyx_pf_4lxml_5etree_Extension, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_Extension},
{"XPathEvaluator", (PyCFunction)__pyx_pf_4lxml_5etree_XPathEvaluator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_4lxml_5etree_XPathEvaluator},
{0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

PyMODINIT_FUNC initetree(void); /*proto*/
PyMODINIT_FUNC initetree(void) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
PyObject *__pyx_8 = 0;
PyObject *__pyx_9 = 0;
PyObject *__pyx_10 = 0;
PyObject *__pyx_11 = 0;
PyObject *__pyx_12 = 0;
PyObject *__pyx_13 = 0;
/*--- Libary function declarations ---*/
__pyx_init_filenames();
/*--- Module creation code ---*/
__pyx_m = Py_InitModule4("etree", __pyx_methods, 0, 0, PYTHON_API_VERSION);
if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_b = PyImport_AddModule("__builtin__");
if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Intern code ---*/
__pyx_num_0 = PyInt_FromLong(0); if (unlikely(!__pyx_num_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_32768 = PyInt_FromLong(32768); if (unlikely(!__pyx_num_32768)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_4 = PyInt_FromLong(4); if (unlikely(!__pyx_num_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_neg_300 = PyInt_FromLong(-300); if (unlikely(!__pyx_num_neg_300)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_neg_200 = PyInt_FromLong(-200); if (unlikely(!__pyx_num_neg_200)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_neg_100 = PyInt_FromLong(-100); if (unlikely(!__pyx_num_neg_100)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_1 = PyInt_FromLong(1); if (unlikely(!__pyx_num_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_num_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
__pyx_num_2 = PyInt_FromLong(2); if (unlikely(!__pyx_num_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- String init code ---*/
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
/*--- Builtin init code ---*/
__pyx_builtin_AttributeError = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_builtin_AttributeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_builtin_Exception = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_builtin_Exception) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_builtin_SyntaxError = __Pyx_GetName(__pyx_b, __pyx_n_SyntaxError); if (!__pyx_builtin_SyntaxError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
__pyx_builtin_super = __Pyx_GetName(__pyx_b, __pyx_n_super); if (!__pyx_builtin_super) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; goto __pyx_L1;}
__pyx_builtin_IndexError = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 564; goto __pyx_L1;}
__pyx_builtin_TypeError = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; goto __pyx_L1;}
__pyx_builtin_id = __Pyx_GetName(__pyx_b, __pyx_n_id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 858; goto __pyx_L1;}
__pyx_builtin_FutureWarning = __Pyx_GetName(__pyx_b, __pyx_n_FutureWarning); if (!__pyx_builtin_FutureWarning) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; goto __pyx_L1;}
__pyx_builtin_KeyError = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_builtin_KeyError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1695; goto __pyx_L1;}
__pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_n_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1807; goto __pyx_L1;}
__pyx_builtin_UnicodeDecodeError = __Pyx_GetName(__pyx_b, __pyx_n_UnicodeDecodeError); if (!__pyx_builtin_UnicodeDecodeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1002; goto __pyx_L1;}
__pyx_builtin_IOError = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_builtin_IOError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; goto __pyx_L1;}
__pyx_builtin_LookupError = __Pyx_GetName(__pyx_b, __pyx_n_LookupError); if (!__pyx_builtin_LookupError) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 570; goto __pyx_L1;}
__pyx_builtin_open = __Pyx_GetName(__pyx_b, __pyx_n_open); if (!__pyx_builtin_open) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 330; goto __pyx_L1;}
__pyx_builtin_NotImplementedError = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_builtin_NotImplementedError) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 496; goto __pyx_L1;}
__pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 376; goto __pyx_L1;}
__pyx_builtin_AssertionError = __Pyx_GetName(__pyx_b, __pyx_n_AssertionError); if (!__pyx_builtin_AssertionError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2361; goto __pyx_L1;}
/*--- Global init code ---*/
__pyx_v_4lxml_5etree_set = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_os_path_join = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__elementpath = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_sys = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_re = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_ITER_EMPTY = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__FILENAME_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__LxmlError = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__initError = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___RE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___HAS_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___ERROR_LEVELS = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___ERROR_DOMAINS = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___ERROR_TYPES = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_4lxml_5etree_XMLParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_4lxml_5etree_inspect_getargspec = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__find_id_attributes = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__replace_strings = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__find_namespaces = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__RE_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__FIND_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree__REPLACE_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)Py_None); Py_INCREF(Py_None);
/*--- Function export code ---*/
if (__Pyx_ExportFunction("deepcopyNodeToDocument", (void*)deepcopyNodeToDocument, "struct LxmlElement *(struct LxmlDocument *,xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("elementTreeFactory", (void*)elementTreeFactory, "struct LxmlElementTree *(struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("newElementTree", (void*)newElementTree, "struct LxmlElementTree *(struct LxmlElement *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("elementFactory", (void*)elementFactory, "struct LxmlElement *(struct LxmlDocument *,xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("makeElement", (void*)makeElement, "struct LxmlElement *(PyObject *,struct LxmlDocument *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("makeSubElement", (void*)makeSubElement, "struct LxmlElement *(struct LxmlElement *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("setElementClassLookupFunction", (void*)setElementClassLookupFunction, "void (_element_class_lookup_function,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("lookupDefaultElementClass", (void*)lookupDefaultElementClass, "PyObject *(PyObject *,PyObject *,xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("lookupNamespaceElementClass", (void*)lookupNamespaceElementClass, "PyObject *(PyObject *,PyObject *,xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("callLookupFallback", (void*)callLookupFallback, "PyObject *(struct LxmlFallbackElementClassLookup *,struct LxmlDocument *,xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("tagMatches", (void*)tagMatches, "int (xmlNode *,char *,char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("documentOrRaise", (void*)documentOrRaise, "struct LxmlDocument *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("rootNodeOrRaise", (void*)rootNodeOrRaise, "struct LxmlElement *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("hasText", (void*)hasText, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("hasTail", (void*)hasTail, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("textOf", (void*)textOf, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("tailOf", (void*)tailOf, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("setNodeText", (void*)setNodeText, "int (xmlNode *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("setTailText", (void*)setTailText, "int (xmlNode *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("attributeValue", (void*)attributeValue, "PyObject *(xmlNode *,xmlAttr *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("attributeValueFromNsName", (void*)attributeValueFromNsName, "PyObject *(xmlNode *,char *,char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("getAttributeValue", (void*)getAttributeValue, "PyObject *(struct LxmlElement *,PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("iterattributes", (void*)iterattributes, "PyObject *(struct LxmlElement *,int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("collectAttributes", (void*)collectAttributes, "PyObject *(xmlNode *,int)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("setAttributeValue", (void*)setAttributeValue, "int (struct LxmlElement *,PyObject *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("delAttribute", (void*)delAttribute, "int (struct LxmlElement *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("delAttributeFromNsName", (void*)delAttributeFromNsName, "int (xmlNode *,char *,char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("hasChild", (void*)hasChild, "int (xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("findChild", (void*)findChild, "xmlNode *(xmlNode *,Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("findChildForwards", (void*)findChildForwards, "xmlNode *(xmlNode *,Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("findChildBackwards", (void*)findChildBackwards, "xmlNode *(xmlNode *,Py_ssize_t)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("nextElement", (void*)nextElement, "xmlNode *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("previousElement", (void*)previousElement, "xmlNode *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("appendChild", (void*)appendChild, "void (struct LxmlElement *,struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("pyunicode", (void*)pyunicode, "PyObject *(char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("utf8", (void*)utf8, "PyObject *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("getNsTag", (void*)getNsTag, "PyObject *(PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("namespacedName", (void*)namespacedName, "PyObject *(xmlNode *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("namespacedNameFromNsName", (void*)namespacedNameFromNsName, "PyObject *(char *,char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("iteratorStoreNext", (void*)iteratorStoreNext, "void (struct LxmlElementIterator *,struct LxmlElement *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("initTagMatch", (void*)initTagMatch, "void (struct LxmlElementTagMatcher *,PyObject *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
if (__Pyx_ExportFunction("findOrBuildNodeNsPrefix", (void*)findOrBuildNodeNsPrefix, "xmlNs *(struct LxmlDocument *,xmlNode *,char *,char *)") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
/*--- Function import code ---*/
/*--- Type init code ---*/
__pyx_vtabptr_4lxml_5etree__TempStore = &__pyx_vtable_4lxml_5etree__TempStore;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TempStore.add = (void(*)(void))__pyx_f_4lxml_5etree_10_TempStore_add;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TempStore.clear = (void(*)(void))__pyx_f_4lxml_5etree_10_TempStore_clear;
__pyx_type_4lxml_5etree__TempStore.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TempStore.tp_dict, __pyx_vtabptr_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_TempStore", (PyObject *)&__pyx_type_4lxml_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__TempStore = &__pyx_type_4lxml_5etree__TempStore;
__pyx_vtabptr_4lxml_5etree__ExceptionContext = &__pyx_vtable_4lxml_5etree__ExceptionContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext.clear = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext_clear;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._store_raised = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__store_raised;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._store_exception = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__store_exception;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._has_raised = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__has_raised;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExceptionContext._raise_if_stored = (void(*)(void))__pyx_f_4lxml_5etree_17_ExceptionContext__raise_if_stored;
__pyx_type_4lxml_5etree__ExceptionContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExceptionContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ExceptionContext", (PyObject *)&__pyx_type_4lxml_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ExceptionContext = &__pyx_type_4lxml_5etree__ExceptionContext;
__pyx_type_4lxml_5etree_QName.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "QName", (PyObject *)&__pyx_type_4lxml_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_QName = &__pyx_type_4lxml_5etree_QName;
__pyx_vtabptr_4lxml_5etree__BaseParser = &__pyx_vtable_4lxml_5etree__BaseParser;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._getParserContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__getParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._getPushParserContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__getPushParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._createContext = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__createContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._newParserCtxt = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__newParserCtxt;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._newPushParserCtxt = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__newPushParserCtxt;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._copy = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__copy;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseUnicodeDoc = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseUnicodeDoc;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDoc = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDoc;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFile = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFile;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseParser._parseDocFromFilelike = (void(*)(void))__pyx_f_4lxml_5etree_11_BaseParser__parseDocFromFilelike;
__pyx_type_4lxml_5etree__BaseParser.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseParser.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseParser", (PyObject *)&__pyx_type_4lxml_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__BaseParser = &__pyx_type_4lxml_5etree__BaseParser;
__pyx_vtabptr_4lxml_5etree__Document = &__pyx_vtable_4lxml_5etree__Document;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getroot = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getroot;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getdoctype = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getdoctype;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getxmlinfo = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getxmlinfo;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.getURL = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_getURL;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document.buildNewPrefix = (void(*)(void))__pyx_f_4lxml_5etree_9_Document_buildNewPrefix;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document._findOrBuildNodeNs = (void(*)(void))__pyx_f_4lxml_5etree_9_Document__findOrBuildNodeNs;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document._setNodeNs = (void(*)(void))__pyx_f_4lxml_5etree_9_Document__setNodeNs;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__Document._setNodeNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_9_Document__setNodeNamespaces;
LxmlDocumentType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlDocumentType.tp_dict, __pyx_vtabptr_4lxml_5etree__Document) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 256; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Document = &LxmlDocumentType;
__pyx_type_4lxml_5etree_DocInfo.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "DocInfo", (PyObject *)&__pyx_type_4lxml_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_DocInfo = &__pyx_type_4lxml_5etree_DocInfo;
LxmlElementType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Element = &LxmlElementType;
__pyx_vtabptr_4lxml_5etree___ContentOnlyElement = &__pyx_vtable_4lxml_5etree___ContentOnlyElement;
*(void(**)(void))&__pyx_vtable_4lxml_5etree___ContentOnlyElement._raiseImmutable = (void(*)(void))__pyx_f_4lxml_5etree_20__ContentOnlyElement__raiseImmutable;
__pyx_type_4lxml_5etree___ContentOnlyElement.tp_base = __pyx_ptype_4lxml_5etree__Element;
if (PyType_Ready(&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree___ContentOnlyElement.tp_dict, __pyx_vtabptr_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "__ContentOnlyElement", (PyObject *)&__pyx_type_4lxml_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1249; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree___ContentOnlyElement = &__pyx_type_4lxml_5etree___ContentOnlyElement;
__pyx_vtabptr_4lxml_5etree__Comment = &__pyx_vtable_4lxml_5etree__Comment;
__pyx_vtable_4lxml_5etree__Comment.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
__pyx_type_4lxml_5etree__Comment.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
if (PyType_Ready(&__pyx_type_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Comment.tp_dict, __pyx_vtabptr_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Comment", (PyObject *)&__pyx_type_4lxml_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Comment = &__pyx_type_4lxml_5etree__Comment;
__pyx_vtabptr_4lxml_5etree__ProcessingInstruction = &__pyx_vtable_4lxml_5etree__ProcessingInstruction;
__pyx_vtable_4lxml_5etree__ProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
__pyx_type_4lxml_5etree__ProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ProcessingInstruction = &__pyx_type_4lxml_5etree__ProcessingInstruction;
__pyx_vtabptr_4lxml_5etree__Entity = &__pyx_vtable_4lxml_5etree__Entity;
__pyx_vtable_4lxml_5etree__Entity.__pyx_base = *__pyx_vtabptr_4lxml_5etree___ContentOnlyElement;
__pyx_type_4lxml_5etree__Entity.tp_base = __pyx_ptype_4lxml_5etree___ContentOnlyElement;
if (PyType_Ready(&__pyx_type_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__Entity.tp_dict, __pyx_vtabptr_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Entity", (PyObject *)&__pyx_type_4lxml_5etree__Entity) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1341; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Entity = &__pyx_type_4lxml_5etree__Entity;
__pyx_vtabptr_4lxml_5etree__ElementTree = &__pyx_vtable_4lxml_5etree__ElementTree;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementTree._assertHasRoot = (void(*)(void))__pyx_f_4lxml_5etree_12_ElementTree__assertHasRoot;
LxmlElementTreeType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementTreeType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementTree", (PyObject *)&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1360; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ElementTree = &LxmlElementTreeType;
__pyx_type_4lxml_5etree__Attrib.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Attrib", (PyObject *)&__pyx_type_4lxml_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1670; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Attrib = &__pyx_type_4lxml_5etree__Attrib;
__pyx_type_4lxml_5etree__AttribIterator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_AttribIterator", (PyObject *)&__pyx_type_4lxml_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1794; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__AttribIterator = &__pyx_type_4lxml_5etree__AttribIterator;
__pyx_vtabptr_4lxml_5etree__ElementTagMatcher = &__pyx_vtable_4lxml_5etree__ElementTagMatcher;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementTagMatcher._initTagMatch = (void(*)(void))__pyx_f_4lxml_5etree_18_ElementTagMatcher__initTagMatch;
LxmlElementTagMatcherType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementTagMatcherType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementTagMatcher) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementTagMatcher", (PyObject *)&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1835; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ElementTagMatcher = &LxmlElementTagMatcherType;
__pyx_vtabptr_4lxml_5etree__ElementIterator = &__pyx_vtable_4lxml_5etree__ElementIterator;
__pyx_vtable_4lxml_5etree__ElementIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ElementIterator._storeNext = (void(*)(void))__pyx_f_4lxml_5etree_16_ElementIterator__storeNext;
LxmlElementIteratorType.tp_base = __pyx_ptype_4lxml_5etree__ElementTagMatcher;
LxmlElementIteratorType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementIteratorType.tp_dict, __pyx_vtabptr_4lxml_5etree__ElementIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementIterator", (PyObject *)&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1863; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ElementIterator = &LxmlElementIteratorType;
__pyx_vtabptr_4lxml_5etree_ElementChildIterator = &__pyx_vtable_4lxml_5etree_ElementChildIterator;
__pyx_vtable_4lxml_5etree_ElementChildIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
__pyx_type_4lxml_5etree_ElementChildIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementChildIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementChildIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1895; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementChildIterator = &__pyx_type_4lxml_5etree_ElementChildIterator;
__pyx_vtabptr_4lxml_5etree_SiblingsIterator = &__pyx_vtable_4lxml_5etree_SiblingsIterator;
__pyx_vtable_4lxml_5etree_SiblingsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
__pyx_type_4lxml_5etree_SiblingsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_SiblingsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "SiblingsIterator", (PyObject *)&__pyx_type_4lxml_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1916; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_SiblingsIterator = &__pyx_type_4lxml_5etree_SiblingsIterator;
__pyx_vtabptr_4lxml_5etree_AncestorsIterator = &__pyx_vtable_4lxml_5etree_AncestorsIterator;
__pyx_vtable_4lxml_5etree_AncestorsIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementIterator;
__pyx_type_4lxml_5etree_AncestorsIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AncestorsIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "AncestorsIterator", (PyObject *)&__pyx_type_4lxml_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1929; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_AncestorsIterator = &__pyx_type_4lxml_5etree_AncestorsIterator;
__pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator = &__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator;
__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTagMatcher;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeAnyTag = (void(*)(void))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeAnyTag;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_ElementDepthFirstIterator._nextNodeMatchTag = (void(*)(void))__pyx_f_4lxml_5etree_25ElementDepthFirstIterator__nextNodeMatchTag;
__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_base = __pyx_ptype_4lxml_5etree__ElementTagMatcher;
__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementDepthFirstIterator.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementDepthFirstIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1936; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementDepthFirstIterator = &__pyx_type_4lxml_5etree_ElementDepthFirstIterator;
__pyx_type_4lxml_5etree_ElementTextIterator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementTextIterator", (PyObject *)&__pyx_type_4lxml_5etree_ElementTextIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2003; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementTextIterator = &__pyx_type_4lxml_5etree_ElementTextIterator;
__pyx_vtabptr_4lxml_5etree__LogEntry = &__pyx_vtable_4lxml_5etree__LogEntry;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__LogEntry._setError = (void(*)(void))__pyx_f_4lxml_5etree_9_LogEntry__setError;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__LogEntry._setGeneric = (void(*)(void))__pyx_f_4lxml_5etree_9_LogEntry__setGeneric;
__pyx_type_4lxml_5etree__LogEntry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__LogEntry.tp_dict, __pyx_vtabptr_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_LogEntry", (PyObject *)&__pyx_type_4lxml_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 35; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__LogEntry = &__pyx_type_4lxml_5etree__LogEntry;
__pyx_vtabptr_4lxml_5etree__BaseErrorLog = &__pyx_vtable_4lxml_5etree__BaseErrorLog;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._receive = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__receive;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._receiveGeneric = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__receiveGeneric;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._buildParseException = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildParseException;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseErrorLog._buildExceptionMessage = (void(*)(void))__pyx_f_4lxml_5etree_13_BaseErrorLog__buildExceptionMessage;
__pyx_type_4lxml_5etree__BaseErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 87; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__BaseErrorLog = &__pyx_type_4lxml_5etree__BaseErrorLog;
__pyx_vtabptr_4lxml_5etree__ListErrorLog = &__pyx_vtable_4lxml_5etree__ListErrorLog;
__pyx_vtable_4lxml_5etree__ListErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;
__pyx_type_4lxml_5etree__ListErrorLog.tp_base = __pyx_ptype_4lxml_5etree__BaseErrorLog;
__pyx_type_4lxml_5etree__ListErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ListErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ListErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 170; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ListErrorLog = &__pyx_type_4lxml_5etree__ListErrorLog;
__pyx_vtabptr_4lxml_5etree__ErrorLog = &__pyx_vtable_4lxml_5etree__ErrorLog;
__pyx_vtable_4lxml_5etree__ErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ListErrorLog;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ErrorLog.connect = (void(*)(void))__pyx_f_4lxml_5etree_9_ErrorLog_connect;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ErrorLog.disconnect = (void(*)(void))__pyx_f_4lxml_5etree_9_ErrorLog_disconnect;
__pyx_type_4lxml_5etree__ErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ListErrorLog;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ErrorLog = &__pyx_type_4lxml_5etree__ErrorLog;
__pyx_vtabptr_4lxml_5etree__DomainErrorLog = &__pyx_vtable_4lxml_5etree__DomainErrorLog;
__pyx_vtable_4lxml_5etree__DomainErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ErrorLog;
__pyx_type_4lxml_5etree__DomainErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ErrorLog;
if (PyType_Ready(&__pyx_type_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__DomainErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_DomainErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 304; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__DomainErrorLog = &__pyx_type_4lxml_5etree__DomainErrorLog;
__pyx_vtabptr_4lxml_5etree__RotatingErrorLog = &__pyx_vtable_4lxml_5etree__RotatingErrorLog;
__pyx_vtable_4lxml_5etree__RotatingErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ErrorLog;
__pyx_type_4lxml_5etree__RotatingErrorLog.tp_base = __pyx_ptype_4lxml_5etree__ErrorLog;
if (PyType_Ready(&__pyx_type_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__RotatingErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_RotatingErrorLog", (PyObject *)&__pyx_type_4lxml_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 313; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__RotatingErrorLog = &__pyx_type_4lxml_5etree__RotatingErrorLog;
__pyx_vtabptr_4lxml_5etree_PyErrorLog = &__pyx_vtable_4lxml_5etree_PyErrorLog;
__pyx_vtable_4lxml_5etree_PyErrorLog.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseErrorLog;
__pyx_type_4lxml_5etree_PyErrorLog.tp_base = __pyx_ptype_4lxml_5etree__BaseErrorLog;
__pyx_type_4lxml_5etree_PyErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 325; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PyErrorLog.tp_dict, __pyx_vtabptr_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 325; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PyErrorLog", (PyObject *)&__pyx_type_4lxml_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 325; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_PyErrorLog = &__pyx_type_4lxml_5etree_PyErrorLog;
LxmlElementBaseType.tp_base = __pyx_ptype_4lxml_5etree__Element;
if (PyType_Ready(&LxmlElementBaseType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 6; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementBase", (PyObject *)&LxmlElementBaseType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementBase = &LxmlElementBaseType;
__pyx_vtabptr_4lxml_5etree_CommentBase = &__pyx_vtable_4lxml_5etree_CommentBase;
__pyx_vtable_4lxml_5etree_CommentBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Comment;
__pyx_type_4lxml_5etree_CommentBase.tp_base = __pyx_ptype_4lxml_5etree__Comment;
if (PyType_Ready(&__pyx_type_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CommentBase.tp_dict, __pyx_vtabptr_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "CommentBase", (PyObject *)&__pyx_type_4lxml_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_CommentBase = &__pyx_type_4lxml_5etree_CommentBase;
__pyx_vtabptr_4lxml_5etree_PIBase = &__pyx_vtable_4lxml_5etree_PIBase;
__pyx_vtable_4lxml_5etree_PIBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ProcessingInstruction;
__pyx_type_4lxml_5etree_PIBase.tp_base = __pyx_ptype_4lxml_5etree__ProcessingInstruction;
if (PyType_Ready(&__pyx_type_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_PIBase.tp_dict, __pyx_vtabptr_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PIBase", (PyObject *)&__pyx_type_4lxml_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_PIBase = &__pyx_type_4lxml_5etree_PIBase;
__pyx_vtabptr_4lxml_5etree_EntityBase = &__pyx_vtable_4lxml_5etree_EntityBase;
__pyx_vtable_4lxml_5etree_EntityBase.__pyx_base = *__pyx_vtabptr_4lxml_5etree__Entity;
__pyx_type_4lxml_5etree_EntityBase.tp_base = __pyx_ptype_4lxml_5etree__Entity;
if (PyType_Ready(&__pyx_type_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_EntityBase.tp_dict, __pyx_vtabptr_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "EntityBase", (PyObject *)&__pyx_type_4lxml_5etree_EntityBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 37; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_EntityBase = &__pyx_type_4lxml_5etree_EntityBase;
if (PyType_Ready(&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 54; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementClassLookup", (PyObject *)&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 54; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementClassLookup = &LxmlElementClassLookupType;
__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup = &__pyx_vtable_4lxml_5etree_FallbackElementClassLookup;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_FallbackElementClassLookup._callFallback = (void(*)(void))__pyx_f_4lxml_5etree_26FallbackElementClassLookup__callFallback;
LxmlFallbackElementClassLookupType.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
LxmlFallbackElementClassLookupType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "FallbackElementClassLookup", (PyObject *)&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_FallbackElementClassLookup = &LxmlFallbackElementClassLookupType;
__pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_base = __pyx_ptype_4lxml_5etree_ElementClassLookup;
__pyx_type_4lxml_5etree_ElementDefaultClassLookup.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 91; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementDefaultClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 91; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementDefaultClassLookup = &__pyx_type_4lxml_5etree_ElementDefaultClassLookup;
__pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup;
__pyx_vtable_4lxml_5etree_AttributeBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "AttributeBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 171; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_AttributeBasedElementClassLookup = &__pyx_type_4lxml_5etree_AttributeBasedElementClassLookup;
__pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup;
__pyx_vtable_4lxml_5etree_ParserBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ParserBasedElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 215; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup = &__pyx_type_4lxml_5etree_ParserBasedElementClassLookup;
__pyx_vtabptr_4lxml_5etree_CustomElementClassLookup = &__pyx_vtable_4lxml_5etree_CustomElementClassLookup;
__pyx_vtable_4lxml_5etree_CustomElementClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
if (PyType_Ready(&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 231; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 231; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "CustomElementClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 231; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_CustomElementClassLookup = &__pyx_type_4lxml_5etree_CustomElementClassLookup;
__pyx_vtabptr_4lxml_5etree__NamespaceRegistry = &__pyx_vtable_4lxml_5etree__NamespaceRegistry;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__NamespaceRegistry._get = (void(*)(void))__pyx_f_4lxml_5etree_18_NamespaceRegistry__get;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__NamespaceRegistry._getForString = (void(*)(void))__pyx_f_4lxml_5etree_18_NamespaceRegistry__getForString;
__pyx_type_4lxml_5etree__NamespaceRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__NamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_NamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__NamespaceRegistry = &__pyx_type_4lxml_5etree__NamespaceRegistry;
__pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry = &__pyx_vtable_4lxml_5etree__ClassNamespaceRegistry;
__pyx_vtable_4lxml_5etree__ClassNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
__pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ClassNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ClassNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 77; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ClassNamespaceRegistry = &__pyx_type_4lxml_5etree__ClassNamespaceRegistry;
__pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup;
__pyx_vtable_4lxml_5etree_ElementNamespaceClassLookup.__pyx_base = *__pyx_vtabptr_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_base = __pyx_ptype_4lxml_5etree_FallbackElementClassLookup;
__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 91; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ElementNamespaceClassLookup.tp_dict, __pyx_vtabptr_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 91; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementNamespaceClassLookup", (PyObject *)&__pyx_type_4lxml_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 91; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ElementNamespaceClassLookup = &__pyx_type_4lxml_5etree_ElementNamespaceClassLookup;
__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry;
__pyx_vtable_4lxml_5etree__FunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__NamespaceRegistry;
__pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__NamespaceRegistry;
if (PyType_Ready(&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FunctionNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 173; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__FunctionNamespaceRegistry;
__pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry;
__pyx_vtable_4lxml_5etree__XPathFunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FunctionNamespaceRegistry;
__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_base = __pyx_ptype_4lxml_5etree__FunctionNamespaceRegistry;
__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathFunctionNamespaceRegistry", (PyObject *)&__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 186; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XPathFunctionNamespaceRegistry = &__pyx_type_4lxml_5etree__XPathFunctionNamespaceRegistry;
__pyx_type_4lxml_5etree__InputDocument.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_InputDocument", (PyObject *)&__pyx_type_4lxml_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__InputDocument = &__pyx_type_4lxml_5etree__InputDocument;
if (PyType_Ready(&__pyx_type_4lxml_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "Resolver", (PyObject *)&__pyx_type_4lxml_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 15; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_Resolver = &__pyx_type_4lxml_5etree_Resolver;
__pyx_vtabptr_4lxml_5etree__ResolverRegistry = &__pyx_vtable_4lxml_5etree__ResolverRegistry;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ResolverRegistry._copy = (void(*)(void))__pyx_f_4lxml_5etree_17_ResolverRegistry__copy;
__pyx_type_4lxml_5etree__ResolverRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 78; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ResolverRegistry.tp_dict, __pyx_vtabptr_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 78; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ResolverRegistry", (PyObject *)&__pyx_type_4lxml_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 78; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ResolverRegistry = &__pyx_type_4lxml_5etree__ResolverRegistry;
__pyx_vtabptr_4lxml_5etree__ResolverContext = &__pyx_vtable_4lxml_5etree__ResolverContext;
__pyx_vtable_4lxml_5etree__ResolverContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ExceptionContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ResolverContext.__pyx_base.clear = (void(*)(void))__pyx_f_4lxml_5etree_16_ResolverContext_clear;
__pyx_type_4lxml_5etree__ResolverContext.tp_base = __pyx_ptype_4lxml_5etree__ExceptionContext;
__pyx_type_4lxml_5etree__ResolverContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ResolverContext", (PyObject *)&__pyx_type_4lxml_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 120; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ResolverContext = &__pyx_type_4lxml_5etree__ResolverContext;
__pyx_vtabptr_4lxml_5etree__ParserDictionaryContext = &__pyx_vtable_4lxml_5etree__ParserDictionaryContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initMainParserContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initMainParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext._findThreadParserContext = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__findThreadParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.setDefaultParser = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_setDefaultParser;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.getDefaultParser = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_getDefaultParser;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext._getThreadDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext__getThreadDict;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initThreadDictRef = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initThreadDictRef;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initParserDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initParserDict;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initXPathParserDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initXPathParserDict;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserDictionaryContext.initDocDict = (void(*)(void))__pyx_f_4lxml_5etree_24_ParserDictionaryContext_initDocDict;
__pyx_type_4lxml_5etree__ParserDictionaryContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ParserDictionaryContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ParserDictionaryContext", (PyObject *)&__pyx_type_4lxml_5etree__ParserDictionaryContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 26; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ParserDictionaryContext = &__pyx_type_4lxml_5etree__ParserDictionaryContext;
__pyx_vtabptr_4lxml_5etree__FileReaderContext = &__pyx_vtable_4lxml_5etree__FileReaderContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._createParserInput = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__createParserInput;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._readDoc = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__readDoc;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext._readDtd = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext__readDtd;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FileReaderContext.copyToBuffer = (void(*)(void))__pyx_f_4lxml_5etree_18_FileReaderContext_copyToBuffer;
__pyx_type_4lxml_5etree__FileReaderContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FileReaderContext.tp_dict, __pyx_vtabptr_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FileReaderContext", (PyObject *)&__pyx_type_4lxml_5etree__FileReaderContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 205; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__FileReaderContext = &__pyx_type_4lxml_5etree__FileReaderContext;
__pyx_vtabptr_4lxml_5etree__ParserContext = &__pyx_vtable_4lxml_5etree__ParserContext;
__pyx_vtable_4lxml_5etree__ParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ResolverContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__copy;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__initParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._resetParserContext = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__resetParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext.prepare = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext_prepare;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext.cleanup = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext_cleanup;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._handleParseResult = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResult;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ParserContext._handleParseResultDoc = (void(*)(void))__pyx_f_4lxml_5etree_14_ParserContext__handleParseResultDoc;
__pyx_type_4lxml_5etree__ParserContext.tp_base = __pyx_ptype_4lxml_5etree__ResolverContext;
__pyx_type_4lxml_5etree__ParserContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ParserContext", (PyObject *)&__pyx_type_4lxml_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ParserContext = &__pyx_type_4lxml_5etree__ParserContext;
__pyx_vtabptr_4lxml_5etree__SaxParserContext = &__pyx_vtable_4lxml_5etree__SaxParserContext;
__pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext.__pyx_base._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__initParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext._setSaxParserTarget = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__setSaxParserTarget;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserContext._handleSaxException = (void(*)(void))__pyx_f_4lxml_5etree_17_SaxParserContext__handleSaxException;
__pyx_type_4lxml_5etree__SaxParserContext.tp_base = __pyx_ptype_4lxml_5etree__ParserContext;
__pyx_type_4lxml_5etree__SaxParserContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1012; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1012; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_SaxParserContext", (PyObject *)&__pyx_type_4lxml_5etree__SaxParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1012; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__SaxParserContext = &__pyx_type_4lxml_5etree__SaxParserContext;
__pyx_vtabptr_4lxml_5etree__TargetParserContext = &__pyx_vtable_4lxml_5etree__TargetParserContext;
__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._copy = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__copy;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResult = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResult;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext.__pyx_base.__pyx_base._handleParseResultDoc = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__handleParseResultDoc;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__TargetParserContext._setTarget = (void(*)(void))__pyx_f_4lxml_5etree_20_TargetParserContext__setTarget;
__pyx_type_4lxml_5etree__TargetParserContext.tp_base = __pyx_ptype_4lxml_5etree__SaxParserContext;
__pyx_type_4lxml_5etree__TargetParserContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 93; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__TargetParserContext.tp_dict, __pyx_vtabptr_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 93; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_TargetParserContext", (PyObject *)&__pyx_type_4lxml_5etree__TargetParserContext) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 93; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__TargetParserContext = &__pyx_type_4lxml_5etree__TargetParserContext;
__pyx_vtabptr_4lxml_5etree__FeedParser = &__pyx_vtable_4lxml_5etree__FeedParser;
__pyx_vtable_4lxml_5etree__FeedParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseParser;
__pyx_type_4lxml_5etree__FeedParser.tp_base = __pyx_ptype_4lxml_5etree__BaseParser;
if (PyType_Ready(&__pyx_type_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 830; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FeedParser.tp_dict, __pyx_vtabptr_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 830; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FeedParser", (PyObject *)&__pyx_type_4lxml_5etree__FeedParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 830; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__FeedParser = &__pyx_type_4lxml_5etree__FeedParser;
__pyx_vtabptr_4lxml_5etree__SaxParserTarget = &__pyx_vtable_4lxml_5etree__SaxParserTarget;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxStart;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxEnd;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxData;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxDoctype = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxDoctype;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxPi;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__SaxParserTarget._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_16_SaxParserTarget__handleSaxComment;
if (PyType_Ready(&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 996; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__SaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 996; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_SaxParserTarget", (PyObject *)&__pyx_type_4lxml_5etree__SaxParserTarget) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 996; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__SaxParserTarget = &__pyx_type_4lxml_5etree__SaxParserTarget;
__pyx_vtabptr_4lxml_5etree_TreeBuilder = &__pyx_vtable_4lxml_5etree_TreeBuilder;
__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxStart;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxEnd;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxData;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxPi;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder.__pyx_base._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__handleSaxComment;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_TreeBuilder._flush = (void(*)(void))__pyx_f_4lxml_5etree_11TreeBuilder__flush;
__pyx_type_4lxml_5etree_TreeBuilder.tp_base = __pyx_ptype_4lxml_5etree__SaxParserTarget;
__pyx_type_4lxml_5etree_TreeBuilder.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1286; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_TreeBuilder.tp_dict, __pyx_vtabptr_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1286; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "TreeBuilder", (PyObject *)&__pyx_type_4lxml_5etree_TreeBuilder) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1286; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_TreeBuilder = &__pyx_type_4lxml_5etree_TreeBuilder;
__pyx_vtabptr_4lxml_5etree_XMLParser = &__pyx_vtable_4lxml_5etree_XMLParser;
__pyx_vtable_4lxml_5etree_XMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FeedParser;
__pyx_type_4lxml_5etree_XMLParser.tp_base = __pyx_ptype_4lxml_5etree__FeedParser;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1415; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1415; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XMLParser", (PyObject *)&__pyx_type_4lxml_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1415; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XMLParser = &__pyx_type_4lxml_5etree_XMLParser;
__pyx_vtabptr_4lxml_5etree_ETCompatXMLParser = &__pyx_vtable_4lxml_5etree_ETCompatXMLParser;
__pyx_vtable_4lxml_5etree_ETCompatXMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XMLParser;
__pyx_type_4lxml_5etree_ETCompatXMLParser.tp_base = __pyx_ptype_4lxml_5etree_XMLParser;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1479; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ETCompatXMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1479; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ETCompatXMLParser", (PyObject *)&__pyx_type_4lxml_5etree_ETCompatXMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1479; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ETCompatXMLParser = &__pyx_type_4lxml_5etree_ETCompatXMLParser;
__pyx_vtabptr_4lxml_5etree_HTMLParser = &__pyx_vtable_4lxml_5etree_HTMLParser;
__pyx_vtable_4lxml_5etree_HTMLParser.__pyx_base = *__pyx_vtabptr_4lxml_5etree__FeedParser;
__pyx_type_4lxml_5etree_HTMLParser.tp_base = __pyx_ptype_4lxml_5etree__FeedParser;
if (PyType_Ready(&__pyx_type_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1548; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_HTMLParser.tp_dict, __pyx_vtabptr_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1548; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "HTMLParser", (PyObject *)&__pyx_type_4lxml_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1548; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_HTMLParser = &__pyx_type_4lxml_5etree_HTMLParser;
__pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget = &__pyx_vtable_4lxml_5etree__PythonSaxParserTarget;
__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base = *__pyx_vtabptr_4lxml_5etree__SaxParserTarget;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxStart = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxStart;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxEnd = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxEnd;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxData = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxData;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxDoctype = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxDoctype;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxPi = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxPi;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__PythonSaxParserTarget.__pyx_base._handleSaxComment = (void(*)(void))__pyx_f_4lxml_5etree_22_PythonSaxParserTarget__handleSaxComment;
__pyx_type_4lxml_5etree__PythonSaxParserTarget.tp_base = __pyx_ptype_4lxml_5etree__SaxParserTarget;
__pyx_type_4lxml_5etree__PythonSaxParserTarget.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 13; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__PythonSaxParserTarget.tp_dict, __pyx_vtabptr_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 13; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_PythonSaxParserTarget", (PyObject *)&__pyx_type_4lxml_5etree__PythonSaxParserTarget) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__PythonSaxParserTarget = &__pyx_type_4lxml_5etree__PythonSaxParserTarget;
__pyx_vtabptr_4lxml_5etree__FilelikeWriter = &__pyx_vtable_4lxml_5etree__FilelikeWriter;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter._createOutputBuffer = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter__createOutputBuffer;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter.write = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter_write;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__FilelikeWriter.close = (void(*)(void))__pyx_f_4lxml_5etree_15_FilelikeWriter_close;
__pyx_type_4lxml_5etree__FilelikeWriter.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 269; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__FilelikeWriter.tp_dict, __pyx_vtabptr_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 269; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FilelikeWriter", (PyObject *)&__pyx_type_4lxml_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 269; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__FilelikeWriter = &__pyx_type_4lxml_5etree__FilelikeWriter;
__pyx_vtabptr_4lxml_5etree__IterparseContext = &__pyx_vtable_4lxml_5etree__IterparseContext;
__pyx_vtable_4lxml_5etree__IterparseContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.__pyx_base._initParserContext = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext__initParserContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext._setEventFilter = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext__setEventFilter;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.startNode = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext_startNode;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IterparseContext.endNode = (void(*)(void))__pyx_f_4lxml_5etree_17_IterparseContext_endNode;
__pyx_type_4lxml_5etree__IterparseContext.tp_base = __pyx_ptype_4lxml_5etree__ParserContext;
__pyx_type_4lxml_5etree__IterparseContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 51; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IterparseContext.tp_dict, __pyx_vtabptr_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 51; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_IterparseContext", (PyObject *)&__pyx_type_4lxml_5etree__IterparseContext) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__IterparseContext = &__pyx_type_4lxml_5etree__IterparseContext;
__pyx_vtabptr_4lxml_5etree_iterparse = &__pyx_vtable_4lxml_5etree_iterparse;
__pyx_vtable_4lxml_5etree_iterparse.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseParser;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_iterparse.__pyx_base._createContext = (void(*)(void))__pyx_f_4lxml_5etree_9iterparse__createContext;
__pyx_type_4lxml_5etree_iterparse.tp_base = __pyx_ptype_4lxml_5etree__BaseParser;
__pyx_type_4lxml_5etree_iterparse.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 241; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_iterparse.tp_dict, __pyx_vtabptr_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 241; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "iterparse", (PyObject *)&__pyx_type_4lxml_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 241; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_iterparse = &__pyx_type_4lxml_5etree_iterparse;
__pyx_vtabptr_4lxml_5etree_iterwalk = &__pyx_vtable_4lxml_5etree_iterwalk;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._setTagFilter = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__setTagFilter;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._start_node = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__start_node;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_iterwalk._end_node = (void(*)(void))__pyx_f_4lxml_5etree_8iterwalk__end_node;
__pyx_type_4lxml_5etree_iterwalk.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 398; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_iterwalk.tp_dict, __pyx_vtabptr_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 398; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "iterwalk", (PyObject *)&__pyx_type_4lxml_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 398; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_iterwalk = &__pyx_type_4lxml_5etree_iterwalk;
__pyx_vtabptr_4lxml_5etree__IDDict = &__pyx_vtable_4lxml_5etree__IDDict;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IDDict._build_keys = (void(*)(void))__pyx_f_4lxml_5etree_7_IDDict__build_keys;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__IDDict._build_items = (void(*)(void))__pyx_f_4lxml_5etree_7_IDDict__build_items;
__pyx_type_4lxml_5etree__IDDict.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__IDDict.tp_dict, __pyx_vtabptr_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_IDDict", (PyObject *)&__pyx_type_4lxml_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__IDDict = &__pyx_type_4lxml_5etree__IDDict;
__pyx_vtabptr_4lxml_5etree__ExsltRegExp = &__pyx_vtable_4lxml_5etree__ExsltRegExp;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._make_string = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__make_string;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._compile = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__compile;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__ExsltRegExp._register_in_context = (void(*)(void))__pyx_f_4lxml_5etree_12_ExsltRegExp__register_in_context;
__pyx_type_4lxml_5etree__ExsltRegExp.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__ExsltRegExp.tp_dict, __pyx_vtabptr_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ExsltRegExp", (PyObject *)&__pyx_type_4lxml_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 356; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__ExsltRegExp = &__pyx_type_4lxml_5etree__ExsltRegExp;
__pyx_vtabptr_4lxml_5etree__BaseContext = &__pyx_vtable_4lxml_5etree__BaseContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__copy;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._to_utf = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__to_utf;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._set_xpath_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__set_xpath_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._register_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__register_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._cleanup_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__cleanup_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._release_context = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__release_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.addNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_addNamespace;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerNamespace;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerLocalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalNamespaces;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerGlobalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalNamespaces;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalNamespaces = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalNamespaces;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._unregisterNamespace = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__unregisterNamespace;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._addLocalExtensionFunction = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__addLocalExtensionFunction;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerGlobalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerGlobalFunctions;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.registerLocalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_registerLocalFunctions;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterAllFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterAllFunctions;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext.unregisterGlobalFunctions = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext_unregisterGlobalFunctions;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._find_cached_function = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__find_cached_function;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._release_temp_refs = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__release_temp_refs;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__BaseContext._hold = (void(*)(void))__pyx_f_4lxml_5etree_12_BaseContext__hold;
__pyx_type_4lxml_5etree__BaseContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__BaseContext.tp_dict, __pyx_vtabptr_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseContext", (PyObject *)&__pyx_type_4lxml_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 31; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__BaseContext = &__pyx_type_4lxml_5etree__BaseContext;
__pyx_vtabptr_4lxml_5etree__XPathContext = &__pyx_vtable_4lxml_5etree__XPathContext;
__pyx_vtable_4lxml_5etree__XPathContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.set_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_set_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.register_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_register_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.unregister_context = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_unregister_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.registerVariables = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_registerVariables;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext.registerVariable = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext_registerVariable;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext._registerVariable = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext__registerVariable;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathContext._setupDict = (void(*)(void))__pyx_f_4lxml_5etree_13_XPathContext__setupDict;
__pyx_type_4lxml_5etree__XPathContext.tp_base = __pyx_ptype_4lxml_5etree__BaseContext;
__pyx_type_4lxml_5etree__XPathContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 50; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 50; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathContext", (PyObject *)&__pyx_type_4lxml_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XPathContext = &__pyx_type_4lxml_5etree__XPathContext;
__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase = &__pyx_vtable_4lxml_5etree__XPathEvaluatorBase;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase.set_context = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase_set_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._checkAbsolutePath = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__checkAbsolutePath;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._lock = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__lock;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._unlock = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__unlock;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_parse_error = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_parse_error;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._raise_eval_error = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__raise_eval_error;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XPathEvaluatorBase._handle_result = (void(*)(void))__pyx_f_4lxml_5etree_19_XPathEvaluatorBase__handle_result;
__pyx_type_4lxml_5etree__XPathEvaluatorBase.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XPathEvaluatorBase.tp_dict, __pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathEvaluatorBase", (PyObject *)&__pyx_type_4lxml_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XPathEvaluatorBase = &__pyx_type_4lxml_5etree__XPathEvaluatorBase;
__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator = &__pyx_vtable_4lxml_5etree_XPathElementEvaluator;
__pyx_vtable_4lxml_5etree_XPathElementEvaluator.__pyx_base = *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
__pyx_type_4lxml_5etree_XPathElementEvaluator.tp_base = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase;
__pyx_type_4lxml_5etree_XPathElementEvaluator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 207; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPathElementEvaluator.tp_dict, __pyx_vtabptr_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 207; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPathElementEvaluator", (PyObject *)&__pyx_type_4lxml_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 207; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XPathElementEvaluator = &__pyx_type_4lxml_5etree_XPathElementEvaluator;
__pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator = &__pyx_vtable_4lxml_5etree_XPathDocumentEvaluator;
__pyx_vtable_4lxml_5etree_XPathDocumentEvaluator.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XPathElementEvaluator;
__pyx_type_4lxml_5etree_XPathDocumentEvaluator.tp_base = __pyx_ptype_4lxml_5etree_XPathElementEvaluator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 276; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPathDocumentEvaluator.tp_dict, __pyx_vtabptr_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 276; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPathDocumentEvaluator", (PyObject *)&__pyx_type_4lxml_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 276; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XPathDocumentEvaluator = &__pyx_type_4lxml_5etree_XPathDocumentEvaluator;
__pyx_vtabptr_4lxml_5etree_XPath = &__pyx_vtable_4lxml_5etree_XPath;
__pyx_vtable_4lxml_5etree_XPath.__pyx_base = *__pyx_vtabptr_4lxml_5etree__XPathEvaluatorBase;
__pyx_type_4lxml_5etree_XPath.tp_base = __pyx_ptype_4lxml_5etree__XPathEvaluatorBase;
__pyx_type_4lxml_5etree_XPath.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 347; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XPath.tp_dict, __pyx_vtabptr_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 347; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPath", (PyObject *)&__pyx_type_4lxml_5etree_XPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 347; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XPath = &__pyx_type_4lxml_5etree_XPath;
__pyx_vtabptr_4lxml_5etree_ETXPath = &__pyx_vtable_4lxml_5etree_ETXPath;
__pyx_vtable_4lxml_5etree_ETXPath.__pyx_base = *__pyx_vtabptr_4lxml_5etree_XPath;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_ETXPath._nsextract_path = (void(*)(void))__pyx_f_4lxml_5etree_7ETXPath__nsextract_path;
__pyx_type_4lxml_5etree_ETXPath.tp_base = __pyx_ptype_4lxml_5etree_XPath;
if (PyType_Ready(&__pyx_type_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 414; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_ETXPath.tp_dict, __pyx_vtabptr_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 414; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ETXPath", (PyObject *)&__pyx_type_4lxml_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 414; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_ETXPath = &__pyx_type_4lxml_5etree_ETXPath;
__pyx_vtabptr_4lxml_5etree__XSLTResolverContext = &__pyx_vtable_4lxml_5etree__XSLTResolverContext;
__pyx_vtable_4lxml_5etree__XSLTResolverContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ResolverContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTResolverContext._copy = (void(*)(void))__pyx_f_4lxml_5etree_20_XSLTResolverContext__copy;
__pyx_type_4lxml_5etree__XSLTResolverContext.tp_base = __pyx_ptype_4lxml_5etree__ResolverContext;
__pyx_type_4lxml_5etree__XSLTResolverContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 50; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResolverContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 50; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTResolverContext", (PyObject *)&__pyx_type_4lxml_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XSLTResolverContext = &__pyx_type_4lxml_5etree__XSLTResolverContext;
__pyx_vtabptr_4lxml_5etree_XSLTAccessControl = &__pyx_vtable_4lxml_5etree_XSLTAccessControl;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLTAccessControl._setAccess = (void(*)(void))__pyx_f_4lxml_5etree_17XSLTAccessControl__setAccess;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLTAccessControl._register_in_context = (void(*)(void))__pyx_f_4lxml_5etree_17XSLTAccessControl__register_in_context;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 169; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLTAccessControl.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 169; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XSLTAccessControl", (PyObject *)&__pyx_type_4lxml_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 169; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XSLTAccessControl = &__pyx_type_4lxml_5etree_XSLTAccessControl;
__pyx_vtabptr_4lxml_5etree__XSLTContext = &__pyx_vtable_4lxml_5etree__XSLTContext;
__pyx_vtable_4lxml_5etree__XSLTContext.__pyx_base = *__pyx_vtabptr_4lxml_5etree__BaseContext;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTContext.register_context = (void(*)(void))__pyx_f_4lxml_5etree_12_XSLTContext_register_context;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTContext.free_context = (void(*)(void))__pyx_f_4lxml_5etree_12_XSLTContext_free_context;
__pyx_type_4lxml_5etree__XSLTContext.tp_base = __pyx_ptype_4lxml_5etree__BaseContext;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 226; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTContext.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 226; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTContext", (PyObject *)&__pyx_type_4lxml_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 226; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XSLTContext = &__pyx_type_4lxml_5etree__XSLTContext;
__pyx_vtabptr_4lxml_5etree_XSLT = &__pyx_vtable_4lxml_5etree_XSLT;
*(void(**)(void))&__pyx_vtable_4lxml_5etree_XSLT._run_transform = (void(*)(void))__pyx_f_4lxml_5etree_4XSLT__run_transform;
__pyx_type_4lxml_5etree_XSLT.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 254; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree_XSLT.tp_dict, __pyx_vtabptr_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 254; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XSLT", (PyObject *)&__pyx_type_4lxml_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 254; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XSLT = &__pyx_type_4lxml_5etree_XSLT;
__pyx_vtabptr_4lxml_5etree__XSLTResultTree = &__pyx_vtable_4lxml_5etree__XSLTResultTree;
__pyx_vtable_4lxml_5etree__XSLTResultTree.__pyx_base = *__pyx_vtabptr_4lxml_5etree__ElementTree;
*(void(**)(void))&__pyx_vtable_4lxml_5etree__XSLTResultTree._saveToStringAndSize = (void(*)(void))__pyx_f_4lxml_5etree_15_XSLTResultTree__saveToStringAndSize;
__pyx_type_4lxml_5etree__XSLTResultTree.tp_base = __pyx_ptype_4lxml_5etree__ElementTree;
__pyx_type_4lxml_5etree__XSLTResultTree.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 494; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTResultTree.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 494; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTResultTree", (PyObject *)&__pyx_type_4lxml_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 494; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XSLTResultTree = &__pyx_type_4lxml_5etree__XSLTResultTree;
__pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction = &__pyx_vtable_4lxml_5etree__XSLTProcessingInstruction;
__pyx_vtable_4lxml_5etree__XSLTProcessingInstruction.__pyx_base = *__pyx_vtabptr_4lxml_5etree_PIBase;
__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_base = __pyx_ptype_4lxml_5etree_PIBase;
if (PyType_Ready(&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 601; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_4lxml_5etree__XSLTProcessingInstruction.tp_dict, __pyx_vtabptr_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 601; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTProcessingInstruction", (PyObject *)&__pyx_type_4lxml_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 601; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__XSLTProcessingInstruction = &__pyx_type_4lxml_5etree__XSLTProcessingInstruction;
__pyx_type_4lxml_5etree__Validator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_4lxml_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Validator", (PyObject *)&__pyx_type_4lxml_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2340; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree__Validator = &__pyx_type_4lxml_5etree__Validator;
__pyx_type_4lxml_5etree_DTD.tp_base = __pyx_ptype_4lxml_5etree__Validator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_DTD) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 22; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "DTD", (PyObject *)&__pyx_type_4lxml_5etree_DTD) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_DTD = &__pyx_type_4lxml_5etree_DTD;
__pyx_type_4lxml_5etree_RelaxNG.tp_base = __pyx_ptype_4lxml_5etree__Validator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 22; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "RelaxNG", (PyObject *)&__pyx_type_4lxml_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_RelaxNG = &__pyx_type_4lxml_5etree_RelaxNG;
__pyx_type_4lxml_5etree_XMLSchema.tp_base = __pyx_ptype_4lxml_5etree__Validator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 22; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XMLSchema", (PyObject *)&__pyx_type_4lxml_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 22; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_XMLSchema = &__pyx_type_4lxml_5etree_XMLSchema;
__pyx_type_4lxml_5etree_Schematron.tp_base = __pyx_ptype_4lxml_5etree__Validator;
if (PyType_Ready(&__pyx_type_4lxml_5etree_Schematron) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 68; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "Schematron", (PyObject *)&__pyx_type_4lxml_5etree_Schematron) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_ptype_4lxml_5etree_Schematron = &__pyx_type_4lxml_5etree_Schematron;
/*--- Type import code ---*/
__pyx_ptype_6python_slice = __Pyx_ImportType("__builtin__", "slice", sizeof(PySliceObject)); if (unlikely(!__pyx_ptype_6python_slice)) {__pyx_filename = __pyx_f[20]; __pyx_lineno = 14; goto __pyx_L1;}
/*--- Execution code ---*/

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":9
 * cimport cstd
 * 
 * import __builtin__             # <<<<<<<<<<<<<< 
 * 
 * cdef object set
 */
__pyx_1 = __Pyx_Import(__pyx_n___builtin__, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n___builtin__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":12
 * 
 * cdef object set
 * try:             # <<<<<<<<<<<<<< 
 *     set = __builtin__.set
 * except AttributeError:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":13
 * cdef object set
 * try:
 *     set = __builtin__.set             # <<<<<<<<<<<<<< 
 * except AttributeError:
 *     from sets import Set as set
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L3;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_4lxml_5etree_set);
  __pyx_v_4lxml_5etree_set = __pyx_2;
  __pyx_2 = 0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":14
 * try:
 *     set = __builtin__.set
 * except AttributeError:             # <<<<<<<<<<<<<< 
 *     from sets import Set as set
 * 
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree");
  if (__Pyx_GetException(&__pyx_1, &__pyx_2, &__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":15
 *     set = __builtin__.set
 * except AttributeError:
 *     from sets import Set as set             # <<<<<<<<<<<<<< 
 * 
 * del __builtin__
 */
  __pyx_5 = PyList_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_INCREF(__pyx_n_Set);
  PyList_SET_ITEM(__pyx_5, 0, __pyx_n_Set);
  __pyx_6 = __Pyx_Import(__pyx_n_sets, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_5 = PyObject_GetAttr(__pyx_6, __pyx_n_Set); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 15; goto __pyx_L1;}
  Py_DECREF(__pyx_v_4lxml_5etree_set);
  __pyx_v_4lxml_5etree_set = __pyx_5;
  __pyx_5 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  goto __pyx_L4;
}
goto __pyx_L1;
__pyx_L4:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":17
 *     from sets import Set as set
 * 
 * del __builtin__             # <<<<<<<<<<<<<< 
 * 
 * cdef object os_path_join
 */
if (PyObject_DelAttrString(__pyx_m, "__builtin__") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 17; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":20
 * 
 * cdef object os_path_join
 * from os.path import join as os_path_join             # <<<<<<<<<<<<<< 
 * 
 * cdef object _elementpath
 */
__pyx_6 = PyList_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
Py_INCREF(__pyx_n_join);
PyList_SET_ITEM(__pyx_6, 0, __pyx_n_join);
__pyx_5 = __Pyx_Import(__pyx_k28p, __pyx_6); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_5, __pyx_n_join); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree_os_path_join);
__pyx_v_4lxml_5etree_os_path_join = __pyx_1;
__pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":23
 * 
 * cdef object _elementpath
 * import _elementpath             # <<<<<<<<<<<<<< 
 * 
 * cdef object sys
 */
__pyx_2 = __Pyx_Import(__pyx_n__elementpath, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree__elementpath);
__pyx_v_4lxml_5etree__elementpath = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":26
 * 
 * cdef object sys
 * import sys             # <<<<<<<<<<<<<< 
 * 
 * cdef object re
 */
__pyx_4 = __Pyx_Import(__pyx_n_sys, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree_sys);
__pyx_v_4lxml_5etree_sys = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":29
 * 
 * cdef object re
 * import re             # <<<<<<<<<<<<<< 
 * 
 * cdef object ITER_EMPTY
 */
__pyx_6 = __Pyx_Import(__pyx_n_re, 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree_re);
__pyx_v_4lxml_5etree_re = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":32
 * 
 * cdef object ITER_EMPTY
 * ITER_EMPTY = iter(())             # <<<<<<<<<<<<<< 
 * 
 * cdef object EMPTY_READ_ONLY_DICT
 */
__pyx_5 = PyTuple_New(0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
__pyx_1 = PyObject_GetIter(__pyx_5); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_v_4lxml_5etree_ITER_EMPTY);
__pyx_v_4lxml_5etree_ITER_EMPTY = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":35
 * 
 * cdef object EMPTY_READ_ONLY_DICT
 * EMPTY_READ_ONLY_DICT = python.PyDictProxy_New({})             # <<<<<<<<<<<<<< 
 * 
 * # the rules
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
__pyx_4 = PyDictProxy_New(__pyx_2); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT);
__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":46
 * # 1 : use log
 * cdef int __DEBUG
 * __DEBUG = 1             # <<<<<<<<<<<<<< 
 * 
 * # maximum number of lines in the libxml2/xslt log if __DEBUG == 1
 */
__pyx_v_4lxml_5etree___DEBUG = 1;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":50
 * # maximum number of lines in the libxml2/xslt log if __DEBUG == 1
 * cdef int __MAX_LOG_SIZE
 * __MAX_LOG_SIZE = 100             # <<<<<<<<<<<<<< 
 * 
 * # make the compiled-in debug state publicly available
 */
__pyx_v_4lxml_5etree___MAX_LOG_SIZE = 100;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":53
 * 
 * # make the compiled-in debug state publicly available
 * DEBUG = __DEBUG             # <<<<<<<<<<<<<< 
 * 
 * # global per-thread setup
 */
__pyx_6 = PyInt_FromLong(__pyx_v_4lxml_5etree___DEBUG); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_DEBUG, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":56
 * 
 * # global per-thread setup
 * tree.xmlThrDefIndentTreeOutput(1)             # <<<<<<<<<<<<<< 
 * tree.xmlThrDefLineNumbersDefaultValue(1)
 * 
 */
xmlThrDefIndentTreeOutput(1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":57
 * # global per-thread setup
 * tree.xmlThrDefIndentTreeOutput(1)
 * tree.xmlThrDefLineNumbersDefaultValue(1)             # <<<<<<<<<<<<<< 
 * 
 * _initThreadLogging()
 */
xmlThrDefLineNumbersDefaultValue(1);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":59
 * tree.xmlThrDefLineNumbersDefaultValue(1)
 * 
 * _initThreadLogging()             # <<<<<<<<<<<<<< 
 * 
 * # initialize parser (and threading)
 */
__pyx_f_4lxml_5etree__initThreadLogging();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":62
 * 
 * # initialize parser (and threading)
 * xmlparser.xmlInitParser()             # <<<<<<<<<<<<<< 
 * 
 * # filename encoding
 */
xmlInitParser();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":66
 * # filename encoding
 * cdef object _FILENAME_ENCODING
 * _FILENAME_ENCODING = sys.getfilesystemencoding()             # <<<<<<<<<<<<<< 
 * if _FILENAME_ENCODING is None:
 *     _FILENAME_ENCODING = sys.getdefaultencoding()
 */
__pyx_5 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_n_getfilesystemencoding); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
__pyx_1 = PyObject_CallObject(__pyx_5, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
__pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":67
 * cdef object _FILENAME_ENCODING
 * _FILENAME_ENCODING = sys.getfilesystemencoding()
 * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<< 
 *     _FILENAME_ENCODING = sys.getdefaultencoding()
 * if _FILENAME_ENCODING is None:
 */
__pyx_7 = (__pyx_v_4lxml_5etree__FILENAME_ENCODING == Py_None);
if (__pyx_7) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":68
 * _FILENAME_ENCODING = sys.getfilesystemencoding()
 * if _FILENAME_ENCODING is None:
 *     _FILENAME_ENCODING = sys.getdefaultencoding()             # <<<<<<<<<<<<<< 
 * if _FILENAME_ENCODING is None:
 *     _FILENAME_ENCODING = 'ascii'
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree_sys, __pyx_n_getdefaultencoding); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_2, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
  __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":69
 * if _FILENAME_ENCODING is None:
 *     _FILENAME_ENCODING = sys.getdefaultencoding()
 * if _FILENAME_ENCODING is None:             # <<<<<<<<<<<<<< 
 *     _FILENAME_ENCODING = 'ascii'
 * cdef char* _C_FILENAME_ENCODING
 */
__pyx_7 = (__pyx_v_4lxml_5etree__FILENAME_ENCODING == Py_None);
if (__pyx_7) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":70
 *     _FILENAME_ENCODING = sys.getdefaultencoding()
 * if _FILENAME_ENCODING is None:
 *     _FILENAME_ENCODING = 'ascii'             # <<<<<<<<<<<<<< 
 * cdef char* _C_FILENAME_ENCODING
 * _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)
 */
  Py_INCREF(__pyx_n_ascii);
  Py_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING);
  __pyx_v_4lxml_5etree__FILENAME_ENCODING = __pyx_n_ascii;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":72
 *     _FILENAME_ENCODING = 'ascii'
 * cdef char* _C_FILENAME_ENCODING
 * _C_FILENAME_ENCODING = _cstr(_FILENAME_ENCODING)             # <<<<<<<<<<<<<< 
 * 
 * # set up some default namespace prefixes
 */
__pyx_v_4lxml_5etree__C_FILENAME_ENCODING = _cstr(__pyx_v_4lxml_5etree__FILENAME_ENCODING);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":76
 * # set up some default namespace prefixes
 * cdef object _DEFAULT_NAMESPACE_PREFIXES
 * _DEFAULT_NAMESPACE_PREFIXES = {             # <<<<<<<<<<<<<< 
 *     "http://www.w3.org/1999/xhtml": "html",
 *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":77
 * cdef object _DEFAULT_NAMESPACE_PREFIXES
 * _DEFAULT_NAMESPACE_PREFIXES = {
 *     "http://www.w3.org/1999/xhtml": "html",             # <<<<<<<<<<<<<< 
 *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
 *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
 */
if (PyDict_SetItem(__pyx_6, __pyx_k34p, __pyx_n_html) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":78
 * _DEFAULT_NAMESPACE_PREFIXES = {
 *     "http://www.w3.org/1999/xhtml": "html",
 *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",             # <<<<<<<<<<<<<< 
 *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
 *     # xml schema
 */
if (PyDict_SetItem(__pyx_6, __pyx_k36p, __pyx_n_rdf) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":79
 *     "http://www.w3.org/1999/xhtml": "html",
 *     "http://www.w3.org/1999/02/22-rdf-syntax-ns#": "rdf",
 *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",             # <<<<<<<<<<<<<< 
 *     # xml schema
 *     "http://www.w3.org/2001/XMLSchema": "xs",
 */
if (PyDict_SetItem(__pyx_6, __pyx_k38p, __pyx_n_wsdl) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":81
 *     "http://schemas.xmlsoap.org/wsdl/": "wsdl",
 *     # xml schema
 *     "http://www.w3.org/2001/XMLSchema": "xs",             # <<<<<<<<<<<<<< 
 *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",
 *     # dublic core
 */
if (PyDict_SetItem(__pyx_6, __pyx_k40p, __pyx_n_xs) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":82
 *     # xml schema
 *     "http://www.w3.org/2001/XMLSchema": "xs",
 *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",             # <<<<<<<<<<<<<< 
 *     # dublic core
 *     "http://purl.org/dc/elements/1.1/": "dc",
 */
if (PyDict_SetItem(__pyx_6, __pyx_k42p, __pyx_n_xsi) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":84
 *     "http://www.w3.org/2001/XMLSchema-instance": "xsi",
 *     # dublic core
 *     "http://purl.org/dc/elements/1.1/": "dc",             # <<<<<<<<<<<<<< 
 * }
 * 
 */
if (PyDict_SetItem(__pyx_6, __pyx_k44p, __pyx_n_dc) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 76; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES);
__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":88
 * 
 * # Error superclass for ElementTree compatibility
 * class Error(Exception):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */
__pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":88
 * 
 * # Error superclass for ElementTree compatibility
 * class Error(Exception):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
Py_INCREF(__pyx_builtin_Exception);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_builtin_Exception);
__pyx_2 = __Pyx_CreateClass(__pyx_1, __pyx_5, __pyx_n_Error, "lxml.etree"); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_Error, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":92
 * 
 * # module level superclass for all exceptions
 * class LxmlError(Error):             # <<<<<<<<<<<<<< 
 *     """Main exception base class for lxml.  All other exceptions inherit from
 *     this one.
 */
__pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":92
 * 
 * # module level superclass for all exceptions
 * class LxmlError(Error):             # <<<<<<<<<<<<<< 
 *     """Main exception base class for lxml.  All other exceptions inherit from
 *     this one.
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_Error); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":92
 * 
 * # module level superclass for all exceptions
 * class LxmlError(Error):             # <<<<<<<<<<<<<< 
 *     """Main exception base class for lxml.  All other exceptions inherit from
 *     this one.
 */
if (PyDict_SetItemString(__pyx_4, "__doc__", __pyx_k48p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_2 = __Pyx_CreateClass(__pyx_1, __pyx_4, __pyx_n_LxmlError, "lxml.etree"); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":96
 *     this one.
 *     """
 *     def __init__(self, *args):             # <<<<<<<<<<<<<< 
 *         _initError(self, *args)
 *         self.error_log = __copyGlobalErrorLog()
 */
__pyx_5 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_9LxmlError___init__, 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
__pyx_6 = PyMethod_New(__pyx_5, 0, __pyx_2); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_2, __pyx_n___init__, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlError, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":101
 * 
 * cdef object _LxmlError
 * _LxmlError = LxmlError             # <<<<<<<<<<<<<< 
 * 
 * def _superError(obj, *args):
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree__LxmlError);
__pyx_v_4lxml_5etree__LxmlError = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":107
 * 
 * cdef object _initError
 * if isinstance(_LxmlError, type):             # <<<<<<<<<<<<<< 
 *     _initError = _superError    # Python >= 2.5
 * else:
 */
__pyx_7 = PyObject_IsInstance(__pyx_v_4lxml_5etree__LxmlError,((PyObject*)&PyType_Type)); if (unlikely(__pyx_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; goto __pyx_L1;}
if (__pyx_7) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":108
 * cdef object _initError
 * if isinstance(_LxmlError, type):
 *     _initError = _superError    # Python >= 2.5             # <<<<<<<<<<<<<< 
 * else:
 *     _initError = Error.__init__ # Python <= 2.4
 */
  __pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n__superError); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
  Py_DECREF(__pyx_v_4lxml_5etree__initError);
  __pyx_v_4lxml_5etree__initError = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":110
 *     _initError = _superError    # Python >= 2.5
 * else:
 *     _initError = Error.__init__ # Python <= 2.4             # <<<<<<<<<<<<<< 
 * 
 * del _superError
 */
  __pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_Error); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_6, __pyx_n___init__); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  Py_DECREF(__pyx_v_4lxml_5etree__initError);
  __pyx_v_4lxml_5etree__initError = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L7:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":112
 *     _initError = Error.__init__ # Python <= 2.4
 * 
 * del _superError             # <<<<<<<<<<<<<< 
 * 
 * 
 */
if (PyObject_DelAttrString(__pyx_m, "_superError") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":116
 * 
 * # superclass for all syntax errors
 * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<< 
 *     """Base class for all syntax errors.
 *     """
 */
__pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":116
 * 
 * # superclass for all syntax errors
 * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<< 
 *     """Base class for all syntax errors.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":116
 * 
 * # superclass for all syntax errors
 * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<< 
 *     """Base class for all syntax errors.
 *     """
 */
__pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
Py_INCREF(__pyx_builtin_SyntaxError);
PyTuple_SET_ITEM(__pyx_5, 1, __pyx_builtin_SyntaxError);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":116
 * 
 * # superclass for all syntax errors
 * class LxmlSyntaxError(LxmlError, SyntaxError):             # <<<<<<<<<<<<<< 
 *     """Base class for all syntax errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_4, "__doc__", __pyx_k50p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
__pyx_6 = __Pyx_CreateClass(__pyx_5, __pyx_4, __pyx_n_LxmlSyntaxError, "lxml.etree"); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlSyntaxError, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":121
 *     pass
 * 
 * class XIncludeError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during XInclude processing.
 *     """
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":121
 *     pass
 * 
 * class XIncludeError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during XInclude processing.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":121
 *     pass
 * 
 * class XIncludeError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during XInclude processing.
 *     """
 */
if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k52p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
__pyx_6 = __Pyx_CreateClass(__pyx_5, __pyx_2, __pyx_n_XIncludeError, "lxml.etree"); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XIncludeError, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":126
 *     pass
 * 
 * class C14NError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during C14N serialisation.
 *     """
 */
__pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":126
 *     pass
 * 
 * class C14NError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during C14N serialisation.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":126
 *     pass
 * 
 * class C14NError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Error during C14N serialisation.
 *     """
 */
if (PyDict_SetItemString(__pyx_4, "__doc__", __pyx_k54p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
__pyx_6 = __Pyx_CreateClass(__pyx_5, __pyx_4, __pyx_n_C14NError, "lxml.etree"); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_C14NError, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":163
 * 
 * cdef int _LIBXML_VERSION_INT
 * try:             # <<<<<<<<<<<<<< 
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))
 * except Exception:
 */
/*try:*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":164
 * cdef int _LIBXML_VERSION_INT
 * try:
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))             # <<<<<<<<<<<<<< 
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion
 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_match); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":164
 * cdef int _LIBXML_VERSION_INT
 * try:
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))             # <<<<<<<<<<<<<< 
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion
 */
  __pyx_1 = PyString_FromString(xmlParserVersion); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  __pyx_5 = PyTuple_New(2); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_INCREF(__pyx_k55p);
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_k55p);
  PyTuple_SET_ITEM(__pyx_5, 1, __pyx_1);
  __pyx_1 = 0;
  __pyx_6 = PyObject_CallObject(__pyx_2, __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_4 = PyObject_GetAttr(__pyx_6, __pyx_n_group); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":164
 * cdef int _LIBXML_VERSION_INT
 * try:
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))             # <<<<<<<<<<<<<< 
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion
 */
  __pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_INCREF(__pyx_num_0);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_num_0);
  __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_6 = PyObject_CallObject(((PyObject*)&PyInt_Type), __pyx_5); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_6); if (unlikely((__pyx_3 == -1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; goto __pyx_L8;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = __pyx_3;
}
goto __pyx_L9;
__pyx_L8:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":165
 * try:
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))
 * except Exception:             # <<<<<<<<<<<<<< 
 *     print "Unknown libxml2 version:", tree.xmlParserVersion
 *     _LIBXML_VERSION_INT = 0
 */
__pyx_3 = PyErr_ExceptionMatches(__pyx_builtin_Exception);
if (__pyx_3) {
  __Pyx_AddTraceback("lxml.etree");
  if (__Pyx_GetException(&__pyx_4, &__pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":166
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion             # <<<<<<<<<<<<<< 
 *     _LIBXML_VERSION_INT = 0
 * 
 */
  if (__Pyx_PrintItem(__pyx_k56p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":166
 *     _LIBXML_VERSION_INT = int(re.match('[0-9]+', tree.xmlParserVersion).group(0))
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion             # <<<<<<<<<<<<<< 
 *     _LIBXML_VERSION_INT = 0
 * 
 */
  __pyx_5 = PyString_FromString(xmlParserVersion); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
  if (__Pyx_PrintItem(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; goto __pyx_L1;}

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":167
 * except Exception:
 *     print "Unknown libxml2 version:", tree.xmlParserVersion
 *     _LIBXML_VERSION_INT = 0             # <<<<<<<<<<<<<< 
 * 
 * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
 */
  __pyx_v_4lxml_5etree__LIBXML_VERSION_INT = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L9;
}
goto __pyx_L1;
__pyx_L9:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":169
 *     _LIBXML_VERSION_INT = 0
 * 
 * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)             # <<<<<<<<<<<<<< 
 * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
 * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
 */
__pyx_6 = __pyx_f_4lxml_5etree___unpackIntVersion(__pyx_v_4lxml_5etree__LIBXML_VERSION_INT); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXML_VERSION, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":170
 * 
 * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
 * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)             # <<<<<<<<<<<<<< 
 * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
 * 
 */
__pyx_5 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXML_VERSION); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXML_COMPILED_VERSION, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 170; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":171
 * LIBXML_VERSION = __unpackIntVersion(_LIBXML_VERSION_INT)
 * LIBXML_COMPILED_VERSION = __unpackIntVersion(tree.LIBXML_VERSION)
 * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)             # <<<<<<<<<<<<<< 
 * 
 * __version__ = tree.LXML_VERSION_STRING
 */
__pyx_4 = PyString_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
__pyx_1 = __pyx_f_4lxml_5etree___unpackDottedVersion(__pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LXML_VERSION, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":173
 * LXML_VERSION = __unpackDottedVersion(tree.LXML_VERSION_STRING)
 * 
 * __version__ = tree.LXML_VERSION_STRING             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_2 = PyString_FromString(LXML_VERSION_STRING); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":228
 *     """
 *     cdef readonly object text
 *     def __init__(self, text_or_uri, tag=None):             # <<<<<<<<<<<<<< 
 *         if tag is not None:
 *             _tagValidOrRaise(_utf8(tag))
 */
Py_INCREF(Py_None);
__pyx_k57 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":924
 *         return ElementChildIterator(self, reversed=True)
 * 
 *     def index(self, _Element x not None, start=None, stop=None):             # <<<<<<<<<<<<<< 
 *         """Find the position of the child within the parent.
 * 
 */
Py_INCREF(Py_None);
__pyx_k58 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":924
 *         return ElementChildIterator(self, reversed=True)
 * 
 *     def index(self, _Element x not None, start=None, stop=None):             # <<<<<<<<<<<<<< 
 *         """Find the position of the child within the parent.
 * 
 */
Py_INCREF(Py_None);
__pyx_k59 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1007
 *             raise ValueError, "list.index(x): x not in list"
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         """Gets an element attribute.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k60 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1068
 *         return None
 * 
 *     def itersiblings(self, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the following or preceding siblings of this element.
 * 
 */
Py_INCREF(Py_None);
__pyx_k61 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1068
 *         return None
 * 
 *     def itersiblings(self, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the following or preceding siblings of this element.
 * 
 */
Py_INCREF(Py_False);
__pyx_k62 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1078
 *         return SiblingsIterator(self, tag, preceding=preceding)
 * 
 *     def iterancestors(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over the ancestors of this element (from parent to parent).
 * 
 */
Py_INCREF(Py_None);
__pyx_k63 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1086
 *         return AncestorsIterator(self, tag)
 * 
 *     def iterdescendants(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over the descendants of this element in document order.
 * 
 */
Py_INCREF(Py_None);
__pyx_k64 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1095
 *         return ElementDepthFirstIterator(self, tag, inclusive=False)
 * 
 *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the children of this element.
 * 
 */
Py_INCREF(Py_None);
__pyx_k65 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1095
 *         return ElementDepthFirstIterator(self, tag, inclusive=False)
 * 
 *     def iterchildren(self, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         """Iterate over the children of this element.
 * 
 */
Py_INCREF(Py_False);
__pyx_k66 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1113
 *         return _elementTreeFactory(self._doc, None)
 * 
 *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Returns a sequence or iterator of all elements in the subtree in
 *         document order (depth first pre-order), starting with this
 */
Py_INCREF(Py_None);
__pyx_k67 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1134
 *         return ElementDepthFirstIterator(self, tag)
 * 
 *     def iter(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Iterate over all elements in the subtree in document order (depth
 *         first pre-order), starting with this element.
 */
Py_INCREF(Py_None);
__pyx_k68 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1146
 *         return ElementDepthFirstIterator(self, tag)
 * 
 *     def itertext(self, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         """Iterates over the text content of a subtree.
 * 
 */
Py_INCREF(Py_None);
__pyx_k69 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1146
 *         return ElementDepthFirstIterator(self, tag)
 * 
 *     def itertext(self, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         """Iterates over the text content of a subtree.
 * 
 */
Py_INCREF(Py_True);
__pyx_k70 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1157
 *         return ElementTextIterator(self, tag, with_tail=with_tail)
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with the same document.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k71 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1157
 *         return ElementTextIterator(self, tag, with_tail=with_tail)
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with the same document.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k72 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1170
 *         return _elementpath.find(self, path)
 * 
 *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<< 
 *         """Finds text for the first matching subelement, by tag name or path.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k73 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1191
 *         return _elementpath.iterfind(self, path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an xpath expression using the element as context node.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k74 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1191
 *         return _elementpath.iterfind(self, path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """Evaluate an xpath expression using the element as context node.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k75 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1200
 * 
 * cdef python.PyThread_type_lock ELEMENT_CREATION_LOCK
 * if config.ENABLE_THREADING:             # <<<<<<<<<<<<<< 
 *     ELEMENT_CREATION_LOCK = python.PyThread_allocate_lock()
 * else:
 */
__pyx_7 = ENABLE_THREADING;
if (__pyx_7) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1201
 * cdef python.PyThread_type_lock ELEMENT_CREATION_LOCK
 * if config.ENABLE_THREADING:
 *     ELEMENT_CREATION_LOCK = python.PyThread_allocate_lock()             # <<<<<<<<<<<<<< 
 * else:
 *     ELEMENT_CREATION_LOCK = NULL
 */
  __pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK = PyThread_allocate_lock();
  goto __pyx_L10;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1203
 *     ELEMENT_CREATION_LOCK = python.PyThread_allocate_lock()
 * else:
 *     ELEMENT_CREATION_LOCK = NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef extern from "etree_defs.h":
 */
  __pyx_v_4lxml_5etree_ELEMENT_CREATION_LOCK = NULL;
}
__pyx_L10:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1299
 *         return 0
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         return None
 * 
 */
Py_INCREF(Py_None);
__pyx_k76 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1378
 *                "ElementTree not initialized, missing root"
 * 
 *     def parse(self, source, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *         """Updates self with the content of source and returns its root
 *         """
 */
Py_INCREF(Py_None);
__pyx_k77 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1432
 *             return None
 * 
 *     def write(self, file, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *               pretty_print=False, xml_declaration=None):
 *         """Write the tree to a file or file-like object.
 */
Py_INCREF(Py_None);
__pyx_k78 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1432
 *             return None
 * 
 *     def write(self, file, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *               pretty_print=False, xml_declaration=None):
 *         """Write the tree to a file or file-like object.
 */
Py_INCREF(__pyx_n_xml);
__pyx_k80 = __pyx_n_xml;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1433
 * 
 *     def write(self, file, *, encoding=None, method="xml",
 *               pretty_print=False, xml_declaration=None):             # <<<<<<<<<<<<<< 
 *         """Write the tree to a file or file-like object.
 * 
 */
Py_INCREF(Py_False);
__pyx_k81 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1433
 * 
 *     def write(self, file, *, encoding=None, method="xml",
 *               pretty_print=False, xml_declaration=None):             # <<<<<<<<<<<<<< 
 *         """Write the tree to a file or file-like object.
 * 
 */
Py_INCREF(Py_None);
__pyx_k82 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1476
 *         return path
 * 
 *     def getiterator(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Returns a sequence or iterator of all elements in document order
 *         (depth first pre-order), starting with the root element.
 */
Py_INCREF(Py_None);
__pyx_k83 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1500
 *         return root.getiterator(tag)
 * 
 *     def iter(self, tag=None):             # <<<<<<<<<<<<<< 
 *         """Creates an iterator for the root element.  The iterator loops over
 *         all elements in this tree, in document order.
 */
Py_INCREF(Py_None);
__pyx_k84 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1519
 *         return root.find(path)
 * 
 *     def findtext(self, path, default=None):             # <<<<<<<<<<<<<< 
 *         """Finds the text for the first element matching the ElementPath
 *         expression.  Same as getroot().findtext(path)
 */
Py_INCREF(Py_None);
__pyx_k85 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1549
 *         return root.iterfind(path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """XPath evaluate in context of document.
 * 
 */
Py_INCREF(Py_None);
__pyx_k86 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1549
 *         return root.iterfind(path)
 * 
 *     def xpath(self, _path, *, namespaces=None, extensions=None, **_variables):             # <<<<<<<<<<<<<< 
 *         """XPath evaluate in context of document.
 * 
 */
Py_INCREF(Py_None);
__pyx_k87 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1570
 *         return evaluator.evaluate(_path, **_variables)
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<< 
 *         """Transform this document using other document.
 * 
 */
Py_INCREF(Py_None);
__pyx_k88 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1570
 *         return evaluator.evaluate(_path, **_variables)
 * 
 *     def xslt(self, _xslt, extensions=None, access_control=None, **_kw):             # <<<<<<<<<<<<<< 
 *         """Transform this document using other document.
 * 
 */
Py_INCREF(Py_None);
__pyx_k89 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1740
 *         return c
 *     
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         return _getAttributeValue(self._element, key, default)
 * 
 */
Py_INCREF(Py_None);
__pyx_k90 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1897
 * cdef class ElementChildIterator(_ElementIterator):
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         self._initTagMatch(tag)
 */
Py_INCREF(Py_None);
__pyx_k91 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1897
 * cdef class ElementChildIterator(_ElementIterator):
 *     "Iterates over the children of an element."
 *     def __init__(self, _Element node not None, tag=None, *, reversed=False):             # <<<<<<<<<<<<<< 
 *         cdef xmlNode* c_node
 *         self._initTagMatch(tag)
 */
Py_INCREF(Py_False);
__pyx_k92 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1921
 *     You can pass the boolean keyword ``preceding`` to specify the direction.
 *     """
 *     def __init__(self, _Element node not None, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         if preceding:
 */
Py_INCREF(Py_None);
__pyx_k93 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1921
 *     You can pass the boolean keyword ``preceding`` to specify the direction.
 *     """
 *     def __init__(self, _Element node not None, tag=None, *, preceding=False):             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         if preceding:
 */
Py_INCREF(Py_False);
__pyx_k94 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1931
 * cdef class AncestorsIterator(_ElementIterator):
 *     "Iterates over the ancestors of an element (from parent to parent)."
 *     def __init__(self, _Element node not None, tag=None):             # <<<<<<<<<<<<<< 
 *         self._initTagMatch(tag)
 *         self._next_element = _parentElement
 */
Py_INCREF(Py_None);
__pyx_k95 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1956
 *     cdef _Element _next_node
 *     cdef _Element _top_node
 *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):             # <<<<<<<<<<<<<< 
 *         self._top_node  = node
 *         self._next_node = node
 */
Py_INCREF(Py_None);
__pyx_k96 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":1956
 *     cdef _Element _next_node
 *     cdef _Element _top_node
 *     def __init__(self, _Element node not None, tag=None, *, inclusive=True):             # <<<<<<<<<<<<<< 
 *         self._top_node  = node
 *         self._next_node = node
 */
Py_INCREF(Py_True);
__pyx_k97 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2014
 *     cdef object _nextEvent
 *     cdef _Element _start_element
 *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         if with_tail:
 *             events = ("start", "end")
 */
Py_INCREF(Py_None);
__pyx_k98 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2014
 *     cdef object _nextEvent
 *     cdef _Element _start_element
 *     def __init__(self, _Element element not None, tag=None, *, with_tail=True):             # <<<<<<<<<<<<<< 
 *         if with_tail:
 *             events = ("start", "end")
 */
Py_INCREF(Py_True);
__pyx_k99 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2057
 * # module-level API for ElementTree
 * 
 * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *     """Element factory.  This function returns an object implementing the
 *     Element interface.
 */
Py_INCREF(Py_None);
__pyx_k100 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2057
 * # module-level API for ElementTree
 * 
 * def Element(_tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *     """Element factory.  This function returns an object implementing the
 *     Element interface.
 */
Py_INCREF(Py_None);
__pyx_k101 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2065
 *                         attrib, nsmap, _extra)
 * 
 * def Comment(text=None):             # <<<<<<<<<<<<<< 
 *     """Comment element factory. This factory function creates a special element that will
 *     be serialized as an XML comment.
 */
Py_INCREF(Py_None);
__pyx_k102 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2082
 *     return _elementFactory(doc, c_node)
 * 
 * def ProcessingInstruction(target, text=None):             # <<<<<<<<<<<<<< 
 *     """ProcessingInstruction element factory. This factory function creates a
 *     special element that will be serialized as an XML processing instruction.
 */
Py_INCREF(Py_None);
__pyx_k103 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2100
 *     return _elementFactory(doc, c_node)
 * 
 * PI = ProcessingInstruction             # <<<<<<<<<<<<<< 
 * 
 * def Entity(name):
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_ProcessingInstruction); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_PI, __pyx_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2100; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2119
 * 
 * def SubElement(_Element _parent not None, _tag,
 *                attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *     """Subelement factory.  This function creates an element instance, and
 *     appends it to an existing element.
 */
Py_INCREF(Py_None);
__pyx_k104 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2119
 * 
 * def SubElement(_Element _parent not None, _tag,
 *                attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *     """Subelement factory.  This function creates an element instance, and
 *     appends it to an existing element.
 */
Py_INCREF(Py_None);
__pyx_k105 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2125
 *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)
 * 
 * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """ElementTree wrapper class.
 *     """
 */
Py_INCREF(Py_None);
__pyx_k106 = ((struct LxmlElement *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2125
 *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)
 * 
 * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """ElementTree wrapper class.
 *     """
 */
Py_INCREF(Py_None);
__pyx_k107 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2125
 *     return _makeSubElement(_parent, _tag, None, None, attrib, nsmap, _extra)
 * 
 * def ElementTree(_Element element=None, *, file=None, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """ElementTree wrapper class.
 *     """
 */
Py_INCREF(Py_None);
__pyx_k108 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2148
 *     return _elementTreeFactory(doc, element)
 * 
 * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an HTML document from a string constant. This function can be used
 *     to embed "HTML literals" in Python code.
 */
Py_INCREF(Py_None);
__pyx_k109 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2148
 *     return _elementTreeFactory(doc, element)
 * 
 * def HTML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an HTML document from a string constant. This function can be used
 *     to embed "HTML literals" in Python code.
 */
Py_INCREF(Py_None);
__pyx_k110 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2170
 *         return result_container.result
 * 
 * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string constant. This function can be used
 *     to embed "XML literals" in Python code, like in
 */
Py_INCREF(Py_None);
__pyx_k111 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2170
 *         return result_container.result
 * 
 * def XML(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string constant. This function can be used
 *     to embed "XML literals" in Python code, like in
 */
Py_INCREF(Py_None);
__pyx_k112 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2194
 *         return result_container.result
 * 
 * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string.
 * 
 */
Py_INCREF(Py_None);
__pyx_k113 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2194
 *         return result_container.result
 * 
 * def fromstring(text, _BaseParser parser=None, *, base_url=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a string.
 * 
 */
Py_INCREF(Py_None);
__pyx_k114 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2211
 *         return result_container.result
 * 
 * def fromstringlist(strings, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Parses an XML document from a sequence of strings.
 * 
 */
Py_INCREF(Py_None);
__pyx_k115 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2230
 *     return isinstance(element, _Element)
 * 
 * def dump(_Element elem not None, *, pretty_print=True):             # <<<<<<<<<<<<<< 
 *     """Writes an element tree or element structure to sys.stdout. This function
 *     should be used for debugging only.
 */
Py_INCREF(Py_True);
__pyx_k116 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2236
 *     _dumpToFile(sys.stdout, elem._c_node, pretty_print)
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *              xml_declaration=None, pretty_print=False):
 *     """Serialize an element to an encoded string representation of its XML
 */
Py_INCREF(Py_None);
__pyx_k117 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2236
 *     _dumpToFile(sys.stdout, elem._c_node, pretty_print)
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",             # <<<<<<<<<<<<<< 
 *              xml_declaration=None, pretty_print=False):
 *     """Serialize an element to an encoded string representation of its XML
 */
Py_INCREF(__pyx_n_xml);
__pyx_k119 = __pyx_n_xml;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2237
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",
 *              xml_declaration=None, pretty_print=False):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to an encoded string representation of its XML
 *     tree.
 */
Py_INCREF(Py_None);
__pyx_k120 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2237
 * 
 * def tostring(element_or_tree, *, encoding=None, method="xml",
 *              xml_declaration=None, pretty_print=False):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to an encoded string representation of its XML
 *     tree.
 */
Py_INCREF(Py_False);
__pyx_k121 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2279
 *     return [tostring(element_or_tree, *args, **kwargs)]
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to the Python unicode representation of its XML
 *     tree.
 */
Py_INCREF(__pyx_n_xml);
__pyx_k123 = __pyx_n_xml;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2279
 *     return [tostring(element_or_tree, *args, **kwargs)]
 * 
 * def tounicode(element_or_tree, *, method="xml", pretty_print=False):             # <<<<<<<<<<<<<< 
 *     """Serialize an element to the Python unicode representation of its XML
 *     tree.
 */
Py_INCREF(Py_False);
__pyx_k124 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2300
 *         raise TypeError, "Type '%s' cannot be serialized." % type(element_or_tree)
 * 
 * def parse(source, _BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Return an ElementTree object loaded with source elements.  If no parser
 *     is provided as second argument, the default parser is used.
 */
Py_INCREF(Py_None);
__pyx_k125 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":342
 * 
 * cdef object __RE_XML_ENCODING
 * __RE_XML_ENCODING = re.compile(             # <<<<<<<<<<<<<< 
 *     r'^(\s*<\?\s*xml[^>]+)\s+encoding\s*=\s*"[^"]*"\s*', re.U)
 * 
 */
__pyx_5 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":343
 * cdef object __RE_XML_ENCODING
 * __RE_XML_ENCODING = re.compile(
 *     r'^(\s*<\?\s*xml[^>]+)\s+encoding\s*=\s*"[^"]*"\s*', re.U)             # <<<<<<<<<<<<<< 
 * 
 * cdef object __REPLACE_XML_ENCODING
 */
__pyx_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_U); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 343; goto __pyx_L1;}
__pyx_1 = PyTuple_New(2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
Py_INCREF(__pyx_k126p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k126p);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_4);
__pyx_4 = 0;
__pyx_2 = PyObject_CallObject(__pyx_5, __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 342; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_4lxml_5etree___RE_XML_ENCODING);
__pyx_v_4lxml_5etree___RE_XML_ENCODING = __pyx_2;
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":346
 * 
 * cdef object __REPLACE_XML_ENCODING
 * __REPLACE_XML_ENCODING = __RE_XML_ENCODING.sub             # <<<<<<<<<<<<<< 
 * 
 * cdef object __HAS_XML_ENCODING
 */
__pyx_6 = PyObject_GetAttr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_sub); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 346; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING);
__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/apihelpers.pxi":349
 * 
 * cdef object __HAS_XML_ENCODING
 * __HAS_XML_ENCODING = __RE_XML_ENCODING.match             # <<<<<<<<<<<<<< 
 * 
 * cdef object _stripEncodingDeclaration(object xml_string):
 */
__pyx_4 = PyObject_GetAttr(__pyx_v_4lxml_5etree___RE_XML_ENCODING, __pyx_n_match); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 349; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING);
__pyx_v_4lxml_5etree___HAS_XML_ENCODING = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":346
 *     cdef object _map_level
 *     cdef object _log
 *     def __init__(self, logger_name=None):             # <<<<<<<<<<<<<< 
 *         _BaseErrorLog.__init__(self, None, None)
 *         import logging
 */
Py_INCREF(Py_None);
__pyx_k127 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":377
 * # global list log to collect error output messages from libxml2/libxslt
 * cdef _BaseErrorLog __GLOBAL_ERROR_LOG
 * __GLOBAL_ERROR_LOG = _RotatingErrorLog(__MAX_LOG_SIZE)             # <<<<<<<<<<<<<< 
 * 
 * cdef __copyGlobalErrorLog():
 */
__pyx_5 = PyInt_FromLong(__pyx_v_4lxml_5etree___MAX_LOG_SIZE); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 377; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 377; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_5);
__pyx_5 = 0;
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__RotatingErrorLog), __pyx_1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree__BaseErrorLog)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG));
__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_4lxml_5etree__BaseErrorLog *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":500
 *                 python.PyDict_SetItem(reverse_dict, value, name)
 * 
 * class ErrorLevels:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error levels"
 * 
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":500
 *                 python.PyDict_SetItem(reverse_dict, value, name)
 * 
 * class ErrorLevels:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error levels"
 * 
 */
__pyx_4 = PyTuple_New(0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":500
 *                 python.PyDict_SetItem(reverse_dict, value, name)
 * 
 * class ErrorLevels:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error levels"
 * 
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k129p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}
__pyx_5 = __Pyx_CreateClass(__pyx_4, __pyx_6, __pyx_n_ErrorLevels, "lxml.etree"); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorLevels, __pyx_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 500; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":503
 *     "Libxml2 error levels"
 * 
 * class ErrorDomains:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error domains"
 * 
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 503; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":503
 *     "Libxml2 error levels"
 * 
 * class ErrorDomains:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error domains"
 * 
 */
__pyx_2 = PyTuple_New(0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 503; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":503
 *     "Libxml2 error levels"
 * 
 * class ErrorDomains:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error domains"
 * 
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k131p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 503; goto __pyx_L1;}
__pyx_4 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_ErrorDomains, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 503; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorDomains, __pyx_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 503; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":506
 *     "Libxml2 error domains"
 * 
 * class ErrorTypes:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error types"
 * 
 */
__pyx_5 = PyDict_New(); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 506; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":506
 *     "Libxml2 error domains"
 * 
 * class ErrorTypes:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error types"
 * 
 */
__pyx_6 = PyTuple_New(0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 506; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":506
 *     "Libxml2 error domains"
 * 
 * class ErrorTypes:             # <<<<<<<<<<<<<< 
 *     "Libxml2 error types"
 * 
 */
if (PyDict_SetItemString(__pyx_5, "__doc__", __pyx_k133p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 506; goto __pyx_L1;}
__pyx_2 = __Pyx_CreateClass(__pyx_6, __pyx_5, __pyx_n_ErrorTypes, "lxml.etree"); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 506; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorTypes, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 506; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":520
 * 
 * cdef object __ERROR_LEVELS
 * __ERROR_LEVELS = ("""\             # <<<<<<<<<<<<<< 
 * NONE=0
 * WARNING=1
 */
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 520; goto __pyx_L1;}
Py_INCREF(__pyx_k134p);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k134p);
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_LEVELS);
__pyx_v_4lxml_5etree___ERROR_LEVELS = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":528
 * 
 * cdef object __ERROR_DOMAINS
 * __ERROR_DOMAINS = ("""\             # <<<<<<<<<<<<<< 
 * NONE=0
 * PARSER=1
 */
__pyx_1 = PyTuple_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 528; goto __pyx_L1;}
Py_INCREF(__pyx_k135p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k135p);
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS);
__pyx_v_4lxml_5etree___ERROR_DOMAINS = __pyx_1;
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":1231
 * SCHEMAP_SRC_IMPORT_1_2=3065
 * """,
 * """\             # <<<<<<<<<<<<<< 
 * SCHEMAP_SRC_IMPORT_2=3066
 * SCHEMAP_SRC_IMPORT_2_1=3067
 */
__pyx_6 = PyTuple_New(10); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 560; goto __pyx_L1;}
Py_INCREF(__pyx_k136p);
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k136p);
Py_INCREF(__pyx_k137p);
PyTuple_SET_ITEM(__pyx_6, 1, __pyx_k137p);
Py_INCREF(__pyx_k138p);
PyTuple_SET_ITEM(__pyx_6, 2, __pyx_k138p);
Py_INCREF(__pyx_k139p);
PyTuple_SET_ITEM(__pyx_6, 3, __pyx_k139p);
Py_INCREF(__pyx_k140p);
PyTuple_SET_ITEM(__pyx_6, 4, __pyx_k140p);
Py_INCREF(__pyx_k141p);
PyTuple_SET_ITEM(__pyx_6, 5, __pyx_k141p);
Py_INCREF(__pyx_k142p);
PyTuple_SET_ITEM(__pyx_6, 6, __pyx_k142p);
Py_INCREF(__pyx_k143p);
PyTuple_SET_ITEM(__pyx_6, 7, __pyx_k143p);
Py_INCREF(__pyx_k144p);
PyTuple_SET_ITEM(__pyx_6, 8, __pyx_k144p);
Py_INCREF(__pyx_k145p);
PyTuple_SET_ITEM(__pyx_6, 9, __pyx_k145p);
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_TYPES);
__pyx_v_4lxml_5etree___ERROR_TYPES = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlerror.pxi":1308
 * # --- END: GENERATED CONSTANTS ---
 * 
 * __initErrorConstants()             # <<<<<<<<<<<<<< 
 */
__pyx_f_4lxml_5etree___initErrorConstants();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":69
 *     cdef readonly ElementClassLookup fallback
 *     cdef _element_class_lookup_function _fallback_function
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = NULL # use default lookup
 *         if fallback is not None:
 */
Py_INCREF(Py_None);
__pyx_k146 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":102
 *     cdef readonly object pi_class
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 */
Py_INCREF(Py_None);
__pyx_k147 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":102
 *     cdef readonly object pi_class
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 */
Py_INCREF(Py_None);
__pyx_k148 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":102
 *     cdef readonly object pi_class
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 */
Py_INCREF(Py_None);
__pyx_k149 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":102
 *     cdef readonly object pi_class
 *     cdef readonly object entity_class
 *     def __init__(self, element=None, comment=None, pi=None, entity=None):             # <<<<<<<<<<<<<< 
 *         self._lookup_function = _lookupDefaultElementClass
 *         if element is None:
 */
Py_INCREF(Py_None);
__pyx_k150 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":188
 *     cdef char* _c_name
 *     def __init__(self, attribute_name, class_mapping,
 *                  ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         self._pytag = _getNsTag(attribute_name)
 *         ns, name = self._pytag
 */
Py_INCREF(Py_None);
__pyx_k151 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":218
 *     """Element class lookup based on the XML parser.
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _parser_class_lookup
 */
Py_INCREF(Py_None);
__pyx_k152 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":246
 *     If you return None from this method, the fallback will be called.
 *     """
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         FallbackElementClassLookup.__init__(self, fallback)
 *         self._lookup_function = _custom_class_lookup
 */
Py_INCREF(Py_None);
__pyx_k153 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":301
 *     LOOKUP_ELEMENT_CLASS = function
 * 
 * def setElementClassLookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *     "Deprecated, use ``set_element_class_lookup(lookup)`` instead"
 *     set_element_class_lookup(lookup)
 */
Py_INCREF(Py_None);
__pyx_k154 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":305
 *     set_element_class_lookup(lookup)
 * 
 * def set_element_class_lookup(ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *     "Set the global default element class lookup method."
 *     if lookup is None or lookup._lookup_function is NULL:
 */
Py_INCREF(Py_None);
__pyx_k155 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":314
 * # default setup: parser delegation
 * cdef ParserBasedElementClassLookup DEFAULT_ELEMENT_CLASS_LOOKUP
 * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()             # <<<<<<<<<<<<<< 
 * 
 * setElementClassLookup(DEFAULT_ELEMENT_CLASS_LOOKUP)
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 314; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree_ParserBasedElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 314; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_4lxml_5etree_ParserBasedElementClassLookup *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":316
 * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()
 * 
 * setElementClassLookup(DEFAULT_ELEMENT_CLASS_LOOKUP)             # <<<<<<<<<<<<<< 
 */
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_setElementClassLookup); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/classlookup.pxi":316
 * DEFAULT_ELEMENT_CLASS_LOOKUP = ParserBasedElementClassLookup()
 * 
 * setElementClassLookup(DEFAULT_ELEMENT_CLASS_LOOKUP)             # <<<<<<<<<<<<<< 
 */
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
PyTuple_SET_ITEM(__pyx_4, 0, ((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
__pyx_1 = PyObject_CallObject(__pyx_5, __pyx_4); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 316; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":3
 * # module-level API for namespace implementations
 * 
 * class LxmlRegistryError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of lxml registry errors.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":3
 * # module-level API for namespace implementations
 * 
 * class LxmlRegistryError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of lxml registry errors.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":3
 * # module-level API for namespace implementations
 * 
 * class LxmlRegistryError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of lxml registry errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k157p) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_6, __pyx_n_LxmlRegistryError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlRegistryError, __pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":8
 *     pass
 * 
 * class NamespaceRegistryError(LxmlRegistryError):             # <<<<<<<<<<<<<< 
 *     """Error registering a namespace extension.
 *     """
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":8
 *     pass
 * 
 * class NamespaceRegistryError(LxmlRegistryError):             # <<<<<<<<<<<<<< 
 *     """Error registering a namespace extension.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlRegistryError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":8
 *     pass
 * 
 * class NamespaceRegistryError(LxmlRegistryError):             # <<<<<<<<<<<<<< 
 *     """Error registering a namespace extension.
 *     """
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k159p) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_1, __pyx_n_NamespaceRegistryError, "lxml.etree"); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_NamespaceRegistryError, __pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":96
 *     """
 *     cdef object _namespace_registries
 *     def __init__(self, ElementClassLookup fallback=None):             # <<<<<<<<<<<<<< 
 *         self._namespace_registries = {}
 *         FallbackElementClassLookup.__init__(self, fallback)
 */
Py_INCREF(Py_None);
__pyx_k160 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/nsclasses.pxi":156
 * 
 * cdef object __FUNCTION_NAMESPACE_REGISTRIES
 * __FUNCTION_NAMESPACE_REGISTRIES = {}             # <<<<<<<<<<<<<< 
 * 
 * def FunctionNamespace(ns_uri):
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES);
__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":36
 *         return doc_ref
 * 
 *     def resolve_string(self, string, context, *, base_url=None):             # <<<<<<<<<<<<<< 
 *         """Return a parsable string as input document.
 * 
 */
Py_INCREF(Py_None);
__pyx_k161 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/docloader.pxi":81
 *     cdef object _resolvers
 *     cdef Resolver _default_resolver
 *     def __init__(self, Resolver default_resolver=None):             # <<<<<<<<<<<<<< 
 *         self._resolvers = set()
 *         self._default_resolver = default_resolver
 */
Py_INCREF(Py_None);
__pyx_k162 = ((struct __pyx_obj_4lxml_5etree_Resolver *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":6
 * cimport htmlparser
 * 
 * class ParseError(LxmlSyntaxError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 * 
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":6
 * cimport htmlparser
 * 
 * class ParseError(LxmlSyntaxError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 * 
 */
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlSyntaxError); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
__pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":6
 * cimport htmlparser
 * 
 * class ParseError(LxmlSyntaxError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 * 
 */
if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k164p) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_4, __pyx_2, __pyx_n_ParseError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ParseError, __pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":13
 *     pass
 * 
 * class XMLSyntaxError(ParseError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":13
 *     pass
 * 
 * class XMLSyntaxError(ParseError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 *     """
 */
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_ParseError); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
__pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":13
 *     pass
 * 
 * class XMLSyntaxError(ParseError):             # <<<<<<<<<<<<<< 
 *     """Syntax error while parsing an XML document.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k166p) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_4, __pyx_6, __pyx_n_XMLSyntaxError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":16
 *     """Syntax error while parsing an XML document.
 *     """
 *     def __init__(self, message, code, line, column):             # <<<<<<<<<<<<<< 
 *         ParseError.__init__(self, message)        
 *         self.position = (line, column)
 */
__pyx_2 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_14XMLSyntaxError___init__, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_5 = PyMethod_New(__pyx_2, 0, __pyx_1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_1, __pyx_n___init__, __pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 16; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":21
 *         self.code = code
 * 
 * class ParserError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Internal lxml parser error.
 *     """
 */
__pyx_4 = PyDict_New(); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":21
 *         self.code = code
 * 
 * class ParserError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Internal lxml parser error.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":21
 *         self.code = code
 * 
 * class ParserError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Internal lxml parser error.
 *     """
 */
if (PyDict_SetItemString(__pyx_4, "__doc__", __pyx_k168p) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_5, __pyx_4, __pyx_n_ParserError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ParserError, __pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 21; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":128
 * 
 * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
 * __GLOBAL_PARSER_CONTEXT = _ParserDictionaryContext()             # <<<<<<<<<<<<<< 
 * __GLOBAL_PARSER_CONTEXT.initMainParserContext()
 * 
 */
__pyx_6 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree__ParserDictionaryContext), 0); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_6, __pyx_ptype_4lxml_5etree__ParserDictionaryContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 128; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT));
__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_4lxml_5etree__ParserDictionaryContext *)__pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":129
 * cdef _ParserDictionaryContext __GLOBAL_PARSER_CONTEXT
 * __GLOBAL_PARSER_CONTEXT = _ParserDictionaryContext()
 * __GLOBAL_PARSER_CONTEXT.initMainParserContext()             # <<<<<<<<<<<<<< 
 * 
 * cdef int _checkThreadDict(tree.xmlDict* c_dict):
 */
((struct __pyx_vtabstruct_4lxml_5etree__ParserDictionaryContext *)__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initMainParserContext(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":147
 * # name of Python unicode encoding as known to libxml2
 * cdef char* _UNICODE_ENCODING
 * _UNICODE_ENCODING = NULL             # <<<<<<<<<<<<<< 
 * 
 * cdef void _setupPythonUnicode():
 */
__pyx_v_4lxml_5etree__UNICODE_ENCODING = NULL;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":199
 *         return tree.xmlGetCharEncodingName(enc)
 * 
 * _setupPythonUnicode()             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_f_4lxml_5etree__setupPythonUnicode();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":367
 * 
 * cdef xmlparser.xmlExternalEntityLoader __DEFAULT_ENTITY_LOADER
 * __DEFAULT_ENTITY_LOADER = xmlparser.xmlGetExternalEntityLoader()             # <<<<<<<<<<<<<< 
 * 
 * xmlparser.xmlSetExternalEntityLoader(_local_resolver)
 */
__pyx_v_4lxml_5etree___DEFAULT_ENTITY_LOADER = xmlGetExternalEntityLoader();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":369
 * __DEFAULT_ENTITY_LOADER = xmlparser.xmlGetExternalEntityLoader()
 * 
 * xmlparser.xmlSetExternalEntityLoader(_local_resolver)             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
xmlSetExternalEntityLoader(__pyx_f_4lxml_5etree__local_resolver);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":660
 *             return "libxml2 %d.%d.%d" % LIBXML_VERSION
 * 
 *     def setElementClassLookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *         "Deprecated, use ``parser.set_element_class_lookup(lookup)`` instead."
 *         self.set_element_class_lookup(lookup)
 */
Py_INCREF(Py_None);
__pyx_k169 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":664
 *         self.set_element_class_lookup(lookup)
 * 
 *     def set_element_class_lookup(self, ElementClassLookup lookup = None):             # <<<<<<<<<<<<<< 
 *         """Set a lookup scheme for element classes generated from this parser.
 * 
 */
Py_INCREF(Py_None);
__pyx_k170 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":689
 *         return self._copy()
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with this parser.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k171 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":689
 *         return self._copy()
 * 
 *     def makeelement(self, _tag, attrib=None, nsmap=None, **_extra):             # <<<<<<<<<<<<<< 
 *         """Creates a new element associated with this parser.
 *         """
 */
Py_INCREF(Py_None);
__pyx_k172 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1299
 *     cdef bint _in_tail
 * 
 *     def __init__(self, *, element_factory=None, parser=None):             # <<<<<<<<<<<<<< 
 *         self._sax_event_filter = \
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 */
Py_INCREF(Py_None);
__pyx_k173 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1299
 *     cdef bint _in_tail
 * 
 *     def __init__(self, *, element_factory=None, parser=None):             # <<<<<<<<<<<<<< 
 *         self._sax_event_filter = \
 *             SAX_EVENT_START | SAX_EVENT_END | SAX_EVENT_DATA | \
 */
Py_INCREF(Py_None);
__pyx_k174 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1340
 *         self._handleSaxData(data)
 * 
 *     def start(self, tag, attrs, nsmap=None):             # <<<<<<<<<<<<<< 
 *         "Opens a new element."
 *         if nsmap is None:
 */
Py_INCREF(Py_None);
__pyx_k175 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1412
 *     xmlparser.XML_PARSE_NOCDATA |
 *     xmlparser.XML_PARSE_NONET   |
 *     xmlparser.XML_PARSE_COMPACT             # <<<<<<<<<<<<<< 
 *     )
 * 
 */
__pyx_v_4lxml_5etree__XML_DEFAULT_PARSE_OPTIONS = (((XML_PARSE_NOENT | XML_PARSE_NOCDATA) | XML_PARSE_NONET) | XML_PARSE_COMPACT);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1447
 *     apply to the default parser.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */
Py_INCREF(Py_False);
__pyx_k176 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1447
 *     apply to the default parser.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */
Py_INCREF(Py_False);
__pyx_k177 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1448
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 */
Py_INCREF(Py_False);
__pyx_k178 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1448
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 */
Py_INCREF(Py_True);
__pyx_k179 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1448
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 */
Py_INCREF(Py_False);
__pyx_k180 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1449
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):
 */
Py_INCREF(Py_False);
__pyx_k181 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1449
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):
 */
Py_INCREF(Py_False);
__pyx_k182 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1449
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):
 */
Py_INCREF(Py_True);
__pyx_k183 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1450
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,             # <<<<<<<<<<<<<< 
 *                  remove_pis=False, target=None, encoding=None):
 *         cdef int parse_options
 */
Py_INCREF(Py_True);
__pyx_k184 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1450
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,             # <<<<<<<<<<<<<< 
 *                  remove_pis=False, target=None, encoding=None):
 *         cdef int parse_options
 */
Py_INCREF(Py_False);
__pyx_k185 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1451
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         cdef int parse_options
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 */
Py_INCREF(Py_False);
__pyx_k186 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1451
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         cdef int parse_options
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 */
Py_INCREF(Py_None);
__pyx_k187 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1451
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=False,
 *                  remove_pis=False, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         cdef int parse_options
 *         parse_options = _XML_DEFAULT_PARSE_OPTIONS
 */
Py_INCREF(Py_None);
__pyx_k188 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1486
 *     and thus ignores comments and processing instructions.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */
Py_INCREF(Py_False);
__pyx_k189 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1486
 *     and thus ignores comments and processing instructions.
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,             # <<<<<<<<<<<<<< 
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 */
Py_INCREF(Py_False);
__pyx_k190 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1487
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 */
Py_INCREF(Py_False);
__pyx_k191 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1487
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 */
Py_INCREF(Py_True);
__pyx_k192 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1487
 *     """
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,             # <<<<<<<<<<<<<< 
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 */
Py_INCREF(Py_False);
__pyx_k193 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1488
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):
 */
Py_INCREF(Py_False);
__pyx_k194 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1488
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):
 */
Py_INCREF(Py_False);
__pyx_k195 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1488
 *     def __init__(self, *, attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,             # <<<<<<<<<<<<<< 
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):
 */
Py_INCREF(Py_True);
__pyx_k196 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1489
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,             # <<<<<<<<<<<<<< 
 *                  remove_pis=True, target=None, encoding=None):
 *         XMLParser.__init__(self,
 */
Py_INCREF(Py_True);
__pyx_k197 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1489
 *                  load_dtd=False, no_network=True, ns_clean=False,
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,             # <<<<<<<<<<<<<< 
 *                  remove_pis=True, target=None, encoding=None):
 *         XMLParser.__init__(self,
 */
Py_INCREF(Py_True);
__pyx_k198 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1490
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         XMLParser.__init__(self,
 *                            attribute_defaults=attribute_defaults,
 */
Py_INCREF(Py_True);
__pyx_k199 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1490
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         XMLParser.__init__(self,
 *                            attribute_defaults=attribute_defaults,
 */
Py_INCREF(Py_None);
__pyx_k200 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1490
 *                  recover=False, remove_blank_text=False, compact=True,
 *                  resolve_entities=True, remove_comments=True,
 *                  remove_pis=True, target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         XMLParser.__init__(self,
 *                            attribute_defaults=attribute_defaults,
 */
Py_INCREF(Py_None);
__pyx_k201 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1508
 * 
 * cdef XMLParser __DEFAULT_XML_PARSER
 * __DEFAULT_XML_PARSER = XMLParser()             # <<<<<<<<<<<<<< 
 * 
 * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_XMLParser), 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1508; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_4lxml_5etree_XMLParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1508; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER));
__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_4lxml_5etree_XMLParser *)__pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1510
 * __DEFAULT_XML_PARSER = XMLParser()
 * 
 * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)             # <<<<<<<<<<<<<< 
 * 
 * def setDefaultParser(parser=None):
 */
((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));

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1512
 * __GLOBAL_PARSER_CONTEXT.setDefaultParser(__DEFAULT_XML_PARSER)
 * 
 * def setDefaultParser(parser=None):             # <<<<<<<<<<<<<< 
 *     "Deprecated, please use set_default_parser instead."
 *     set_default_parser(parser)
 */
Py_INCREF(Py_None);
__pyx_k202 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1520
 *     return get_default_parser()
 * 
 * def set_default_parser(_BaseParser parser=None):             # <<<<<<<<<<<<<< 
 *     """Set a default parser for the current thread.  This parser is used
 *     globally whenever no parser is supplied to the various parse functions of
 */
Py_INCREF(Py_None);
__pyx_k203 = ((struct __pyx_obj_4lxml_5etree__BaseParser *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1545
 *     htmlparser.HTML_PARSE_RECOVER |
 *     htmlparser.HTML_PARSE_NONET   |
 *     htmlparser.HTML_PARSE_COMPACT             # <<<<<<<<<<<<<< 
 *     )
 * 
 */
__pyx_v_4lxml_5etree__HTML_DEFAULT_PARSE_OPTIONS = ((HTML_PARSE_RECOVER | HTML_PARSE_NONET) | HTML_PARSE_COMPACT);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1568
 *     reasons.
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,             # <<<<<<<<<<<<<< 
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):
 */
Py_INCREF(Py_True);
__pyx_k204 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1568
 *     reasons.
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,             # <<<<<<<<<<<<<< 
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):
 */
Py_INCREF(Py_True);
__pyx_k205 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1568
 *     reasons.
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,             # <<<<<<<<<<<<<< 
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):
 */
Py_INCREF(Py_False);
__pyx_k206 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1569
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,
 *                  compact=True, remove_comments=False, remove_pis=False,             # <<<<<<<<<<<<<< 
 *                  target=None, encoding=None):
 *         cdef int parse_options
 */
Py_INCREF(Py_True);
__pyx_k207 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1569
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,
 *                  compact=True, remove_comments=False, remove_pis=False,             # <<<<<<<<<<<<<< 
 *                  target=None, encoding=None):
 *         cdef int parse_options
 */
Py_INCREF(Py_False);
__pyx_k208 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1569
 *     """
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,
 *                  compact=True, remove_comments=False, remove_pis=False,             # <<<<<<<<<<<<<< 
 *                  target=None, encoding=None):
 *         cdef int parse_options
 */
Py_INCREF(Py_False);
__pyx_k209 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1570
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         cdef int parse_options
 *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
 */
Py_INCREF(Py_None);
__pyx_k210 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1570
 *     def __init__(self, recover=True, no_network=True, remove_blank_text=False,
 *                  compact=True, remove_comments=False, remove_pis=False,
 *                  target=None, encoding=None):             # <<<<<<<<<<<<<< 
 *         cdef int parse_options
 *         parse_options = _HTML_DEFAULT_PARSE_OPTIONS
 */
Py_INCREF(Py_None);
__pyx_k211 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parser.pxi":1587
 * 
 * cdef HTMLParser __DEFAULT_HTML_PARSER
 * __DEFAULT_HTML_PARSER = HTMLParser()             # <<<<<<<<<<<<<< 
 * 
 * ############################################################
 */
__pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_4lxml_5etree_HTMLParser), 0); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1587; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_4lxml_5etree_HTMLParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 1587; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER));
__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_4lxml_5etree_HTMLParser *)__pyx_5);
__pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":4
 * 
 * cdef object inspect_getargspec
 * from inspect import getargspec as inspect_getargspec             # <<<<<<<<<<<<<< 
 * 
 * class _TargetParserResult(Exception):
 */
__pyx_1 = PyList_New(1); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 4; goto __pyx_L1;}
Py_INCREF(__pyx_n_getargspec);
PyList_SET_ITEM(__pyx_1, 0, __pyx_n_getargspec);
__pyx_4 = __Pyx_Import(__pyx_n_inspect, __pyx_1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_6 = PyObject_GetAttr(__pyx_4, __pyx_n_getargspec); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree_inspect_getargspec);
__pyx_v_4lxml_5etree_inspect_getargspec = __pyx_6;
__pyx_6 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":6
 * from inspect import getargspec as inspect_getargspec
 * 
 * class _TargetParserResult(Exception):             # <<<<<<<<<<<<<< 
 *     # Admittedly, this is somewhat ugly, but it's the easiest way
 *     # to push the Python level parser result through the parser
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":6
 * from inspect import getargspec as inspect_getargspec
 * 
 * class _TargetParserResult(Exception):             # <<<<<<<<<<<<<< 
 *     # Admittedly, this is somewhat ugly, but it's the easiest way
 *     # to push the Python level parser result through the parser
 */
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; goto __pyx_L1;}
Py_INCREF(__pyx_builtin_Exception);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_builtin_Exception);
__pyx_1 = __Pyx_CreateClass(__pyx_5, __pyx_2, __pyx_n__TargetParserResult, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/parsertarget.pxi":10
 *     # to push the Python level parser result through the parser
 *     # machinery towards the API level functions
 *     def __init__(self, result):             # <<<<<<<<<<<<<< 
 *         self.result = result
 * 
 */
__pyx_4 = PyCFunction_New(&__pyx_mdef_4lxml_5etree_19_TargetParserResult___init__, 0); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_6 = PyMethod_New(__pyx_4, 0, __pyx_1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (PyObject_SetAttr(__pyx_1, __pyx_n___init__, __pyx_6) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n__TargetParserResult, __pyx_1) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/serializer.pxi":273
 *     cdef _ExceptionContext _exc_context
 *     cdef _ErrorLog error_log
 *     def __init__(self, filelike, exc_context=None):             # <<<<<<<<<<<<<< 
 *         self._filelike = filelike
 *         if exc_context is None:
 */
Py_INCREF(Py_None);
__pyx_k215 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":4
 * 
 * cdef object __ITERPARSE_CHUNK_SIZE
 * __ITERPARSE_CHUNK_SIZE = 32768             # <<<<<<<<<<<<<< 
 * 
 * ctypedef enum _IterparseEventFilter:
 */
Py_INCREF(__pyx_num_32768);
Py_DECREF(__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE);
__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE = __pyx_num_32768;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":278
 *     cdef object _source
 *     cdef readonly object root
 *     def __init__(self, source, events=("end",), tag=None,             # <<<<<<<<<<<<<< 
 *                  attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, remove_blank_text=False,
 */
__pyx_5 = PyTuple_New(1); if (unlikely(!__pyx_5)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 278; goto __pyx_L1;}
Py_INCREF(__pyx_n_end);
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_n_end);
__pyx_k217 = __pyx_5;
__pyx_5 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":278
 *     cdef object _source
 *     cdef readonly object root
 *     def __init__(self, source, events=("end",), tag=None,             # <<<<<<<<<<<<<< 
 *                  attribute_defaults=False, dtd_validation=False,
 *                  load_dtd=False, no_network=True, remove_blank_text=False,
 */
Py_INCREF(Py_None);
__pyx_k218 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":279
 *     cdef readonly object root
 *     def __init__(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,
 */
Py_INCREF(Py_False);
__pyx_k219 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":279
 *     cdef readonly object root
 *     def __init__(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,
 */
Py_INCREF(Py_False);
__pyx_k220 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":280
 *     def __init__(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):
 */
Py_INCREF(Py_False);
__pyx_k221 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":280
 *     def __init__(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):
 */
Py_INCREF(Py_True);
__pyx_k222 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":280
 *     def __init__(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):
 */
Py_INCREF(Py_False);
__pyx_k223 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":281
 *                  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):
 *         cdef _IterparseContext context
 */
Py_INCREF(Py_False);
__pyx_k224 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":281
 *                  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):
 *         cdef _IterparseContext context
 */
Py_INCREF(Py_False);
__pyx_k225 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":281
 *                  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):
 *         cdef _IterparseContext context
 */
Py_INCREF(Py_None);
__pyx_k226 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":282
 *                  load_dtd=False, no_network=True, remove_blank_text=False,
 *                  remove_comments=False, remove_pis=False, encoding=None,
 *                  html=False):             # <<<<<<<<<<<<<< 
 *         cdef _IterparseContext context
 *         cdef char* c_encoding
 */
Py_INCREF(Py_False);
__pyx_k227 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":412
 *     cdef char*  _tag_name
 * 
 *     def __init__(self, element_or_tree, events=("end",), tag=None):             # <<<<<<<<<<<<<< 
 *         cdef _Element root
 *         cdef int ns_count
 */
__pyx_4 = PyTuple_New(1); if (unlikely(!__pyx_4)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 412; goto __pyx_L1;}
Py_INCREF(__pyx_n_end);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_n_end);
__pyx_k229 = __pyx_4;
__pyx_4 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/iterparse.pxi":412
 *     cdef char*  _tag_name
 * 
 *     def __init__(self, element_or_tree, events=("end",), tag=None):             # <<<<<<<<<<<<<< 
 *         cdef _Element root
 *         cdef int ns_count
 */
Py_INCREF(Py_None);
__pyx_k230 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlid.pxi":39
 *         return (root, _IDDict(root))
 * 
 * def parseid(source, parser=None):             # <<<<<<<<<<<<<< 
 *     """Parses the source into a tuple containing an ElementTree object and an
 *     ID dictionary.  If no parser is provided as second argument, the default
 */
Py_INCREF(Py_None);
__pyx_k231 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":3
 * # support for extension functions in XPath and XSLT
 * 
 * class XPathError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XPath errors.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":3
 * # support for extension functions in XPath and XSLT
 * 
 * class XPathError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XPath errors.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":3
 * # support for extension functions in XPath and XSLT
 * 
 * class XPathError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XPath errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k233p) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_6, __pyx_n_XPathError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathError, __pyx_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":8
 *     pass
 * 
 * class XPathEvalError(XPathError):             # <<<<<<<<<<<<<< 
 *     """Error during XPath evaluation.
 *     """
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":8
 *     pass
 * 
 * class XPathEvalError(XPathError):             # <<<<<<<<<<<<<< 
 *     """Error during XPath evaluation.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":8
 *     pass
 * 
 * class XPathEvalError(XPathError):             # <<<<<<<<<<<<<< 
 *     """Error during XPath evaluation.
 *     """
 */
if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k235p) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_6, __pyx_2, __pyx_n_XPathEvalError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathEvalError, __pyx_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":13
 *     pass
 * 
 * class XPathFunctionError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Internal error looking up an XPath extension function.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":13
 *     pass
 * 
 * class XPathFunctionError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Internal error looking up an XPath extension function.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XPathEvalError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":13
 *     pass
 * 
 * class XPathFunctionError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Internal error looking up an XPath extension function.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k237p) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_6, __pyx_n_XPathFunctionError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathFunctionError, __pyx_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":18
 *     pass
 * 
 * class XPathResultError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Error handling an XPath result.
 *     """
 */
__pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":18
 *     pass
 * 
 * class XPathResultError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Error handling an XPath result.
 *     """
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XPathEvalError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
__pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":18
 *     pass
 * 
 * class XPathResultError(XPathEvalError):             # <<<<<<<<<<<<<< 
 *     """Error handling an XPath result.
 *     """
 */
if (PyDict_SetItemString(__pyx_2, "__doc__", __pyx_k239p) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_6, __pyx_2, __pyx_n_XPathResultError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathResultError, __pyx_1) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 18; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":328
 *                 self._temp_refs.add((<_Element>o)._doc)
 * 
 * def Extension(module, function_mapping=None, *, ns=None):             # <<<<<<<<<<<<<< 
 *     """Build a dictionary of extension functions from the functions
 *     defined in a module or the methods of an object.
 */
Py_INCREF(Py_None);
__pyx_k240 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":328
 *                 self._temp_refs.add((<_Element>o)._doc)
 * 
 * def Extension(module, function_mapping=None, *, ns=None):             # <<<<<<<<<<<<<< 
 *     """Build a dictionary of extension functions from the functions
 *     defined in a module or the methods of an object.
 */
Py_INCREF(Py_None);
__pyx_k241 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":400
 *         return rexp_compiled
 * 
 *     def test(self, ctxt, s, rexp, flags=''):             # <<<<<<<<<<<<<< 
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 */
Py_INCREF(__pyx_k242p);
__pyx_k243 = __pyx_k242p;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/extensions.pxi":409
 *             return True
 * 
 *     def match(self, ctxt, s, rexp, flags=''):             # <<<<<<<<<<<<<< 
 *         flags = self._make_string(flags)
 *         s = self._make_string(s)
 */
Py_INCREF(__pyx_k244p);
__pyx_k245 = __pyx_k244p;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":3
 * # XPath evaluation
 * 
 * class XPathSyntaxError(LxmlSyntaxError, XPathError):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":3
 * # XPath evaluation
 * 
 * class XPathSyntaxError(LxmlSyntaxError, XPathError):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlSyntaxError); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":3
 * # XPath evaluation
 * 
 * class XPathSyntaxError(LxmlSyntaxError, XPathError):             # <<<<<<<<<<<<<< 
 *     pass
 * 
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_8 = PyTuple_New(2); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_8, 1, __pyx_2);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_8, __pyx_6, __pyx_n_XPathSyntaxError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":11
 * cdef object _XPATH_SYNTAX_ERRORS
 * _XPATH_SYNTAX_ERRORS = (
 *     xmlerror.XML_XPATH_NUMBER_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
 *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
 */
__pyx_2 = PyInt_FromLong(XML_XPATH_NUMBER_ERROR); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":12
 * _XPATH_SYNTAX_ERRORS = (
 *     xmlerror.XML_XPATH_NUMBER_ERROR,
 *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
 *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
 */
__pyx_8 = PyInt_FromLong(XML_XPATH_UNFINISHED_LITERAL_ERROR); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 12; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":13
 *     xmlerror.XML_XPATH_NUMBER_ERROR,
 *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
 *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
 *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
 */
__pyx_1 = PyInt_FromLong(XML_XPATH_VARIABLE_REF_ERROR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 13; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":14
 *     xmlerror.XML_XPATH_UNFINISHED_LITERAL_ERROR,
 *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
 *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
 *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR
 */
__pyx_6 = PyInt_FromLong(XML_XPATH_INVALID_PREDICATE_ERROR); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":15
 *     xmlerror.XML_XPATH_VARIABLE_REF_ERROR,
 *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
 *     xmlerror.XML_XPATH_UNCLOSED_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR
 * )
 */
__pyx_9 = PyInt_FromLong(XML_XPATH_UNCLOSED_ERROR); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 15; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":16
 *     xmlerror.XML_XPATH_INVALID_PREDICATE_ERROR,
 *     xmlerror.XML_XPATH_UNCLOSED_ERROR,
 *     xmlerror.XML_XPATH_INVALID_CHAR_ERROR             # <<<<<<<<<<<<<< 
 * )
 * 
 */
__pyx_10 = PyInt_FromLong(XML_XPATH_INVALID_CHAR_ERROR); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_11 = PyTuple_New(6); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_11, 0, __pyx_2);
PyTuple_SET_ITEM(__pyx_11, 1, __pyx_8);
PyTuple_SET_ITEM(__pyx_11, 2, __pyx_1);
PyTuple_SET_ITEM(__pyx_11, 3, __pyx_6);
PyTuple_SET_ITEM(__pyx_11, 4, __pyx_9);
PyTuple_SET_ITEM(__pyx_11, 5, __pyx_10);
__pyx_2 = 0;
__pyx_8 = 0;
__pyx_1 = 0;
__pyx_6 = 0;
__pyx_9 = 0;
__pyx_10 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS);
__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = __pyx_11;
__pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":21
 * cdef object _XPATH_EVAL_ERRORS
 * _XPATH_EVAL_ERRORS = (
 *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
 *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
 */
__pyx_2 = PyInt_FromLong(XML_XPATH_UNDEF_VARIABLE_ERROR); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":22
 * _XPATH_EVAL_ERRORS = (
 *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,
 *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
 *     xmlerror.XML_XPATH_INVALID_OPERAND,
 */
__pyx_8 = PyInt_FromLong(XML_XPATH_UNDEF_PREFIX_ERROR); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 22; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":23
 *     xmlerror.XML_XPATH_UNDEF_VARIABLE_ERROR,
 *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
 *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_OPERAND,
 *     xmlerror.XML_XPATH_INVALID_TYPE,
 */
__pyx_1 = PyInt_FromLong(XML_XPATH_UNKNOWN_FUNC_ERROR); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 23; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":24
 *     xmlerror.XML_XPATH_UNDEF_PREFIX_ERROR,
 *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
 *     xmlerror.XML_XPATH_INVALID_OPERAND,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_TYPE,
 *     xmlerror.XML_XPATH_INVALID_ARITY,
 */
__pyx_6 = PyInt_FromLong(XML_XPATH_INVALID_OPERAND); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 24; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":25
 *     xmlerror.XML_XPATH_UNKNOWN_FUNC_ERROR,
 *     xmlerror.XML_XPATH_INVALID_OPERAND,
 *     xmlerror.XML_XPATH_INVALID_TYPE,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_ARITY,
 *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
 */
__pyx_9 = PyInt_FromLong(XML_XPATH_INVALID_TYPE); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 25; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":26
 *     xmlerror.XML_XPATH_INVALID_OPERAND,
 *     xmlerror.XML_XPATH_INVALID_TYPE,
 *     xmlerror.XML_XPATH_INVALID_ARITY,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
 *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
 */
__pyx_10 = PyInt_FromLong(XML_XPATH_INVALID_ARITY); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 26; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":27
 *     xmlerror.XML_XPATH_INVALID_TYPE,
 *     xmlerror.XML_XPATH_INVALID_ARITY,
 *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,             # <<<<<<<<<<<<<< 
 *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION
 * )
 */
__pyx_11 = PyInt_FromLong(XML_XPATH_INVALID_CTXT_SIZE); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 27; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":28
 *     xmlerror.XML_XPATH_INVALID_ARITY,
 *     xmlerror.XML_XPATH_INVALID_CTXT_SIZE,
 *     xmlerror.XML_XPATH_INVALID_CTXT_POSITION             # <<<<<<<<<<<<<< 
 * )
 * 
 */
__pyx_12 = PyInt_FromLong(XML_XPATH_INVALID_CTXT_POSITION); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 28; goto __pyx_L1;}
__pyx_13 = PyTuple_New(8); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_13, 0, __pyx_2);
PyTuple_SET_ITEM(__pyx_13, 1, __pyx_8);
PyTuple_SET_ITEM(__pyx_13, 2, __pyx_1);
PyTuple_SET_ITEM(__pyx_13, 3, __pyx_6);
PyTuple_SET_ITEM(__pyx_13, 4, __pyx_9);
PyTuple_SET_ITEM(__pyx_13, 5, __pyx_10);
PyTuple_SET_ITEM(__pyx_13, 6, __pyx_11);
PyTuple_SET_ITEM(__pyx_13, 7, __pyx_12);
__pyx_2 = 0;
__pyx_8 = 0;
__pyx_1 = 0;
__pyx_6 = 0;
__pyx_9 = 0;
__pyx_10 = 0;
__pyx_11 = 0;
__pyx_12 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS);
__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = __pyx_13;
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":95
 * 
 * cdef bint _XPATH_VERSION_WARNING_REQUIRED
 * if _LIBXML_VERSION_INT == 20627:             # <<<<<<<<<<<<<< 
 *     _XPATH_VERSION_WARNING_REQUIRED = 1
 * else:
 */
__pyx_7 = (__pyx_v_4lxml_5etree__LIBXML_VERSION_INT == 20627);
if (__pyx_7) {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":96
 * cdef bint _XPATH_VERSION_WARNING_REQUIRED
 * if _LIBXML_VERSION_INT == 20627:
 *     _XPATH_VERSION_WARNING_REQUIRED = 1             # <<<<<<<<<<<<<< 
 * else:
 *     _XPATH_VERSION_WARNING_REQUIRED = 0
 */
  __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 1;
  goto __pyx_L11;
}
/*else*/ {

  /* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":98
 *     _XPATH_VERSION_WARNING_REQUIRED = 1
 * else:
 *     _XPATH_VERSION_WARNING_REQUIRED = 0             # <<<<<<<<<<<<<< 
 * 
 * cdef class _XPathEvaluatorBase:
 */
  __pyx_v_4lxml_5etree__XPATH_VERSION_WARNING_REQUIRED = 0;
}
__pyx_L11:;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":218
 *     """
 *     cdef _Element _element
 *     def __init__(self, _Element element not None, *, namespaces=None,             # <<<<<<<<<<<<<< 
 *                  extensions=None, regexp=True):
 *         cdef xpath.xmlXPathContext* xpathCtxt
 */
Py_INCREF(Py_None);
__pyx_k247 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":219
 *     cdef _Element _element
 *     def __init__(self, _Element element not None, *, namespaces=None,
 *                  extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         cdef int ns_register_status
 */
Py_INCREF(Py_None);
__pyx_k248 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":219
 *     cdef _Element _element
 *     def __init__(self, _Element element not None, *, namespaces=None,
 *                  extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         cdef int ns_register_status
 */
Py_INCREF(Py_True);
__pyx_k249 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":283
 *     the 'regexp' boolean keyword (defaults to True).
 *     """
 *     def __init__(self, _ElementTree etree not None, *, namespaces=None,             # <<<<<<<<<<<<<< 
 *                  extensions=None, regexp=True):
 *         XPathElementEvaluator.__init__(
 */
Py_INCREF(Py_None);
__pyx_k250 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":284
 *     """
 *     def __init__(self, _ElementTree etree not None, *, namespaces=None,
 *                  extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces, 
 */
Py_INCREF(Py_None);
__pyx_k251 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":284
 *     """
 *     def __init__(self, _ElementTree etree not None, *, namespaces=None,
 *                  extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         XPathElementEvaluator.__init__(
 *             self, etree._context_node, namespaces=namespaces, 
 */
Py_INCREF(Py_True);
__pyx_k252 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":326
 * 
 * 
 * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<< 
 *                    regexp=True):
 *     """Creates an XPath evaluator for an ElementTree or an Element.
 */
Py_INCREF(Py_None);
__pyx_k253 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":326
 * 
 * 
 * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,             # <<<<<<<<<<<<<< 
 *                    regexp=True):
 *     """Creates an XPath evaluator for an ElementTree or an Element.
 */
Py_INCREF(Py_None);
__pyx_k254 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":327
 * 
 * def XPathEvaluator(etree_or_element, *, namespaces=None, extensions=None,
 *                    regexp=True):             # <<<<<<<<<<<<<< 
 *     """Creates an XPath evaluator for an ElementTree or an Element.
 * 
 */
Py_INCREF(Py_True);
__pyx_k255 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":359
 *     cdef readonly object path
 * 
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 */
Py_INCREF(Py_None);
__pyx_k256 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":359
 *     cdef readonly object path
 * 
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 */
Py_INCREF(Py_None);
__pyx_k257 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":359
 *     cdef readonly object path
 * 
 *     def __init__(self, path, *, namespaces=None, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         cdef xpath.xmlXPathContext* xpathCtxt
 *         _XPathEvaluatorBase.__init__(self, namespaces, extensions, regexp)
 */
Py_INCREF(Py_True);
__pyx_k258 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":411
 * cdef object _replace_strings
 * cdef object _find_namespaces
 * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub             # <<<<<<<<<<<<<< 
 * _find_namespaces = re.compile('({[^}]+})').findall
 * 
 */
__pyx_2 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 411; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":411
 * cdef object _replace_strings
 * cdef object _find_namespaces
 * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub             # <<<<<<<<<<<<<< 
 * _find_namespaces = re.compile('({[^}]+})').findall
 * 
 */
__pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 411; goto __pyx_L1;}
Py_INCREF(__pyx_k259p);
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_k259p);
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_8); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 411; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_8); __pyx_8 = 0;
__pyx_6 = PyObject_GetAttr(__pyx_1, __pyx_n_sub); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 411; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__replace_strings);
__pyx_v_4lxml_5etree__replace_strings = __pyx_6;
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":412
 * cdef object _find_namespaces
 * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub
 * _find_namespaces = re.compile('({[^}]+})').findall             # <<<<<<<<<<<<<< 
 * 
 * cdef class ETXPath(XPath):
 */
__pyx_9 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 412; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":412
 * cdef object _find_namespaces
 * _replace_strings = re.compile('("[^"]*")|(\'[^\']*\')').sub
 * _find_namespaces = re.compile('({[^}]+})').findall             # <<<<<<<<<<<<<< 
 * 
 * cdef class ETXPath(XPath):
 */
__pyx_10 = PyTuple_New(1); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 412; goto __pyx_L1;}
Py_INCREF(__pyx_k260p);
PyTuple_SET_ITEM(__pyx_10, 0, __pyx_k260p);
__pyx_11 = PyObject_CallObject(__pyx_9, __pyx_10); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 412; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;
__pyx_12 = PyObject_GetAttr(__pyx_11, __pyx_n_findall); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 412; goto __pyx_L1;}
Py_DECREF(__pyx_11); __pyx_11 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__find_namespaces);
__pyx_v_4lxml_5etree__find_namespaces = __pyx_12;
__pyx_12 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":421
 *     argument. All namespaces must be passed as part of the path string.
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,
 */
Py_INCREF(Py_None);
__pyx_k261 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xpath.pxi":421
 *     argument. All namespaces must be passed as part of the path string.
 *     """
 *     def __init__(self, path, *, extensions=None, regexp=True):             # <<<<<<<<<<<<<< 
 *         path, namespaces = self._nsextract_path(path)
 *         XPath.__init__(self, path, namespaces=namespaces,
 */
Py_INCREF(Py_True);
__pyx_k262 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":5
 * cimport xslt
 * 
 * class XSLTError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XSLT errors.
 *     """
 */
__pyx_13 = PyDict_New(); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":5
 * cimport xslt
 * 
 * class XSLTError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XSLT errors.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":5
 * cimport xslt
 * 
 * class XSLTError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XSLT errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_13, "__doc__", __pyx_k264p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_8, __pyx_13, __pyx_n_XSLTError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTError, __pyx_1) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 5; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_13); __pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":10
 *     pass
 * 
 * class XSLTParseError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error parsing a stylesheet document.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":10
 *     pass
 * 
 * class XSLTParseError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error parsing a stylesheet document.
 *     """
 */
__pyx_9 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_10 = PyTuple_New(1); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_10, 0, __pyx_9);
__pyx_9 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":10
 *     pass
 * 
 * class XSLTParseError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error parsing a stylesheet document.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k266p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_11 = __Pyx_CreateClass(__pyx_10, __pyx_6, __pyx_n_XSLTParseError, "lxml.etree"); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_10); __pyx_10 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTParseError, __pyx_11) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_11); __pyx_11 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":15
 *     pass
 * 
 * class XSLTApplyError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error running an XSL transformation.
 *     """
 */
__pyx_12 = PyDict_New(); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":15
 *     pass
 * 
 * class XSLTApplyError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error running an XSL transformation.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}
__pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":15
 *     pass
 * 
 * class XSLTApplyError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error running an XSL transformation.
 *     """
 */
if (PyDict_SetItemString(__pyx_12, "__doc__", __pyx_k268p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_8, __pyx_12, __pyx_n_XSLTApplyError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTApplyError, __pyx_1) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 15; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_12); __pyx_12 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":20
 *     pass
 * 
 * class XSLTSaveError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error serialising an XSLT result.
 *     """
 */
__pyx_13 = PyDict_New(); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":20
 *     pass
 * 
 * class XSLTSaveError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error serialising an XSLT result.
 *     """
 */
__pyx_9 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}
__pyx_10 = PyTuple_New(1); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_10, 0, __pyx_9);
__pyx_9 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":20
 *     pass
 * 
 * class XSLTSaveError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error serialising an XSLT result.
 *     """
 */
if (PyDict_SetItemString(__pyx_13, "__doc__", __pyx_k270p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}
__pyx_11 = __Pyx_CreateClass(__pyx_10, __pyx_13, __pyx_n_XSLTSaveError, "lxml.etree"); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_10); __pyx_10 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTSaveError, __pyx_11) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_11); __pyx_11 = 0;
Py_DECREF(__pyx_13); __pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":25
 *     pass
 * 
 * class XSLTExtensionError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error registering an XSLT extension.
 *     """
 */
__pyx_6 = PyDict_New(); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":25
 *     pass
 * 
 * class XSLTExtensionError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error registering an XSLT extension.
 *     """
 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}
__pyx_8 = PyTuple_New(1); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_8, 0, __pyx_2);
__pyx_2 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":25
 *     pass
 * 
 * class XSLTExtensionError(XSLTError):             # <<<<<<<<<<<<<< 
 *     """Error registering an XSLT extension.
 *     """
 */
if (PyDict_SetItemString(__pyx_6, "__doc__", __pyx_k272p) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_8, __pyx_6, __pyx_n_XSLTExtensionError, "lxml.etree"); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTExtensionError, __pyx_1) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 25; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":31
 * 
 * # version information
 * LIBXSLT_COMPILED_VERSION = __unpackIntVersion(xslt.LIBXSLT_VERSION)             # <<<<<<<<<<<<<< 
 * LIBXSLT_VERSION = __unpackIntVersion(xslt.xsltLibxsltVersion)
 * 
 */
__pyx_12 = __pyx_f_4lxml_5etree___unpackIntVersion(LIBXSLT_VERSION); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 31; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXSLT_COMPILED_VERSION, __pyx_12) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 31; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":32
 * # version information
 * LIBXSLT_COMPILED_VERSION = __unpackIntVersion(xslt.LIBXSLT_VERSION)
 * LIBXSLT_VERSION = __unpackIntVersion(xslt.xsltLibxsltVersion)             # <<<<<<<<<<<<<< 
 * 
 * 
 */
__pyx_9 = __pyx_f_4lxml_5etree___unpackIntVersion(xsltLibxsltVersion); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXSLT_VERSION, __pyx_9) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":162
 * 
 * cdef xslt.xsltDocLoaderFunc XSLT_DOC_DEFAULT_LOADER
 * XSLT_DOC_DEFAULT_LOADER = xslt.xsltDocDefaultLoader             # <<<<<<<<<<<<<< 
 * 
 * xslt.xsltSetLoaderFunc(_xslt_doc_loader)
 */
__pyx_v_4lxml_5etree_XSLT_DOC_DEFAULT_LOADER = xsltDocDefaultLoader;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":164
 * XSLT_DOC_DEFAULT_LOADER = xslt.xsltDocDefaultLoader
 * 
 * xslt.xsltSetLoaderFunc(_xslt_doc_loader)             # <<<<<<<<<<<<<< 
 * 
 * ################################################################################
 */
xsltSetLoaderFunc(__pyx_f_4lxml_5etree__xslt_doc_loader);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":182
 *     """
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<< 
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 */
Py_INCREF(Py_True);
__pyx_k273 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":182
 *     """
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<< 
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 */
Py_INCREF(Py_True);
__pyx_k274 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":182
 *     """
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,             # <<<<<<<<<<<<<< 
 *                  read_network=True, write_network=True):
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 */
Py_INCREF(Py_True);
__pyx_k275 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":183
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,
 *                  read_network=True, write_network=True):             # <<<<<<<<<<<<<< 
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 *         if self._prefs is NULL:
 */
Py_INCREF(Py_True);
__pyx_k276 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":183
 *     cdef xslt.xsltSecurityPrefs* _prefs
 *     def __init__(self, *, read_file=True, write_file=True, create_dir=True,
 *                  read_network=True, write_network=True):             # <<<<<<<<<<<<<< 
 *         self._prefs = xslt.xsltNewSecurityPrefs()
 *         if self._prefs is NULL:
 */
Py_INCREF(Py_True);
__pyx_k277 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":272
 *     cdef _ErrorLog _error_log
 * 
 *     def __init__(self, xslt_input, *, extensions=None, regexp=True,             # <<<<<<<<<<<<<< 
 *                  access_control=None):
 *         cdef xslt.xsltStylesheet* c_style
 */
Py_INCREF(Py_None);
__pyx_k278 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":272
 *     cdef _ErrorLog _error_log
 * 
 *     def __init__(self, xslt_input, *, extensions=None, regexp=True,             # <<<<<<<<<<<<<< 
 *                  access_control=None):
 *         cdef xslt.xsltStylesheet* c_style
 */
Py_INCREF(Py_True);
__pyx_k279 = Py_True;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":273
 * 
 *     def __init__(self, xslt_input, *, extensions=None, regexp=True,
 *                  access_control=None):             # <<<<<<<<<<<<<< 
 *         cdef xslt.xsltStylesheet* c_style
 *         cdef xmlDoc* c_doc
 */
Py_INCREF(Py_None);
__pyx_k280 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":332
 *             return self._error_log.copy()
 * 
 *     def apply(self, _input, *, profile_run=False, **_kw):             # <<<<<<<<<<<<<< 
 *         return self(_input, profile_run=profile_run, **_kw)
 * 
 */
Py_INCREF(Py_False);
__pyx_k281 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":363
 *         return new_xslt
 * 
 *     def __call__(self, _input, *, profile_run=False, **_kw):             # <<<<<<<<<<<<<< 
 *         cdef _XSLTContext context
 *         cdef _XSLTResolverContext resolver_context
 */
Py_INCREF(Py_False);
__pyx_k282 = Py_False;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":566
 * # functions like "output" and "write" are a potential security risk, but we
 * # rely on the user to configure XSLTAccessControl as needed
 * xslt.xsltRegisterAllExtras()             # <<<<<<<<<<<<<< 
 * 
 * # enable EXSLT support for XSLT
 */
xsltRegisterAllExtras();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":569
 * 
 * # enable EXSLT support for XSLT
 * xslt.exsltRegisterAll()             # <<<<<<<<<<<<<< 
 * 
 * cdef void initTransformDict(xslt.xsltTransformContext* transform_ctxt):
 */
exsltRegisterAll();

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":579
 * 
 * cdef object _FIND_PI_ATTRIBUTES
 * _FIND_PI_ATTRIBUTES = re.compile(r'\s+(\w+)\s*=\s*["\']([^"\']+)["\']', re.U).findall             # <<<<<<<<<<<<<< 
 * 
 * cdef object _RE_PI_HREF
 */
__pyx_10 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 579; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":579
 * 
 * cdef object _FIND_PI_ATTRIBUTES
 * _FIND_PI_ATTRIBUTES = re.compile(r'\s+(\w+)\s*=\s*["\']([^"\']+)["\']', re.U).findall             # <<<<<<<<<<<<<< 
 * 
 * cdef object _RE_PI_HREF
 */
__pyx_11 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_U); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 579; goto __pyx_L1;}
__pyx_13 = PyTuple_New(2); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 579; goto __pyx_L1;}
Py_INCREF(__pyx_k283p);
PyTuple_SET_ITEM(__pyx_13, 0, __pyx_k283p);
PyTuple_SET_ITEM(__pyx_13, 1, __pyx_11);
__pyx_11 = 0;
__pyx_2 = PyObject_CallObject(__pyx_10, __pyx_13); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 579; goto __pyx_L1;}
Py_DECREF(__pyx_10); __pyx_10 = 0;
Py_DECREF(__pyx_13); __pyx_13 = 0;
__pyx_8 = PyObject_GetAttr(__pyx_2, __pyx_n_findall); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 579; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES);
__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = __pyx_8;
__pyx_8 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":582
 * 
 * cdef object _RE_PI_HREF
 * _RE_PI_HREF = re.compile(r'\s+href\s*=\s*["\']([^"\']+)["\']')             # <<<<<<<<<<<<<< 
 * 
 * cdef object _FIND_PI_HREF
 */
__pyx_1 = PyObject_GetAttr(__pyx_v_4lxml_5etree_re, __pyx_n_compile); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 582; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":582
 * 
 * cdef object _RE_PI_HREF
 * _RE_PI_HREF = re.compile(r'\s+href\s*=\s*["\']([^"\']+)["\']')             # <<<<<<<<<<<<<< 
 * 
 * cdef object _FIND_PI_HREF
 */
__pyx_6 = PyTuple_New(1); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 582; goto __pyx_L1;}
Py_INCREF(__pyx_k284p);
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_k284p);
__pyx_12 = PyObject_CallObject(__pyx_1, __pyx_6); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 582; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_v_4lxml_5etree__RE_PI_HREF);
__pyx_v_4lxml_5etree__RE_PI_HREF = __pyx_12;
__pyx_12 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":585
 * 
 * cdef object _FIND_PI_HREF
 * _FIND_PI_HREF = _RE_PI_HREF.findall             # <<<<<<<<<<<<<< 
 * 
 * cdef object _REPLACE_PI_HREF
 */
__pyx_9 = PyObject_GetAttr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_findall); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 585; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree__FIND_PI_HREF);
__pyx_v_4lxml_5etree__FIND_PI_HREF = __pyx_9;
__pyx_9 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":588
 * 
 * cdef object _REPLACE_PI_HREF
 * _REPLACE_PI_HREF = _RE_PI_HREF.sub             # <<<<<<<<<<<<<< 
 * 
 * cdef XPath __findStylesheetByID
 */
__pyx_11 = PyObject_GetAttr(__pyx_v_4lxml_5etree__RE_PI_HREF, __pyx_n_sub); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 588; goto __pyx_L1;}
Py_DECREF(__pyx_v_4lxml_5etree__REPLACE_PI_HREF);
__pyx_v_4lxml_5etree__REPLACE_PI_HREF = __pyx_11;
__pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":591
 * 
 * cdef XPath __findStylesheetByID
 * __findStylesheetByID = None             # <<<<<<<<<<<<<< 
 * 
 * cdef _findStylesheetByID(_Document doc, id):
 */
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID));
__pyx_v_4lxml_5etree___findStylesheetByID = ((struct __pyx_obj_4lxml_5etree_XPath *)Py_None);

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":602
 * 
 * cdef class _XSLTProcessingInstruction(PIBase):
 *     def parseXSL(self, parser=None):             # <<<<<<<<<<<<<< 
 *         """Try to parse the stylesheet referenced by this PI and return an
 *         ElementTree for it.  If the stylesheet is embedded in the same
 */
Py_INCREF(Py_None);
__pyx_k285 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xslt.pxi":668
 *             self.text = text + attrib
 * 
 *     def get(self, key, default=None):             # <<<<<<<<<<<<<< 
 *         for attr, value in _FIND_PI_ATTRIBUTES(' ' + self.text):
 *             if attr == key:
 */
Py_INCREF(Py_None);
__pyx_k286 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2334
 * # Validation
 * 
 * class DocumentInvalid(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Validation error.  Raised by all document validators when their
 *     ``assertValid(tree)`` method fails.
 */
__pyx_10 = PyDict_New(); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2334
 * # Validation
 * 
 * class DocumentInvalid(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Validation error.  Raised by all document validators when their
 *     ``assertValid(tree)`` method fails.
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/lxml.etree.pyx":2334
 * # Validation
 * 
 * class DocumentInvalid(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Validation error.  Raised by all document validators when their
 *     ``assertValid(tree)`` method fails.
 */
if (PyDict_SetItemString(__pyx_10, "__doc__", __pyx_k288p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_10, __pyx_n_DocumentInvalid, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_DocumentInvalid, __pyx_8) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 2334; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":4
 * cimport dtdvalid
 * 
 * class DTDError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for DTD errors.
 *     """
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":4
 * cimport dtdvalid
 * 
 * class DTDError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for DTD errors.
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":4
 * cimport dtdvalid
 * 
 * class DTDError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for DTD errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k290p) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_1, __pyx_n_DTDError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_DTDError, __pyx_9) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":9
 *     pass
 * 
 * class DTDParseError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing a DTD.
 *     """
 */
__pyx_11 = PyDict_New(); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":9
 *     pass
 * 
 * class DTDParseError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing a DTD.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_DTDError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":9
 *     pass
 * 
 * class DTDParseError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing a DTD.
 *     """
 */
if (PyDict_SetItemString(__pyx_11, "__doc__", __pyx_k292p) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_11, __pyx_n_DTDParseError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_DTDParseError, __pyx_8) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_11); __pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":14
 *     pass
 * 
 * class DTDValidateError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a DTD.
 *     """
 */
__pyx_10 = PyDict_New(); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":14
 *     pass
 * 
 * class DTDValidateError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a DTD.
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_DTDError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":14
 *     pass
 * 
 * class DTDValidateError(DTDError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a DTD.
 *     """
 */
if (PyDict_SetItemString(__pyx_10, "__doc__", __pyx_k294p) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_10, __pyx_n_DTDValidateError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_DTDValidateError, __pyx_9) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":30
 *     """
 *     cdef tree.xmlDtd* _c_dtd
 *     def __init__(self, file=None, external_id=None):             # <<<<<<<<<<<<<< 
 *         self._c_dtd = NULL
 *         if file is not None:
 */
Py_INCREF(Py_None);
__pyx_k295 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/dtd.pxi":30
 *     """
 *     cdef tree.xmlDtd* _c_dtd
 *     def __init__(self, file=None, external_id=None):             # <<<<<<<<<<<<<< 
 *         self._c_dtd = NULL
 *         if file is not None:
 */
Py_INCREF(Py_None);
__pyx_k296 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":4
 * cimport relaxng
 * 
 * class RelaxNGError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for RelaxNG errors.
 *     """
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":4
 * cimport relaxng
 * 
 * class RelaxNGError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for RelaxNG errors.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":4
 * cimport relaxng
 * 
 * class RelaxNGError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class for RelaxNG errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k298p) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_RelaxNGError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGError, __pyx_8) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":9
 *     pass
 * 
 * class RelaxNGParseError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as RelaxNG.
 *     """
 */
__pyx_11 = PyDict_New(); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":9
 *     pass
 * 
 * class RelaxNGParseError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as RelaxNG.
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":9
 *     pass
 * 
 * class RelaxNGParseError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as RelaxNG.
 *     """
 */
if (PyDict_SetItemString(__pyx_11, "__doc__", __pyx_k300p) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_11, __pyx_n_RelaxNGParseError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGParseError, __pyx_9) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_11); __pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":14
 *     pass
 * 
 * class RelaxNGValidateError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a RelaxNG schema.
 *     """
 */
__pyx_10 = PyDict_New(); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":14
 *     pass
 * 
 * class RelaxNGValidateError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a RelaxNG schema.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":14
 *     pass
 * 
 * class RelaxNGValidateError(RelaxNGError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a RelaxNG schema.
 *     """
 */
if (PyDict_SetItemString(__pyx_10, "__doc__", __pyx_k302p) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_10, __pyx_n_RelaxNGValidateError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGValidateError, __pyx_8) < 0) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":27
 *     """
 *     cdef relaxng.xmlRelaxNG* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k303 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/relaxng.pxi":27
 *     """
 *     cdef relaxng.xmlRelaxNG* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k304 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":4
 * cimport xmlschema
 * 
 * class XMLSchemaError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XML Schema errors
 *     """
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":4
 * cimport xmlschema
 * 
 * class XMLSchemaError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XML Schema errors
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":4
 * cimport xmlschema
 * 
 * class XMLSchemaError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all XML Schema errors
 *     """
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k306p) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_1, __pyx_n_XMLSchemaError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaError, __pyx_9) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":9
 *     pass
 * 
 * class XMLSchemaParseError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as XML Schema.
 *     """
 */
__pyx_11 = PyDict_New(); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":9
 *     pass
 * 
 * class XMLSchemaParseError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as XML Schema.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":9
 *     pass
 * 
 * class XMLSchemaParseError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as XML Schema.
 *     """
 */
if (PyDict_SetItemString(__pyx_11, "__doc__", __pyx_k308p) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_11, __pyx_n_XMLSchemaParseError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaParseError, __pyx_8) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_11); __pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":14
 *     pass
 * 
 * class XMLSchemaValidateError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with an XML Schema.
 *     """
 */
__pyx_10 = PyDict_New(); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":14
 *     pass
 * 
 * class XMLSchemaValidateError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with an XML Schema.
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":14
 *     pass
 * 
 * class XMLSchemaValidateError(XMLSchemaError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with an XML Schema.
 *     """
 */
if (PyDict_SetItemString(__pyx_10, "__doc__", __pyx_k310p) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_10, __pyx_n_XMLSchemaValidateError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaValidateError, __pyx_9) < 0) {__pyx_filename = __pyx_f[17]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":26
 *     """
 *     cdef xmlschema.xmlSchema* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k311 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/xmlschema.pxi":26
 *     """
 *     cdef xmlschema.xmlSchema* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k312 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":50
 * '''
 * 
 * class SchematronError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all Schematron errors.
 *     """
 */
__pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":50
 * '''
 * 
 * class SchematronError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all Schematron errors.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":50
 * '''
 * 
 * class SchematronError(LxmlError):             # <<<<<<<<<<<<<< 
 *     """Base class of all Schematron errors.
 *     """
 */
if (PyDict_SetItemString(__pyx_1, "__doc__", __pyx_k314p) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_1, __pyx_n_SchematronError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_SchematronError, __pyx_8) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 50; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":55
 *     pass
 * 
 * class SchematronParseError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as Schematron schema.
 *     """
 */
__pyx_11 = PyDict_New(); if (unlikely(!__pyx_11)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":55
 *     pass
 * 
 * class SchematronParseError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as Schematron schema.
 *     """
 */
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronError); if (unlikely(!__pyx_6)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}
__pyx_12 = PyTuple_New(1); if (unlikely(!__pyx_12)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_12, 0, __pyx_6);
__pyx_6 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":55
 *     pass
 * 
 * class SchematronParseError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while parsing an XML document as Schematron schema.
 *     """
 */
if (PyDict_SetItemString(__pyx_11, "__doc__", __pyx_k316p) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}
__pyx_9 = __Pyx_CreateClass(__pyx_12, __pyx_11, __pyx_n_SchematronParseError, "lxml.etree"); if (unlikely(!__pyx_9)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}
Py_DECREF(__pyx_12); __pyx_12 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_SchematronParseError, __pyx_9) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 55; goto __pyx_L1;}
Py_DECREF(__pyx_9); __pyx_9 = 0;
Py_DECREF(__pyx_11); __pyx_11 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":60
 *     pass
 * 
 * class SchematronValidateError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a Schematron schema.
 *     """
 */
__pyx_10 = PyDict_New(); if (unlikely(!__pyx_10)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":60
 *     pass
 * 
 * class SchematronValidateError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a Schematron schema.
 *     """
 */
__pyx_13 = __Pyx_GetName(__pyx_m, __pyx_n_SchematronError); if (unlikely(!__pyx_13)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_13);
__pyx_13 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":60
 *     pass
 * 
 * class SchematronValidateError(SchematronError):             # <<<<<<<<<<<<<< 
 *     """Error while validating an XML document with a Schematron schema.
 *     """
 */
if (PyDict_SetItemString(__pyx_10, "__doc__", __pyx_k318p) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}
__pyx_8 = __Pyx_CreateClass(__pyx_2, __pyx_10, __pyx_n_SchematronValidateError, "lxml.etree"); if (unlikely(!__pyx_8)) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_SchematronValidateError, __pyx_8) < 0) {__pyx_filename = __pyx_f[18]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(__pyx_8); __pyx_8 = 0;
Py_DECREF(__pyx_10); __pyx_10 = 0;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":76
 *     """
 *     cdef schematron.xmlSchematron* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k319 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/schematron.pxi":76
 *     """
 *     cdef schematron.xmlSchematron* _c_schema
 *     def __init__(self, etree=None, file=None):             # <<<<<<<<<<<<<< 
 *         cdef _Document doc
 *         cdef _Element root_node
 */
Py_INCREF(Py_None);
__pyx_k320 = Py_None;

/* "/home/sbehnel/source/Python/lxml/lxml-HEAD/RELEASE-DIR/lxml-2.0alpha6/src/lxml/public-api.pxi":153
 *     matcher._initTagMatch(tag)
 * 
 * cdef public api tree.xmlNs* findOrBuildNodeNsPrefix(             # <<<<<<<<<<<<<< 
 *     _Document doc, xmlNode* c_node, char* href, char* prefix) except NULL:
 *     if doc is None:
 */
if (__Pyx_RegisterCleanup()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
return;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_8);
Py_XDECREF(__pyx_9);
Py_XDECREF(__pyx_10);
Py_XDECREF(__pyx_11);
Py_XDECREF(__pyx_12);
Py_XDECREF(__pyx_13);
__Pyx_AddTraceback("lxml.etree");
}

static PyObject* cleanup(PyObject *self, PyObject *unused) {
/*--- Global cleanup code ---*/
Py_DECREF((PyObject *)__pyx_v_4lxml_5etree___findStylesheetByID); __pyx_v_4lxml_5etree___findStylesheetByID = 0;
Py_DECREF(__pyx_v_4lxml_5etree__REPLACE_PI_HREF); __pyx_v_4lxml_5etree__REPLACE_PI_HREF = 0;
Py_DECREF(__pyx_v_4lxml_5etree__FIND_PI_HREF); __pyx_v_4lxml_5etree__FIND_PI_HREF = 0;
Py_DECREF(__pyx_v_4lxml_5etree__RE_PI_HREF); __pyx_v_4lxml_5etree__RE_PI_HREF = 0;
Py_DECREF(__pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES); __pyx_v_4lxml_5etree__FIND_PI_ATTRIBUTES = 0;
Py_DECREF(__pyx_v_4lxml_5etree__find_namespaces); __pyx_v_4lxml_5etree__find_namespaces = 0;
Py_DECREF(__pyx_v_4lxml_5etree__replace_strings); __pyx_v_4lxml_5etree__replace_strings = 0;
Py_DECREF(__pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS); __pyx_v_4lxml_5etree__XPATH_EVAL_ERRORS = 0;
Py_DECREF(__pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS); __pyx_v_4lxml_5etree__XPATH_SYNTAX_ERRORS = 0;
Py_DECREF(__pyx_v_4lxml_5etree__find_id_attributes); __pyx_v_4lxml_5etree__find_id_attributes = 0;
Py_DECREF(__pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE); __pyx_v_4lxml_5etree___ITERPARSE_CHUNK_SIZE = 0;
Py_DECREF(__pyx_v_4lxml_5etree_inspect_getargspec); __pyx_v_4lxml_5etree_inspect_getargspec = 0;
Py_DECREF((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER); __pyx_v_4lxml_5etree___DEFAULT_HTML_PARSER = 0;
Py_DECREF((PyObject *)__pyx_v_4lxml_5etree___DEFAULT_XML_PARSER); __pyx_v_4lxml_5etree___DEFAULT_XML_PARSER = 0;
Py_DECREF(__pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT); __pyx_v_4lxml_5etree___GLOBAL_PARSER_CONTEXT = 0;
Py_DECREF(__pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES); __pyx_v_4lxml_5etree___FUNCTION_NAMESPACE_REGISTRIES = 0;
Py_DECREF((PyObject *)__pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP); __pyx_v_4lxml_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = 0;
Py_DECREF(__pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE); __pyx_v_4lxml_5etree_ELEMENT_CLASS_LOOKUP_STATE = 0;
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_TYPES); __pyx_v_4lxml_5etree___ERROR_TYPES = 0;
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_DOMAINS); __pyx_v_4lxml_5etree___ERROR_DOMAINS = 0;
Py_DECREF(__pyx_v_4lxml_5etree___ERROR_LEVELS); __pyx_v_4lxml_5etree___ERROR_LEVELS = 0;
Py_DECREF(__pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG); __pyx_v_4lxml_5etree___GLOBAL_ERROR_LOG = 0;
Py_DECREF(__pyx_v_4lxml_5etree___HAS_XML_ENCODING); __pyx_v_4lxml_5etree___HAS_XML_ENCODING = 0;
Py_DECREF(__pyx_v_4lxml_5etree___REPLACE_XML_ENCODING); __pyx_v_4lxml_5etree___REPLACE_XML_ENCODING = 0;
Py_DECREF(__pyx_v_4lxml_5etree___RE_XML_ENCODING); __pyx_v_4lxml_5etree___RE_XML_ENCODING = 0;
Py_DECREF(__pyx_v_4lxml_5etree__initError); __pyx_v_4lxml_5etree__initError = 0;
Py_DECREF(__pyx_v_4lxml_5etree__LxmlError); __pyx_v_4lxml_5etree__LxmlError = 0;
Py_DECREF(__pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES); __pyx_v_4lxml_5etree__DEFAULT_NAMESPACE_PREFIXES = 0;
Py_DECREF(__pyx_v_4lxml_5etree__FILENAME_ENCODING); __pyx_v_4lxml_5etree__FILENAME_ENCODING = 0;
Py_DECREF(__pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT); __pyx_v_4lxml_5etree_EMPTY_READ_ONLY_DICT = 0;
Py_DECREF(__pyx_v_4lxml_5etree_ITER_EMPTY); __pyx_v_4lxml_5etree_ITER_EMPTY = 0;
Py_DECREF(__pyx_v_4lxml_5etree_re); __pyx_v_4lxml_5etree_re = 0;
Py_DECREF(__pyx_v_4lxml_5etree_sys); __pyx_v_4lxml_5etree_sys = 0;
Py_DECREF(__pyx_v_4lxml_5etree__elementpath); __pyx_v_4lxml_5etree__elementpath = 0;
Py_DECREF(__pyx_v_4lxml_5etree_os_path_join); __pyx_v_4lxml_5etree_os_path_join = 0;
Py_DECREF(__pyx_v_4lxml_5etree_set); __pyx_v_4lxml_5etree_set = 0;
/*--- Type import cleanup code ---*/
Py_DECREF(((PyObject*)__pyx_ptype_6python_slice));
/*--- Builtin cleanup code ---*/
Py_DECREF(__pyx_builtin_AttributeError); __pyx_builtin_AttributeError = 0;
Py_DECREF(__pyx_builtin_Exception); __pyx_builtin_Exception = 0;
Py_DECREF(__pyx_builtin_SyntaxError); __pyx_builtin_SyntaxError = 0;
Py_DECREF(__pyx_builtin_super); __pyx_builtin_super = 0;
Py_DECREF(__pyx_builtin_ValueError); __pyx_builtin_ValueError = 0;
Py_DECREF(__pyx_builtin_IndexError); __pyx_builtin_IndexError = 0;
Py_DECREF(__pyx_builtin_TypeError); __pyx_builtin_TypeError = 0;
Py_DECREF(__pyx_builtin_id); __pyx_builtin_id = 0;
Py_DECREF(__pyx_builtin_FutureWarning); __pyx_builtin_FutureWarning = 0;
Py_DECREF(__pyx_builtin_KeyError); __pyx_builtin_KeyError = 0;
Py_DECREF(__pyx_builtin_StopIteration); __pyx_builtin_StopIteration = 0;
Py_DECREF(__pyx_builtin_UnicodeDecodeError); __pyx_builtin_UnicodeDecodeError = 0;
Py_DECREF(__pyx_builtin_IOError); __pyx_builtin_IOError = 0;
Py_DECREF(__pyx_builtin_LookupError); __pyx_builtin_LookupError = 0;
Py_DECREF(__pyx_builtin_open); __pyx_builtin_open = 0;
Py_DECREF(__pyx_builtin_NotImplementedError); __pyx_builtin_NotImplementedError = 0;
Py_DECREF(__pyx_builtin_RuntimeError); __pyx_builtin_RuntimeError = 0;
Py_DECREF(__pyx_builtin_AssertionError); __pyx_builtin_AssertionError = 0;
/*--- Intern cleanup code ---*/
Py_DECREF(__pyx_num_0); __pyx_num_0 = 0;
Py_DECREF(__pyx_num_32768); __pyx_num_32768 = 0;
Py_DECREF(__pyx_num_4); __pyx_num_4 = 0;
Py_DECREF(__pyx_num_neg_300); __pyx_num_neg_300 = 0;
Py_DECREF(__pyx_num_neg_200); __pyx_num_neg_200 = 0;
Py_DECREF(__pyx_num_neg_100); __pyx_num_neg_100 = 0;
Py_DECREF(__pyx_num_1); __pyx_num_1 = 0;
Py_DECREF(__pyx_num_neg_1); __pyx_num_neg_1 = 0;
Py_DECREF(__pyx_num_2); __pyx_num_2 = 0;
Py_DECREF(__pyx_n_feed); __pyx_n_feed = 0;
Py_DECREF(__pyx_n_UNICODE); __pyx_n_UNICODE = 0;
Py_DECREF(__pyx_n_code); __pyx_n_code = 0;
Py_DECREF(__pyx_n_registerNamespace); __pyx_n_registerNamespace = 0;
Py_DECREF(__pyx_n_LxmlRegistryError); __pyx_n_LxmlRegistryError = 0;
Py_DECREF(__pyx_n_NamespaceRegistryError); __pyx_n_NamespaceRegistryError = 0;
Py_DECREF(__pyx_n___str__); __pyx_n___str__ = 0;
Py_DECREF(__pyx_n_xmlschema); __pyx_n_xmlschema = 0;
Py_DECREF(__pyx_n__init); __pyx_n__init = 0;
Py_DECREF(__pyx_n_XPathSyntaxError); __pyx_n_XPathSyntaxError = 0;
Py_DECREF(__pyx_n_entity); __pyx_n_entity = 0;
Py_DECREF(__pyx_n_XSLTExtensionError); __pyx_n_XSLTExtensionError = 0;
Py_DECREF(__pyx_n_has_key); __pyx_n_has_key = 0;
Py_DECREF(__pyx_n_LIBXSLT_VERSION); __pyx_n_LIBXSLT_VERSION = 0;
Py_DECREF(__pyx_n_filter_from_warnings); __pyx_n_filter_from_warnings = 0;
Py_DECREF(__pyx_n_relaxng); __pyx_n_relaxng = 0;
Py_DECREF(__pyx_n_remove_blank_text); __pyx_n_remove_blank_text = 0;
Py_DECREF(__pyx_n_filename); __pyx_n_filename = 0;
Py_DECREF(__pyx_n_find); __pyx_n_find = 0;
Py_DECREF(__pyx_n_set_default_parser); __pyx_n_set_default_parser = 0;
Py_DECREF(__pyx_n_no_network); __pyx_n_no_network = 0;
Py_DECREF(__pyx_n_xml); __pyx_n_xml = 0;
Py_DECREF(__pyx_n_LxmlSyntaxError); __pyx_n_LxmlSyntaxError = 0;
Py_DECREF(__pyx_n_group); __pyx_n_group = 0;
Py_DECREF(__pyx_n_setElementClassLookup); __pyx_n_setElementClassLookup = 0;
Py_DECREF(__pyx_n_IGNORECASE); __pyx_n_IGNORECASE = 0;
Py_DECREF(__pyx_n_ErrorLevels); __pyx_n_ErrorLevels = 0;
Py_DECREF(__pyx_n___class__); __pyx_n___class__ = 0;
Py_DECREF(__pyx_n___cmp__); __pyx_n___cmp__ = 0;
Py_DECREF(__pyx_n_XML); __pyx_n_XML = 0;
Py_DECREF(__pyx_n_add); __pyx_n_add = 0;
Py_DECREF(__pyx_n_XSLTSaveError); __pyx_n_XSLTSaveError = 0;
Py_DECREF(__pyx_n__setroot); __pyx_n__setroot = 0;
Py_DECREF(__pyx_n_filter_from_level); __pyx_n_filter_from_level = 0;
Py_DECREF(__pyx_n___call__); __pyx_n___call__ = 0;
Py_DECREF(__pyx_n_IOError); __pyx_n_IOError = 0;
Py_DECREF(__pyx_n_getargspec); __pyx_n_getargspec = 0;
Py_DECREF(__pyx_n_XSLTParseError); __pyx_n_XSLTParseError = 0;
Py_DECREF(__pyx_n_SyntaxError); __pyx_n_SyntaxError = 0;
Py_DECREF(__pyx_n_match); __pyx_n_match = 0;
Py_DECREF(__pyx_n_split); __pyx_n_split = 0;
Py_DECREF(__pyx_n_startswith); __pyx_n_startswith = 0;
Py_DECREF(__pyx_n_wb); __pyx_n_wb = 0;
Py_DECREF(__pyx_n_remove_pis); __pyx_n_remove_pis = 0;
Py_DECREF(__pyx_n_XPathEvalError); __pyx_n_XPathEvalError = 0;
Py_DECREF(__pyx_n___getitem__); __pyx_n___getitem__ = 0;
Py_DECREF(__pyx_n_get); __pyx_n_get = 0;
Py_DECREF(__pyx_n_read); __pyx_n_read = 0;
Py_DECREF(__pyx_n___deepcopy__); __pyx_n___deepcopy__ = 0;
Py_DECREF(__pyx_n_XMLSchemaError); __pyx_n_XMLSchemaError = 0;
Py_DECREF(__pyx_n_dc); __pyx_n_dc = 0;
Py_DECREF(__pyx_n_ParseError); __pyx_n_ParseError = 0;
Py_DECREF(__pyx_n_write_c14n); __pyx_n_write_c14n = 0;
Py_DECREF(__pyx_n_C14NError); __pyx_n_C14NError = 0;
Py_DECREF(__pyx_n_Set); __pyx_n_Set = 0;
Py_DECREF(__pyx_n_tostring); __pyx_n_tostring = 0;
Py_DECREF(__pyx_n___builtin__); __pyx_n___builtin__ = 0;
Py_DECREF(__pyx_n_namespaces); __pyx_n_namespaces = 0;
Py_DECREF(__pyx_n_iteritems); __pyx_n_iteritems = 0;
Py_DECREF(__pyx_n_with_tail); __pyx_n_with_tail = 0;
Py_DECREF(__pyx_n_IndexError); __pyx_n_IndexError = 0;
Py_DECREF(__pyx_n_iterkeys); __pyx_n_iterkeys = 0;
Py_DECREF(__pyx_n_XPathError); __pyx_n_XPathError = 0;
Py_DECREF(__pyx_n___delitem__); __pyx_n___delitem__ = 0;
Py_DECREF(__pyx_n___reversed__); __pyx_n___reversed__ = 0;
Py_DECREF(__pyx_n_resolve); __pyx_n_resolve = 0;
Py_DECREF(__pyx_n___nonzero__); __pyx_n___nonzero__ = 0;
Py_DECREF(__pyx_n_name); __pyx_n_name = 0;
Py_DECREF(__pyx_n_level); __pyx_n_level = 0;
Py_DECREF(__pyx_n_DocumentInvalid); __pyx_n_DocumentInvalid = 0;
Py_DECREF(__pyx_n_iter); __pyx_n_iter = 0;
Py_DECREF(__pyx_n_Entity); __pyx_n_Entity = 0;
Py_DECREF(__pyx_n_error_log); __pyx_n_error_log = 0;
Py_DECREF(__pyx_n_getLogger); __pyx_n_getLogger = 0;
Py_DECREF(__pyx_n_remove_comments); __pyx_n_remove_comments = 0;
Py_DECREF(__pyx_n_href); __pyx_n_href = 0;
Py_DECREF(__pyx_n_parseXSL); __pyx_n_parseXSL = 0;
Py_DECREF(__pyx_n__accepted_domains); __pyx_n__accepted_domains = 0;
Py_DECREF(__pyx_n___copy__); __pyx_n___copy__ = 0;
Py_DECREF(__pyx_n_ASCII); __pyx_n_ASCII = 0;
Py_DECREF(__pyx_n_xsl); __pyx_n_xsl = 0;
Py_DECREF(__pyx_n_upper); __pyx_n_upper = 0;
Py_DECREF(__pyx_n_domain); __pyx_n_domain = 0;
Py_DECREF(__pyx_n_set); __pyx_n_set = 0;
Py_DECREF(__pyx_n_filter_domains); __pyx_n_filter_domains = 0;
Py_DECREF(__pyx_n_regexp); __pyx_n_regexp = 0;
Py_DECREF(__pyx_n_strip); __pyx_n_strip = 0;
Py_DECREF(__pyx_n_getvalue); __pyx_n_getvalue = 0;
Py_DECREF(__pyx_n___dict__); __pyx_n___dict__ = 0;
Py_DECREF(__pyx_n_resolve_string); __pyx_n_resolve_string = 0;
Py_DECREF(__pyx_n_remove); __pyx_n_remove = 0;
Py_DECREF(__pyx_n_xs); __pyx_n_xs = 0;
Py_DECREF(__pyx_n__ParserDictionaryContext); __pyx_n__ParserDictionaryContext = 0;
Py_DECREF(__pyx_n_addnext); __pyx_n_addnext = 0;
Py_DECREF(__pyx_n_append); __pyx_n_append = 0;
Py_DECREF(__pyx_n_load_dtd); __pyx_n_load_dtd = 0;
Py_DECREF(__pyx_n_attribute_defaults); __pyx_n_attribute_defaults = 0;
Py_DECREF(__pyx_n_index); __pyx_n_index = 0;
Py_DECREF(__pyx_n_ERR_UNDECLARED_ENTITY); __pyx_n_ERR_UNDECLARED_ENTITY = 0;
Py_DECREF(__pyx_n_ElementTree); __pyx_n_ElementTree = 0;
Py_DECREF(__pyx_n_SubElement); __pyx_n_SubElement = 0;
Py_DECREF(__pyx_n_getdefaultencoding); __pyx_n_getdefaultencoding = 0;
Py_DECREF(__pyx_n___contains__); __pyx_n___contains__ = 0;
Py_DECREF(__pyx_n_findtext); __pyx_n_findtext = 0;
Py_DECREF(__pyx_n_domain_name); __pyx_n_domain_name = 0;
Py_DECREF(__pyx_n_findall); __pyx_n_findall = 0;
Py_DECREF(__pyx_n_level_name); __pyx_n_level_name = 0;
Py_DECREF(__pyx_n_re); __pyx_n_re = 0;
Py_DECREF(__pyx_n_getchildren); __pyx_n_getchildren = 0;
Py_DECREF(__pyx_n_WARNING); __pyx_n_WARNING = 0;
Py_DECREF(__pyx_n_tail); __pyx_n_tail = 0;
Py_DECREF(__pyx_n_LxmlError); __pyx_n_LxmlError = 0;
Py_DECREF(__pyx_n_rb); __pyx_n_rb = 0;
Py_DECREF(__pyx_n_events); __pyx_n_events = 0;
Py_DECREF(__pyx_n_PI); __pyx_n_PI = 0;
Py_DECREF(__pyx_n_FutureWarning); __pyx_n_FutureWarning = 0;
Py_DECREF(__pyx_n_compact); __pyx_n_compact = 0;
Py_DECREF(__pyx_n_LIBXSLT_COMPILED_VERSION); __pyx_n_LIBXSLT_COMPILED_VERSION = 0;
Py_DECREF(__pyx_n_extend); __pyx_n_extend = 0;
Py_DECREF(__pyx_n_xslt); __pyx_n_xslt = 0;
Py_DECREF(__pyx_n_matches); __pyx_n_matches = 0;
Py_DECREF(__pyx_n_SchematronParseError); __pyx_n_SchematronParseError = 0;
Py_DECREF(__pyx_n_inspect); __pyx_n_inspect = 0;
Py_DECREF(__pyx_n_update); __pyx_n_update = 0;
Py_DECREF(__pyx_n_XMLSchemaValidateError); __pyx_n_XMLSchemaValidateError = 0;
Py_DECREF(__pyx_n_g); __pyx_n_g = 0;
Py_DECREF(__pyx_n___setitem__); __pyx_n___setitem__ = 0;
Py_DECREF(__pyx_n__superError); __pyx_n__superError = 0;
Py_DECREF(__pyx_n_groups); __pyx_n_groups = 0;
Py_DECREF(__pyx_n_ERROR); __pyx_n_ERROR = 0;
Py_DECREF(__pyx_n_DEBUG); __pyx_n_DEBUG = 0;
Py_DECREF(__pyx_n_setFallback); __pyx_n_setFallback = 0;
Py_DECREF(__pyx_n_wsdl); __pyx_n_wsdl = 0;
Py_DECREF(__pyx_n_super); __pyx_n_super = 0;
Py_DECREF(__pyx_n___version__); __pyx_n___version__ = 0;
Py_DECREF(__pyx_n___unicode__); __pyx_n___unicode__ = 0;
Py_DECREF(__pyx_n_iterancestors); __pyx_n_iterancestors = 0;
Py_DECREF(__pyx_n_Comment); __pyx_n_Comment = 0;
Py_DECREF(__pyx_n_search); __pyx_n_search = 0;
Py_DECREF(__pyx_n_xsi); __pyx_n_xsi = 0;
Py_DECREF(__pyx_n_resolve_filename); __pyx_n_resolve_filename = 0;
Py_DECREF(__pyx_n_ProcessingInstruction); __pyx_n_ProcessingInstruction = 0;
Py_DECREF(__pyx_n_assertValid); __pyx_n_assertValid = 0;
Py_DECREF(__pyx_n_receive); __pyx_n_receive = 0;
Py_DECREF(__pyx_n_items); __pyx_n_items = 0;
Py_DECREF(__pyx_n___setslice__); __pyx_n___setslice__ = 0;
Py_DECREF(__pyx_n_insert); __pyx_n_insert = 0;
Py_DECREF(__pyx_n_LIBXML_COMPILED_VERSION); __pyx_n_LIBXML_COMPILED_VERSION = 0;
Py_DECREF(__pyx_n_RelaxNGValidateError); __pyx_n_RelaxNGValidateError = 0;
Py_DECREF(__pyx_n_comment); __pyx_n_comment = 0;
Py_DECREF(__pyx_n_filter_types); __pyx_n_filter_types = 0;
Py_DECREF(__pyx_n_rdf); __pyx_n_rdf = 0;
Py_DECREF(__pyx_n_extensions); __pyx_n_extensions = 0;
Py_DECREF(__pyx_n___repr__); __pyx_n___repr__ = 0;
Py_DECREF(__pyx_n___richcmp__); __pyx_n___richcmp__ = 0;
Py_DECREF(__pyx_n_exc_info); __pyx_n_exc_info = 0;
Py_DECREF(__pyx_n_resolve_empty); __pyx_n_resolve_empty = 0;
Py_DECREF(__pyx_n_getprevious); __pyx_n_getprevious = 0;
Py_DECREF(__pyx_n_getroot); __pyx_n_getroot = 0;
Py_DECREF(__pyx_n_ns_clean); __pyx_n_ns_clean = 0;
Py_DECREF(__pyx_n_getparent); __pyx_n_getparent = 0;
Py_DECREF(__pyx_n_resolve_entities); __pyx_n_resolve_entities = 0;
Py_DECREF(__pyx_n_encoding); __pyx_n_encoding = 0;
Py_DECREF(__pyx_n_profile_run); __pyx_n_profile_run = 0;
Py_DECREF(__pyx_n_get_namespace); __pyx_n_get_namespace = 0;
Py_DECREF(__pyx_n_RuntimeError); __pyx_n_RuntimeError = 0;
Py_DECREF(__pyx_n_pop); __pyx_n_pop = 0;
Py_DECREF(__pyx_n_replace); __pyx_n_replace = 0;
Py_DECREF(__pyx_n_StopIteration); __pyx_n_StopIteration = 0;
Py_DECREF(__pyx_n_alpha); __pyx_n_alpha = 0;
Py_DECREF(__pyx_n_getfilesystemencoding); __pyx_n_getfilesystemencoding = 0;
Py_DECREF(__pyx_n_XIncludeError); __pyx_n_XIncludeError = 0;
Py_DECREF(__pyx_n_apply); __pyx_n_apply = 0;
Py_DECREF(__pyx_n_message); __pyx_n_message = 0;
Py_DECREF(__pyx_n_LookupError); __pyx_n_LookupError = 0;
Py_DECREF(__pyx_n_open); __pyx_n_open = 0;
Py_DECREF(__pyx_n_assert_); __pyx_n_assert_ = 0;
Py_DECREF(__pyx_n_getnext); __pyx_n_getnext = 0;
Py_DECREF(__pyx_n_WAR_UNDECLARED_ENTITY); __pyx_n_WAR_UNDECLARED_ENTITY = 0;
Py_DECREF(__pyx_n_log); __pyx_n_log = 0;
Py_DECREF(__pyx_n_UTF8); __pyx_n_UTF8 = 0;
Py_DECREF(__pyx_n_stdout); __pyx_n_stdout = 0;
Py_DECREF(__pyx_n_dtd_validation); __pyx_n_dtd_validation = 0;
Py_DECREF(__pyx_n_XSLTApplyError); __pyx_n_XSLTApplyError = 0;
Py_DECREF(__pyx_n_next); __pyx_n_next = 0;
Py_DECREF(__pyx_n__TargetParserResult); __pyx_n__TargetParserResult = 0;
Py_DECREF(__pyx_n_start); __pyx_n_start = 0;
Py_DECREF(__pyx_n_CRITICAL); __pyx_n_CRITICAL = 0;
Py_DECREF(__pyx_n__); __pyx_n__ = 0;
Py_DECREF(__pyx_n_itervalues); __pyx_n_itervalues = 0;
Py_DECREF(__pyx_n_type_name); __pyx_n_type_name = 0;
Py_DECREF(__pyx_n_pi); __pyx_n_pi = 0;
Py_DECREF(__pyx_n_type); __pyx_n_type = 0;
Py_DECREF(__pyx_n_tell); __pyx_n_tell = 0;
Py_DECREF(__pyx_n___len__); __pyx_n___len__ = 0;
Py_DECREF(__pyx_n_xpath); __pyx_n_xpath = 0;
Py_DECREF(__pyx_n_resolvers); __pyx_n_resolvers = 0;
Py_DECREF(__pyx_n_Exception); __pyx_n_Exception = 0;
Py_DECREF(__pyx_n_XSLTError); __pyx_n_XSLTError = 0;
Py_DECREF(__pyx_n_reversed); __pyx_n_reversed = 0;
Py_DECREF(__pyx_n__names); __pyx_n__names = 0;
Py_DECREF(__pyx_n_warn); __pyx_n_warn = 0;
Py_DECREF(__pyx_n___iter__); __pyx_n___iter__ = 0;
Py_DECREF(__pyx_n_TypeError); __pyx_n_TypeError = 0;
Py_DECREF(__pyx_n_Error); __pyx_n_Error = 0;
Py_DECREF(__pyx_n_logging); __pyx_n_logging = 0;
Py_DECREF(__pyx_n_line); __pyx_n_line = 0;
Py_DECREF(__pyx_n_copy); __pyx_n_copy = 0;
Py_DECREF(__pyx_n_xinclude); __pyx_n_xinclude = 0;
Py_DECREF(__pyx_n_registerNamespaces); __pyx_n_registerNamespaces = 0;
Py_DECREF(__pyx_n_LIBXML_VERSION); __pyx_n_LIBXML_VERSION = 0;
Py_DECREF(__pyx_n_itersiblings); __pyx_n_itersiblings = 0;
Py_DECREF(__pyx_n_join); __pyx_n_join = 0;
Py_DECREF(__pyx_n_target); __pyx_n_target = 0;
Py_DECREF(__pyx_n_doctype); __pyx_n_doctype = 0;
Py_DECREF(__pyx_n_XMLSyntaxError); __pyx_n_XMLSyntaxError = 0;
Py_DECREF(__pyx_n_compile); __pyx_n_compile = 0;
Py_DECREF(__pyx_n_values); __pyx_n_values = 0;
Py_DECREF(__pyx_n_dev); __pyx_n_dev = 0;
Py_DECREF(__pyx_n___hash__); __pyx_n___hash__ = 0;
Py_DECREF(__pyx_n_LXML_VERSION); __pyx_n_LXML_VERSION = 0;
Py_DECREF(__pyx_n_DTDError); __pyx_n_DTDError = 0;
Py_DECREF(__pyx_n_result); __pyx_n_result = 0;
Py_DECREF(__pyx_n_unknown); __pyx_n_unknown = 0;
Py_DECREF(__pyx_n_XPathResultError); __pyx_n_XPathResultError = 0;
Py_DECREF(__pyx_n_get_default_parser); __pyx_n_get_default_parser = 0;
Py_DECREF(__pyx_n_filter_from_errors); __pyx_n_filter_from_errors = 0;
Py_DECREF(__pyx_n_ErrorDomains); __pyx_n_ErrorDomains = 0;
Py_DECREF(__pyx_n_inclusive); __pyx_n_inclusive = 0;
Py_DECREF(__pyx_n_UnicodeDecodeError); __pyx_n_UnicodeDecodeError = 0;
Py_DECREF(__pyx_n_iterfind); __pyx_n_iterfind = 0;
Py_DECREF(__pyx_n_DTDValidateError); __pyx_n_DTDValidateError = 0;
Py_DECREF(__pyx_n_KeyError); __pyx_n_KeyError = 0;
Py_DECREF(__pyx_n_iterchildren); __pyx_n_iterchildren = 0;
Py_DECREF(__pyx_n_parse); __pyx_n_parse = 0;
Py_DECREF(__pyx_n_set_element_class_lookup); __pyx_n_set_element_class_lookup = 0;
Py_DECREF(__pyx_n_tag); __pyx_n_tag = 0;
Py_DECREF(__pyx_n_RelaxNGParseError); __pyx_n_RelaxNGParseError = 0;
Py_DECREF(__pyx_n_close); __pyx_n_close = 0;
Py_DECREF(__pyx_n_addprevious); __pyx_n_addprevious = 0;
Py_DECREF(__pyx_n_SchematronValidateError); __pyx_n_SchematronValidateError = 0;
Py_DECREF(__pyx_n_ascii); __pyx_n_ascii = 0;
Py_DECREF(__pyx_n_id); __pyx_n_id = 0;
Py_DECREF(__pyx_n___init__); __pyx_n___init__ = 0;
Py_DECREF(__pyx_n_XMLSchemaParseError); __pyx_n_XMLSchemaParseError = 0;
Py_DECREF(__pyx_n_recover); __pyx_n_recover = 0;
Py_DECREF(__pyx_n_end); __pyx_n_end = 0;
Py_DECREF(__pyx_n__getName); __pyx_n__getName = 0;
Py_DECREF(__pyx_n_getroottree); __pyx_n_getroottree = 0;
Py_DECREF(__pyx_n_write); __pyx_n_write = 0;
Py_DECREF(__pyx_n_iterdescendants); __pyx_n_iterdescendants = 0;
Py_DECREF(__pyx_n_html); __pyx_n_html = 0;
Py_DECREF(__pyx_n_lookup); __pyx_n_lookup = 0;
Py_DECREF(__pyx_n_SchematronError); __pyx_n_SchematronError = 0;
Py_DECREF(__pyx_n_evaluate); __pyx_n_evaluate = 0;
Py_DECREF(__pyx_n_test); __pyx_n_test = 0;
Py_DECREF(__pyx_n_ErrorTypes); __pyx_n_ErrorTypes = 0;
Py_DECREF(__pyx_n___dealloc__); __pyx_n___dealloc__ = 0;
Py_DECREF(__pyx_n_ValueError); __pyx_n_ValueError = 0;
Py_DECREF(__pyx_n_A); __pyx_n_A = 0;
Py_DECREF(__pyx_n_DTDParseError); __pyx_n_DTDParseError = 0;
Py_DECREF(__pyx_n_access_control); __pyx_n_access_control = 0;
Py_DECREF(__pyx_n_warnings); __pyx_n_warnings = 0;
Py_DECREF(__pyx_n_keys); __pyx_n_keys = 0;
Py_DECREF(__pyx_n_filter_levels); __pyx_n_filter_levels = 0;
Py_DECREF(__pyx_n_preceding); __pyx_n_preceding = 0;
Py_DECREF(__pyx_n___next__); __pyx_n___next__ = 0;
Py_DECREF(__pyx_n_XPathFunctionError); __pyx_n_XPathFunctionError = 0;
Py_DECREF(__pyx_n_makeelement); __pyx_n_makeelement = 0;
Py_DECREF(__pyx_n_getpath); __pyx_n_getpath = 0;
Py_DECREF(__pyx_n_Element); __pyx_n_Element = 0;
Py_DECREF(__pyx_n_sys); __pyx_n_sys = 0;
Py_DECREF(__pyx_n_beta); __pyx_n_beta = 0;
Py_DECREF(__pyx_n_U); __pyx_n_U = 0;
Py_DECREF(__pyx_n_ParserError); __pyx_n_ParserError = 0;
Py_DECREF(__pyx_n_discard); __pyx_n_discard = 0;
Py_DECREF(__pyx_n_resolve_file); __pyx_n_resolve_file = 0;
Py_DECREF(__pyx_n_validate); __pyx_n_validate = 0;
Py_DECREF(__pyx_n_FATAL); __pyx_n_FATAL = 0;
Py_DECREF(__pyx_n_data); __pyx_n_data = 0;
Py_DECREF(__pyx_n_NotImplementedError); __pyx_n_NotImplementedError = 0;
Py_DECREF(__pyx_n_sub); __pyx_n_sub = 0;
Py_DECREF(__pyx_n_AssertionError); __pyx_n_AssertionError = 0;
Py_DECREF(__pyx_n_geturl); __pyx_n_geturl = 0;
Py_DECREF(__pyx_n_lower); __pyx_n_lower = 0;
Py_DECREF(__pyx_n__elementpath); __pyx_n__elementpath = 0;
Py_DECREF(__pyx_n_filter_from_fatals); __pyx_n_filter_from_fatals = 0;
Py_DECREF(__pyx_n_i); __pyx_n_i = 0;
Py_DECREF(__pyx_n_getiterator); __pyx_n_getiterator = 0;
Py_DECREF(__pyx_n_clear); __pyx_n_clear = 0;
Py_DECREF(__pyx_n_itertext); __pyx_n_itertext = 0;
Py_DECREF(__pyx_n_RelaxNGError); __pyx_n_RelaxNGError = 0;
Py_DECREF(__pyx_n_text); __pyx_n_text = 0;
Py_DECREF(__pyx_n_sets); __pyx_n_sets = 0;
Py_DECREF(__pyx_n_position); __pyx_n_position = 0;
Py_DECREF(__pyx_n_element); __pyx_n_element = 0;
Py_DECREF(__pyx_n_AttributeError); __pyx_n_AttributeError = 0;
Py_INCREF(Py_None); return Py_None;
}

static char *__pyx_filenames[] = {
"lxml.etree.pyx",
"proxy.pxi",
"apihelpers.pxi",
"xmlerror.pxi",
"classlookup.pxi",
"nsclasses.pxi",
"docloader.pxi",
"parser.pxi",
"parsertarget.pxi",
"serializer.pxi",
"iterparse.pxi",
"xmlid.pxi",
"extensions.pxi",
"xpath.pxi",
"xslt.pxi",
"dtd.pxi",
"relaxng.pxi",
"xmlschema.pxi",
"schematron.pxi",
"public-api.pxi",
"python.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
__pyx_f = __pyx_filenames;
}

static int __Pyx_GetStarArgs(
    PyObject **args, 
    PyObject **kwds,
    char *kwd_list[], 
    Py_ssize_t nargs,
    PyObject **args2, 
    PyObject **kwds2,
    char rqd_kwds[])
{
    PyObject *x = 0, *args1 = 0, *kwds1 = 0;
    int i;
    char **p;
    
    if (args2)
        *args2 = 0;
    if (kwds2)
        *kwds2 = 0;
    
    if (args2) {
        args1 = PyTuple_GetSlice(*args, 0, nargs);
        if (!args1)
            goto bad;
        *args2 = PyTuple_GetSlice(*args, nargs, PyTuple_GET_SIZE(*args));
        if (!*args2)
            goto bad;
    }
    else if (PyTuple_GET_SIZE(*args) > nargs) {
        int m = nargs;
        int n = PyTuple_GET_SIZE(*args);
        PyErr_Format(PyExc_TypeError,
            "function takes at most %d positional arguments (%d given)",
                m, n);
        goto bad;
    }
    else {
        args1 = *args;
        Py_INCREF(args1);
    }
    
    if (rqd_kwds && !*kwds)
            for (i = 0, p = kwd_list; *p; i++, p++)
                if (rqd_kwds[i])
                    goto missing_kwarg;
    
    if (kwds2) {
        if (*kwds) {
            kwds1 = PyDict_New();
            if (!kwds1)
                goto bad;
            *kwds2 = PyDict_Copy(*kwds);
            if (!*kwds2)
                goto bad;
            for (i = 0, p = kwd_list; *p; i++, p++) {
                x = PyDict_GetItemString(*kwds, *p);
                if (x) {
                    if (PyDict_SetItemString(kwds1, *p, x) < 0)
                        goto bad;
                    if (PyDict_DelItemString(*kwds2, *p) < 0)
                        goto bad;
                }
                else if (rqd_kwds && rqd_kwds[i])
                    goto missing_kwarg;
            }
        }
        else {
            *kwds2 = PyDict_New();
            if (!*kwds2)
                goto bad;
        }
    }
    else {
        kwds1 = *kwds;
        Py_XINCREF(kwds1);
        if (rqd_kwds && *kwds)
            for (i = 0, p = kwd_list; *p; i++, p++)
                if (rqd_kwds[i] && !PyDict_GetItemString(*kwds, *p))
                        goto missing_kwarg;
    }
    
    *args = args1;
    *kwds = kwds1;
    return 0;
missing_kwarg:
    PyErr_Format(PyExc_TypeError,
        "required keyword argument '%s' is missing", *p);
bad:
    Py_XDECREF(args1);
    Py_XDECREF(kwds1);
    if (args2) {
        Py_XDECREF(*args2);
    }
    if (kwds2) {
        Py_XDECREF(*kwds2);
    }
    return -1;
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if ((none_allowed && obj == Py_None) || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, obj->ob_type->tp_name);
    return 0;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = PyObject_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunction(__import__, "OOOO",
        name, global_dict, empty_dict, list);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_Get();
    PyErr_Fetch(type, value, tb);
    PyErr_NormalizeException(type, value, tb);
    if (PyErr_Occurred())
        goto bad;
    Py_INCREF(*type);
    Py_INCREF(*value);
    Py_INCREF(*tb);
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    /* Make sure tstate is in a consistent state when we XDECREF
    these objects (XDECREF may run arbitrary code). */
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
    return 0;
bad:
    Py_XDECREF(*type);
    Py_XDECREF(*value);
    Py_XDECREF(*tb);
    return -1;
}

static PyObject *__Pyx_CreateClass(
    PyObject *bases, PyObject *dict, PyObject *name, char *modname)
{
    PyObject *py_modname;
    PyObject *result = 0;
    
    py_modname = PyString_FromString(modname);
    if (!py_modname)
        goto bad;
    if (PyDict_SetItemString(dict, "__module__", py_modname) < 0)
        goto bad;
    result = PyClass_New(bases, dict, name);
bad:
    Py_XDECREF(py_modname);
    return result;
}

static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject("stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_PrintItem(PyObject *v) {
    PyObject *f;
    
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_SoftSpace(f, 1)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyString_Check(v)) {
        char *s = PyString_AsString(v);
        Py_ssize_t len = PyString_Size(v);
        if (len > 0 &&
            isspace(Py_CHARMASK(s[len-1])) &&
            s[len-1] != ' ')
                PyFile_SoftSpace(f, 0);
    }
    return 0;
}

static int __Pyx_PrintNewline(void) {
    PyObject *f;
    
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    PyFile_SoftSpace(f, 0);
    return 0;
}

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        obj->ob_type->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_WriteUnraisable(char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    PyErr_Fetch(&old_exc, &old_val, &old_tb);
    ctx = PyString_FromString(name);
    PyErr_Restore(old_exc, old_val, old_tb);
    if (!ctx)
        ctx = Py_None;
    PyErr_WriteUnraisable(ctx);
}

static void __Pyx_UnpackError(void) {
    PyErr_SetString(PyExc_ValueError, "unpack sequence of wrong size");
}

static PyObject *__Pyx_UnpackItem(PyObject *iter) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred())
            __Pyx_UnpackError();
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_UnpackError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) type->ob_type;
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static int __Pyx_InternStrings(__Pyx_InternTabEntry *t) {
    while (t->p) {
        *t->p = PyString_InternFromString(t->s);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

static int __Pyx_ExportFunction(char *n, void *f, char *s) {
    PyObject *d = 0;
    PyObject *p = 0;
    d = PyObject_GetAttrString(__pyx_m, "__pyx_capi__");
    if (!d) {
        PyErr_Clear();
        d = PyDict_New();
        if (!d)
            goto bad;
        Py_INCREF(d);
        if (PyModule_AddObject(__pyx_m, "__pyx_capi__", d) < 0)
            goto bad;
    }
    p = PyCObject_FromVoidPtrAndDesc(f, s, 0);
    if (!p)
        goto bad;
    if (PyDict_SetItemString(d, n, p) < 0)
        goto bad;
    Py_DECREF(d);
    return 0;
bad:
    Py_XDECREF(p);
    Py_XDECREF(d);
    return -1;
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
    PyObject *pycobj = 0;
    int result;
    
    pycobj = PyCObject_FromVoidPtr(vtable, 0);
    if (!pycobj)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(char *module_name, char *class_name,
    long size)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    
    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    result = PyObject_GetAttrString(py_module, class_name);
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;
    
    py_name = PyString_FromString(name);
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyObject *empty_tuple = 0;
    PyObject *empty_string = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    
    py_srcfile = PyString_FromString(__pyx_filename);
    if (!py_srcfile) goto bad;
    py_funcname = PyString_FromString(funcname);
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    empty_tuple = PyTuple_New(0);
    if (!empty_tuple) goto bad;
    empty_string = PyString_FromString("");
    if (!empty_string) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        empty_string, /*PyObject *code,*/
        empty_tuple,  /*PyObject *consts,*/
        empty_tuple,  /*PyObject *names,*/
        empty_tuple,  /*PyObject *varnames,*/
        empty_tuple,  /*PyObject *freevars,*/
        empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        empty_string  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_Get(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(empty_tuple);
    Py_XDECREF(empty_string);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_RegisterCleanup() {
    /* Don't use Py_AtExit because that has a 32-call limit 
     * and is called after python finalization. 
     */

    PyObject *cleanup_func = 0;
    PyObject *atexit = 0;
    PyObject *reg = 0;
    PyObject *args = 0;
    PyObject *res = 0;
    int ret = -1;
    
    cleanup_func = PyCFunction_New(&cleanup_def, 0);
    args = PyTuple_New(1);
    if (!cleanup_func || !args)
        goto bad;
    PyTuple_SET_ITEM(args, 0, cleanup_func);
    cleanup_func = 0;

    atexit = __Pyx_ImportModule("atexit");
    if (!atexit)
        goto bad;
    reg = PyObject_GetAttrString(atexit, "register");
    if (!reg)
        goto bad;
    res = PyObject_CallObject(reg, args);
    if (!res)
        goto bad;
    ret = 0;
bad:
    Py_XDECREF(cleanup_func);
    Py_XDECREF(atexit);
    Py_XDECREF(reg);
    Py_XDECREF(args);
    Py_XDECREF(res);
    return ret;
}
