/* Generated by Pyrex 0.9.5.1a on Tue Feb 27 16:11:53 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)
#endif
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
__PYX_EXTERN_C double pow(double, double);
#include "stdio.h"
#include "string.h"
#include "stdarg.h"
#include "etree_defs.h"
#include "lxml-version.h"
#include "libxml/xmlversion.h"
#include "libxml/encoding.h"
#include "libxml/hash.h"
#include "libxml/tree.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"


typedef struct {const char *s; const void **p;} __Pyx_CApiTabEntry; /*proto*/
typedef struct {PyObject **p; char *s;} __Pyx_InternTabEntry; /*proto*/
typedef struct {PyObject **p; char *s; long n;} __Pyx_StringTabEntry; /*proto*/

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); /*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 PyObject *__Pyx_GetExcValue(void); /*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 void __Pyx_ReRaise(void); /*proto*/

static int __Pyx_InitCApi(PyObject *module); /*proto*/
static int __Pyx_ImportModuleCApi(__Pyx_CApiTabEntry *t); /*proto*/

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

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

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

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

/* Declarations from cstd */


/* Declarations from tree */


/* Declarations from python */


/* 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 relaxng */


/* Declarations from xmlschema */


/* Declarations from etree */

typedef enum {
  __pyx_e_5etree_PARSER_DATA_EMPTY,
  __pyx_e_5etree_PARSER_DATA_STRING,
  __pyx_e_5etree_PARSER_DATA_FILENAME,
  __pyx_e_5etree_PARSER_DATA_FILE
} __pyx_t_5etree__InputDocumentDataType;

typedef enum {
  __pyx_e_5etree_LXML_XML_PARSER,
  __pyx_e_5etree_LXML_HTML_PARSER,
  __pyx_e_5etree_LXML_ITERPARSE_PARSER
} __pyx_t_5etree_LxmlParserType;

typedef enum {
  __pyx_e_5etree_ITERPARSE_FILTER_START = 1,
  __pyx_e_5etree_ITERPARSE_FILTER_END = 2,
  __pyx_e_5etree_ITERPARSE_FILTER_START_NS = 4,
  __pyx_e_5etree_ITERPARSE_FILTER_END_NS = 8
} __pyx_t_5etree_IterparseEventFilter;


struct __pyx_obj_5etree__TempStore {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__TempStore *__pyx_vtab;
  PyObject *_storage;
};

struct __pyx_vtabstruct_5etree__TempStore {
  void ((*add)(struct __pyx_obj_5etree__TempStore *,PyObject *));
  void ((*clear)(struct __pyx_obj_5etree__TempStore *));
  PyObject *((*dictcopy)(struct __pyx_obj_5etree__TempStore *));
};
static struct __pyx_vtabstruct_5etree__TempStore *__pyx_vtabptr_5etree__TempStore;


struct __pyx_obj_5etree__ExceptionContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__ExceptionContext *__pyx_vtab;
  PyObject *_exc_info;
};

struct __pyx_vtabstruct_5etree__ExceptionContext {
  void ((*clear)(struct __pyx_obj_5etree__ExceptionContext *));
  void ((*_store_raised)(struct __pyx_obj_5etree__ExceptionContext *));
  void ((*_store_exception)(struct __pyx_obj_5etree__ExceptionContext *,PyObject *));
  int ((*_has_raised)(struct __pyx_obj_5etree__ExceptionContext *));
  PyObject *((*_raise_if_stored)(struct __pyx_obj_5etree__ExceptionContext *));
};
static struct __pyx_vtabstruct_5etree__ExceptionContext *__pyx_vtabptr_5etree__ExceptionContext;


struct __pyx_obj_5etree_QName {
  PyObject_HEAD
  PyObject *text;
};


struct __pyx_obj_5etree__BaseParser {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__BaseParser *__pyx_vtab;
  int _parse_options;
  struct __pyx_obj_5etree__ErrorLog *_error_log;
  struct __pyx_obj_5etree__ResolverRegistry *resolvers;
  struct __pyx_obj_5etree__ResolverContext *_context;
  __pyx_t_5etree_LxmlParserType _parser_type;
  xmlParserCtxt (*_parser_ctxt);
  struct LxmlElementClassLookup *_class_lookup;
  PyThread_type_lock _parser_lock;
};

struct __pyx_vtabstruct_5etree__BaseParser {
  void ((*_cleanup)(struct __pyx_obj_5etree__BaseParser *));
  int ((*_lockParser)(struct __pyx_obj_5etree__BaseParser *));
  void ((*_unlockParser)(struct __pyx_obj_5etree__BaseParser *));
  struct __pyx_obj_5etree__BaseParser *((*_copy)(struct __pyx_obj_5etree__BaseParser *));
  xmlDoc (*((*_parseUnicodeDoc)(struct __pyx_obj_5etree__BaseParser *,PyObject *,char (*))));
  xmlDoc (*((*_parseDoc)(struct __pyx_obj_5etree__BaseParser *,char (*),Py_ssize_t ,char (*))));
  xmlDoc (*((*_parseDocFromFile)(struct __pyx_obj_5etree__BaseParser *,char (*))));
  xmlDoc (*((*_parseDocFromFilelike)(struct __pyx_obj_5etree__BaseParser *,PyObject *,PyObject *)));
};
static struct __pyx_vtabstruct_5etree__BaseParser *__pyx_vtabptr_5etree__BaseParser;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlDocumentType;

struct LxmlDocument {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__Document *__pyx_vtab;
  int _ns_counter;
  xmlDoc (*_c_doc);
  struct __pyx_obj_5etree__BaseParser *_parser;
};

struct __pyx_vtabstruct_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 (*))));
  void ((*_setNodeNs)(struct LxmlDocument *,xmlNode (*),char (*)));
  void ((*_setNodeNamespaces)(struct LxmlDocument *,xmlNode (*),PyObject *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__Document *__pyx_vtabptr_5etree__Document;


struct __pyx_obj_5etree_DocInfo {
  PyObject_HEAD
  PyObject *root_name;
  PyObject *public_id;
  PyObject *system_url;
  PyObject *xml_version;
  PyObject *encoding;
  PyObject *URL;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementType;

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


struct __pyx_obj_5etree___ContentOnlyElement {
  struct LxmlElement __pyx_base;
  struct __pyx_vtabstruct_5etree___ContentOnlyElement *__pyx_vtab;
};

struct __pyx_vtabstruct_5etree___ContentOnlyElement {
  int ((*_raiseImmutable)(struct __pyx_obj_5etree___ContentOnlyElement *));
};
static struct __pyx_vtabstruct_5etree___ContentOnlyElement *__pyx_vtabptr_5etree___ContentOnlyElement;


struct __pyx_obj_5etree__Comment {
  struct __pyx_obj_5etree___ContentOnlyElement __pyx_base;
};

struct __pyx_vtabstruct_5etree__Comment {
  struct __pyx_vtabstruct_5etree___ContentOnlyElement __pyx_base;
};
static struct __pyx_vtabstruct_5etree__Comment *__pyx_vtabptr_5etree__Comment;


struct __pyx_obj_5etree__ProcessingInstruction {
  struct __pyx_obj_5etree___ContentOnlyElement __pyx_base;
};

struct __pyx_vtabstruct_5etree__ProcessingInstruction {
  struct __pyx_vtabstruct_5etree___ContentOnlyElement __pyx_base;
};
static struct __pyx_vtabstruct_5etree__ProcessingInstruction *__pyx_vtabptr_5etree__ProcessingInstruction;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTreeType;

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

struct __pyx_vtabstruct_5etree__ElementTree {
  PyObject *((*_assertHasRoot)(struct LxmlElementTree *));
};
static struct __pyx_vtabstruct_5etree__ElementTree *__pyx_vtabptr_5etree__ElementTree;


struct __pyx_obj_5etree__Attrib {
  PyObject_HEAD
  struct LxmlElement *_element;
};


struct __pyx_obj_5etree__AttribIterator {
  PyObject_HEAD
  struct LxmlElement *_node;
  xmlAttr (*_c_attr);
  int _keysvalues;
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementTagMatcherType;

struct LxmlElementTagMatcher {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__ElementTagMatcher *__pyx_vtab;
  PyObject *_pystrings;
  char (*_href);
  char (*_name);
};

struct __pyx_vtabstruct_5etree__ElementTagMatcher {
  PyObject *((*_initTagMatch)(struct LxmlElementTagMatcher *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__ElementTagMatcher *__pyx_vtabptr_5etree__ElementTagMatcher;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementIteratorType;

struct LxmlElementIterator {
  struct LxmlElementTagMatcher __pyx_base;
  struct LxmlElement *_node;
  xmlNode (*((*_next_element)(xmlNode (*))));
};

struct __pyx_vtabstruct_5etree__ElementIterator {
  struct __pyx_vtabstruct_5etree__ElementTagMatcher __pyx_base;
  void ((*_storeNext)(struct LxmlElementIterator *,struct LxmlElement *));
};
static struct __pyx_vtabstruct_5etree__ElementIterator *__pyx_vtabptr_5etree__ElementIterator;


struct __pyx_obj_5etree_ElementChildIterator {
  struct LxmlElementIterator __pyx_base;
};

struct __pyx_vtabstruct_5etree_ElementChildIterator {
  struct __pyx_vtabstruct_5etree__ElementIterator __pyx_base;
};
static struct __pyx_vtabstruct_5etree_ElementChildIterator *__pyx_vtabptr_5etree_ElementChildIterator;


struct __pyx_obj_5etree_SiblingsIterator {
  struct LxmlElementIterator __pyx_base;
};

struct __pyx_vtabstruct_5etree_SiblingsIterator {
  struct __pyx_vtabstruct_5etree__ElementIterator __pyx_base;
};
static struct __pyx_vtabstruct_5etree_SiblingsIterator *__pyx_vtabptr_5etree_SiblingsIterator;


struct __pyx_obj_5etree_AncestorsIterator {
  struct LxmlElementIterator __pyx_base;
};

struct __pyx_vtabstruct_5etree_AncestorsIterator {
  struct __pyx_vtabstruct_5etree__ElementIterator __pyx_base;
};
static struct __pyx_vtabstruct_5etree_AncestorsIterator *__pyx_vtabptr_5etree_AncestorsIterator;


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

struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator {
  struct __pyx_vtabstruct_5etree__ElementTagMatcher __pyx_base;
  xmlNode (*((*_nextNodeAnyTag)(struct __pyx_obj_5etree_ElementDepthFirstIterator *,xmlNode (*))));
  xmlNode (*((*_nextNodeMatchTag)(struct __pyx_obj_5etree_ElementDepthFirstIterator *,xmlNode (*))));
};
static struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator *__pyx_vtabptr_5etree_ElementDepthFirstIterator;


struct __pyx_obj_5etree__LogEntry {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__LogEntry *__pyx_vtab;
  PyObject *domain;
  PyObject *type;
  PyObject *line;
  PyObject *level;
  PyObject *message;
  PyObject *filename;
};

struct __pyx_vtabstruct_5etree__LogEntry {
  PyObject *((*_setError)(struct __pyx_obj_5etree__LogEntry *,xmlError (*)));
  PyObject *((*_setGeneric)(struct __pyx_obj_5etree__LogEntry *,int ,int ,int ,int ,PyObject *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__LogEntry *__pyx_vtabptr_5etree__LogEntry;


struct __pyx_obj_5etree__BaseErrorLog {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__BaseErrorLog *__pyx_vtab;
  PyObject *last_error;
};

struct __pyx_vtabstruct_5etree__BaseErrorLog {
  void ((*_receive)(struct __pyx_obj_5etree__BaseErrorLog *,xmlError (*)));
  void ((*_receiveGeneric)(struct __pyx_obj_5etree__BaseErrorLog *,int ,int ,int ,int ,PyObject *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__BaseErrorLog *__pyx_vtabptr_5etree__BaseErrorLog;


struct __pyx_obj_5etree__ListErrorLog {
  struct __pyx_obj_5etree__BaseErrorLog __pyx_base;
  PyObject *_entries;
};

struct __pyx_vtabstruct_5etree__ListErrorLog {
  struct __pyx_vtabstruct_5etree__BaseErrorLog __pyx_base;
};
static struct __pyx_vtabstruct_5etree__ListErrorLog *__pyx_vtabptr_5etree__ListErrorLog;


struct __pyx_obj_5etree__ErrorLog {
  struct __pyx_obj_5etree__ListErrorLog __pyx_base;
};

struct __pyx_vtabstruct_5etree__ErrorLog {
  struct __pyx_vtabstruct_5etree__ListErrorLog __pyx_base;
  void ((*connect)(struct __pyx_obj_5etree__ErrorLog *));
  void ((*disconnect)(struct __pyx_obj_5etree__ErrorLog *));
};
static struct __pyx_vtabstruct_5etree__ErrorLog *__pyx_vtabptr_5etree__ErrorLog;


struct __pyx_obj_5etree__DomainErrorLog {
  struct __pyx_obj_5etree__ErrorLog __pyx_base;
};

struct __pyx_vtabstruct_5etree__DomainErrorLog {
  struct __pyx_vtabstruct_5etree__ErrorLog __pyx_base;
};
static struct __pyx_vtabstruct_5etree__DomainErrorLog *__pyx_vtabptr_5etree__DomainErrorLog;


struct __pyx_obj_5etree__RotatingErrorLog {
  struct __pyx_obj_5etree__ErrorLog __pyx_base;
  int _max_len;
};

struct __pyx_vtabstruct_5etree__RotatingErrorLog {
  struct __pyx_vtabstruct_5etree__ErrorLog __pyx_base;
};
static struct __pyx_vtabstruct_5etree__RotatingErrorLog *__pyx_vtabptr_5etree__RotatingErrorLog;


struct __pyx_obj_5etree_PyErrorLog {
  struct __pyx_obj_5etree__BaseErrorLog __pyx_base;
  PyObject *level_map;
  PyObject *_log;
};

struct __pyx_vtabstruct_5etree_PyErrorLog {
  struct __pyx_vtabstruct_5etree__BaseErrorLog __pyx_base;
};
static struct __pyx_vtabstruct_5etree_PyErrorLog *__pyx_vtabptr_5etree_PyErrorLog;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementBaseType;

struct LxmlElementBase {
  struct LxmlElement __pyx_base;
};


struct __pyx_obj_5etree_CommentBase {
  struct __pyx_obj_5etree__Comment __pyx_base;
};

struct __pyx_vtabstruct_5etree_CommentBase {
  struct __pyx_vtabstruct_5etree__Comment __pyx_base;
};
static struct __pyx_vtabstruct_5etree_CommentBase *__pyx_vtabptr_5etree_CommentBase;


struct __pyx_obj_5etree_PIBase {
  struct __pyx_obj_5etree__ProcessingInstruction __pyx_base;
};

struct __pyx_vtabstruct_5etree_PIBase {
  struct __pyx_vtabstruct_5etree__ProcessingInstruction __pyx_base;
};
static struct __pyx_vtabstruct_5etree_PIBase *__pyx_vtabptr_5etree_PIBase;

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlElementClassLookupType;

struct LxmlElementClassLookup {
  PyObject_HEAD
  PyObject *((*_lookup_function)(PyObject *,struct LxmlDocument *,xmlNode (*)));
};

__PYX_EXTERN_C DL_EXPORT(PyTypeObject) LxmlFallbackElementClassLookupType;

struct LxmlFallbackElementClassLookup {
  struct LxmlElementClassLookup __pyx_base;
  struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *__pyx_vtab;
  struct LxmlElementClassLookup *fallback;
  PyObject *((*_fallback_function)(PyObject *,struct LxmlDocument *,xmlNode (*)));
};

struct __pyx_vtabstruct_5etree_FallbackElementClassLookup {
  PyObject *((*_callFallback)(struct LxmlFallbackElementClassLookup *,PyObject *,xmlNode (*)));
};
static struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *__pyx_vtabptr_5etree_FallbackElementClassLookup;


struct __pyx_obj_5etree_ElementDefaultClassLookup {
  struct LxmlElementClassLookup __pyx_base;
  PyObject *element_class;
  PyObject *comment_class;
  PyObject *pi_class;
};


struct __pyx_obj_5etree_ElementNamespaceClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
};

struct __pyx_vtabstruct_5etree_ElementNamespaceClassLookup {
  struct __pyx_vtabstruct_5etree_FallbackElementClassLookup __pyx_base;
};
static struct __pyx_vtabstruct_5etree_ElementNamespaceClassLookup *__pyx_vtabptr_5etree_ElementNamespaceClassLookup;


struct __pyx_obj_5etree_AttributeBasedElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
  PyObject *_class_mapping;
  PyObject *_pytag;
  char (*_c_ns);
  char (*_c_name);
};

struct __pyx_vtabstruct_5etree_AttributeBasedElementClassLookup {
  struct __pyx_vtabstruct_5etree_FallbackElementClassLookup __pyx_base;
};
static struct __pyx_vtabstruct_5etree_AttributeBasedElementClassLookup *__pyx_vtabptr_5etree_AttributeBasedElementClassLookup;


struct __pyx_obj_5etree_ParserBasedElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
};

struct __pyx_vtabstruct_5etree_ParserBasedElementClassLookup {
  struct __pyx_vtabstruct_5etree_FallbackElementClassLookup __pyx_base;
};
static struct __pyx_vtabstruct_5etree_ParserBasedElementClassLookup *__pyx_vtabptr_5etree_ParserBasedElementClassLookup;


struct __pyx_obj_5etree_CustomElementClassLookup {
  struct LxmlFallbackElementClassLookup __pyx_base;
};

struct __pyx_vtabstruct_5etree_CustomElementClassLookup {
  struct __pyx_vtabstruct_5etree_FallbackElementClassLookup __pyx_base;
};
static struct __pyx_vtabstruct_5etree_CustomElementClassLookup *__pyx_vtabptr_5etree_CustomElementClassLookup;


struct __pyx_obj_5etree__NamespaceRegistry {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__NamespaceRegistry *__pyx_vtab;
  PyObject *_ns_uri;
  PyObject *_ns_uri_utf;
  PyObject *_entries;
  char (*_c_ns_uri_utf);
};

struct __pyx_vtabstruct_5etree__NamespaceRegistry {
  PyObject *((*_get)(struct __pyx_obj_5etree__NamespaceRegistry *,PyObject *));
  PyObject *((*_getForString)(struct __pyx_obj_5etree__NamespaceRegistry *,char (*)));
};
static struct __pyx_vtabstruct_5etree__NamespaceRegistry *__pyx_vtabptr_5etree__NamespaceRegistry;


struct __pyx_obj_5etree__ClassNamespaceRegistry {
  struct __pyx_obj_5etree__NamespaceRegistry __pyx_base;
};

struct __pyx_vtabstruct_5etree__ClassNamespaceRegistry {
  struct __pyx_vtabstruct_5etree__NamespaceRegistry __pyx_base;
};
static struct __pyx_vtabstruct_5etree__ClassNamespaceRegistry *__pyx_vtabptr_5etree__ClassNamespaceRegistry;


struct __pyx_obj_5etree__FunctionNamespaceRegistry {
  struct __pyx_obj_5etree__NamespaceRegistry __pyx_base;
};

struct __pyx_vtabstruct_5etree__FunctionNamespaceRegistry {
  struct __pyx_vtabstruct_5etree__NamespaceRegistry __pyx_base;
};
static struct __pyx_vtabstruct_5etree__FunctionNamespaceRegistry *__pyx_vtabptr_5etree__FunctionNamespaceRegistry;


struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry {
  struct __pyx_obj_5etree__FunctionNamespaceRegistry __pyx_base;
  PyObject *_prefix;
  PyObject *_prefix_utf;
};

struct __pyx_vtabstruct_5etree__XPathFunctionNamespaceRegistry {
  struct __pyx_vtabstruct_5etree__FunctionNamespaceRegistry __pyx_base;
};
static struct __pyx_vtabstruct_5etree__XPathFunctionNamespaceRegistry *__pyx_vtabptr_5etree__XPathFunctionNamespaceRegistry;


struct __pyx_obj_5etree__InputDocument {
  PyObject_HEAD
  __pyx_t_5etree__InputDocumentDataType _type;
  PyObject *_data_bytes;
  PyObject *_file;
};


struct __pyx_obj_5etree_Resolver {
  PyObject_HEAD
};


struct __pyx_obj_5etree__ResolverRegistry {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__ResolverRegistry *__pyx_vtab;
  PyObject *_resolvers;
  struct __pyx_obj_5etree_Resolver *_default_resolver;
};

struct __pyx_vtabstruct_5etree__ResolverRegistry {
  struct __pyx_obj_5etree__ResolverRegistry *((*_copy)(struct __pyx_obj_5etree__ResolverRegistry *));
};
static struct __pyx_vtabstruct_5etree__ResolverRegistry *__pyx_vtabptr_5etree__ResolverRegistry;


struct __pyx_obj_5etree__ResolverContext {
  struct __pyx_obj_5etree__ExceptionContext __pyx_base;
  struct __pyx_obj_5etree__ResolverRegistry *_resolvers;
  struct __pyx_obj_5etree__TempStore *_storage;
};

struct __pyx_vtabstruct_5etree__ResolverContext {
  struct __pyx_vtabstruct_5etree__ExceptionContext __pyx_base;
};
static struct __pyx_vtabstruct_5etree__ResolverContext *__pyx_vtabptr_5etree__ResolverContext;


struct __pyx_obj_5etree__ParserContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__ParserContext *__pyx_vtab;
  xmlDict (*_c_dict);
  struct __pyx_obj_5etree__BaseParser *_default_parser;
};

struct __pyx_vtabstruct_5etree__ParserContext {
  void ((*initMainParserContext)(struct __pyx_obj_5etree__ParserContext *));
  struct __pyx_obj_5etree__ParserContext *((*_findThreadParserContext)(struct __pyx_obj_5etree__ParserContext *));
  void ((*setDefaultParser)(struct __pyx_obj_5etree__ParserContext *,struct __pyx_obj_5etree__BaseParser *));
  struct __pyx_obj_5etree__BaseParser *((*getDefaultParser)(struct __pyx_obj_5etree__ParserContext *));
  xmlDict (*((*_getThreadDict)(struct __pyx_obj_5etree__ParserContext *,xmlDict (*))));
  void ((*initThreadDictRef)(struct __pyx_obj_5etree__ParserContext *,xmlDict (*(*))));
  void ((*initParserDict)(struct __pyx_obj_5etree__ParserContext *,xmlParserCtxt (*)));
  void ((*initXPathParserDict)(struct __pyx_obj_5etree__ParserContext *,xmlXPathContext (*)));
  void ((*initDocDict)(struct __pyx_obj_5etree__ParserContext *,xmlDoc (*)));
};
static struct __pyx_vtabstruct_5etree__ParserContext *__pyx_vtabptr_5etree__ParserContext;


struct __pyx_obj_5etree__FileParserContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__FileParserContext *__pyx_vtab;
  PyObject *_filelike;
  PyObject *_url;
  PyObject *_bytes;
  struct __pyx_obj_5etree__ExceptionContext *_exc_context;
  size_t _bytes_read;
  char (*_c_url);
};

struct __pyx_vtabstruct_5etree__FileParserContext {
  xmlParserInput (*((*_createParserInput)(struct __pyx_obj_5etree__FileParserContext *,xmlParserCtxt (*))));
  xmlDoc (*((*_readDoc)(struct __pyx_obj_5etree__FileParserContext *,xmlParserCtxt (*),int ,__pyx_t_5etree_LxmlParserType )));
  int ((*copyToBuffer)(struct __pyx_obj_5etree__FileParserContext *,char (*),int ));
};
static struct __pyx_vtabstruct_5etree__FileParserContext *__pyx_vtabptr_5etree__FileParserContext;


struct __pyx_obj_5etree_XMLParser {
  struct __pyx_obj_5etree__BaseParser __pyx_base;
};

struct __pyx_vtabstruct_5etree_XMLParser {
  struct __pyx_vtabstruct_5etree__BaseParser __pyx_base;
};
static struct __pyx_vtabstruct_5etree_XMLParser *__pyx_vtabptr_5etree_XMLParser;


struct __pyx_obj_5etree_HTMLParser {
  struct __pyx_obj_5etree__BaseParser __pyx_base;
};

struct __pyx_vtabstruct_5etree_HTMLParser {
  struct __pyx_vtabstruct_5etree__BaseParser __pyx_base;
};
static struct __pyx_vtabstruct_5etree_HTMLParser *__pyx_vtabptr_5etree_HTMLParser;


struct __pyx_obj_5etree__FilelikeWriter {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__FilelikeWriter *__pyx_vtab;
  PyObject *_filelike;
  struct __pyx_obj_5etree__ExceptionContext *_exc_context;
  struct __pyx_obj_5etree__ErrorLog *error_log;
};

struct __pyx_vtabstruct_5etree__FilelikeWriter {
  xmlOutputBuffer (*((*_createOutputBuffer)(struct __pyx_obj_5etree__FilelikeWriter *,xmlCharEncodingHandler (*))));
  int ((*write)(struct __pyx_obj_5etree__FilelikeWriter *,char (*),int ));
  int ((*close)(struct __pyx_obj_5etree__FilelikeWriter *));
};
static struct __pyx_vtabstruct_5etree__FilelikeWriter *__pyx_vtabptr_5etree__FilelikeWriter;


struct __pyx_obj_5etree__IterparseResolverContext {
  struct __pyx_obj_5etree__ResolverContext __pyx_base;
  startElementNsSAX2Func _origSaxStart;
  endElementNsSAX2Func _origSaxEnd;
  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);
};

struct __pyx_vtabstruct_5etree__IterparseResolverContext {
  struct __pyx_vtabstruct_5etree__ResolverContext __pyx_base;
  void ((*_wrapCallbacks)(struct __pyx_obj_5etree__IterparseResolverContext *,xmlSAXHandler (*)));
  void ((*_setEventFilter)(struct __pyx_obj_5etree__IterparseResolverContext *,PyObject *,PyObject *));
  void ((*startNode)(struct __pyx_obj_5etree__IterparseResolverContext *,xmlNode (*)));
  void ((*endNode)(struct __pyx_obj_5etree__IterparseResolverContext *,xmlNode (*)));
};
static struct __pyx_vtabstruct_5etree__IterparseResolverContext *__pyx_vtabptr_5etree__IterparseResolverContext;


struct __pyx_obj_5etree_iterparse {
  struct __pyx_obj_5etree__BaseParser __pyx_base;
  PyObject *_source;
  PyObject *_filename;
  PyObject *root;
};

struct __pyx_vtabstruct_5etree_iterparse {
  struct __pyx_vtabstruct_5etree__BaseParser __pyx_base;
};
static struct __pyx_vtabstruct_5etree_iterparse *__pyx_vtabptr_5etree_iterparse;


struct __pyx_obj_5etree_iterwalk {
  PyObject_HEAD
  struct __pyx_vtabstruct_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);
};

struct __pyx_vtabstruct_5etree_iterwalk {
  void ((*_setTagFilter)(struct __pyx_obj_5etree_iterwalk *,PyObject *));
  int ((*_start_node)(struct __pyx_obj_5etree_iterwalk *,struct LxmlElement *));
  struct LxmlElement *((*_end_node)(struct __pyx_obj_5etree_iterwalk *));
};
static struct __pyx_vtabstruct_5etree_iterwalk *__pyx_vtabptr_5etree_iterwalk;


struct __pyx_obj_5etree__IDDict {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__IDDict *__pyx_vtab;
  struct LxmlDocument *_doc;
  PyObject *_keys;
  PyObject *_items;
};

struct __pyx_vtabstruct_5etree__IDDict {
  PyObject *((*_build_keys)(struct __pyx_obj_5etree__IDDict *));
  PyObject *((*_build_items)(struct __pyx_obj_5etree__IDDict *));
};
static struct __pyx_vtabstruct_5etree__IDDict *__pyx_vtabptr_5etree__IDDict;


struct __pyx_obj_5etree__BaseContext {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__BaseContext *__pyx_vtab;
  xmlXPathContext (*_xpathCtxt);
  struct LxmlDocument *_doc;
  PyObject *_extensions;
  PyObject *_namespaces;
  PyObject *_utf_refs;
  PyObject *_function_cache;
  PyObject *_function_cache_ns;
  PyObject *_called_function;
  struct __pyx_obj_5etree__TempStore *_temp_refs;
  struct __pyx_obj_5etree__ExceptionContext *_exc;
};

struct __pyx_vtabstruct_5etree__BaseContext {
  PyObject *((*_copy)(struct __pyx_obj_5etree__BaseContext *));
  PyObject *((*_to_utf)(struct __pyx_obj_5etree__BaseContext *,PyObject *));
  void ((*_set_xpath_context)(struct __pyx_obj_5etree__BaseContext *,xmlXPathContext (*)));
  PyObject *((*_register_context)(struct __pyx_obj_5etree__BaseContext *,struct LxmlDocument *));
  PyObject *((*_unregister_context)(struct __pyx_obj_5etree__BaseContext *));
  PyObject *((*_free_context)(struct __pyx_obj_5etree__BaseContext *));
  PyObject *((*_find_cached_function)(struct __pyx_obj_5etree__BaseContext *,char (*),char (*)));
  int ((*_prepare_function_call)(struct __pyx_obj_5etree__BaseContext *,char (*),char (*)));
  PyObject *((*_release_temp_refs)(struct __pyx_obj_5etree__BaseContext *));
  PyObject *((*_hold)(struct __pyx_obj_5etree__BaseContext *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__BaseContext *__pyx_vtabptr_5etree__BaseContext;


struct __pyx_obj_5etree__XPathContext {
  struct __pyx_obj_5etree__BaseContext __pyx_base;
  PyObject *_variables;
};

struct __pyx_vtabstruct_5etree__XPathContext {
  struct __pyx_vtabstruct_5etree__BaseContext __pyx_base;
  PyObject *((*register_context)(struct __pyx_obj_5etree__XPathContext *,xmlXPathContext (*),struct LxmlDocument *));
  PyObject *((*unregister_context)(struct __pyx_obj_5etree__XPathContext *));
  void ((*_registerVariable)(struct __pyx_obj_5etree__XPathContext *,PyObject *,PyObject *));
};
static struct __pyx_vtabstruct_5etree__XPathContext *__pyx_vtabptr_5etree__XPathContext;


struct __pyx_obj_5etree__XPathEvaluatorBase {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__XPathEvaluatorBase *__pyx_vtab;
  xmlXPathContext (*_xpathCtxt);
  struct __pyx_obj_5etree__XPathContext *_context;
};

struct __pyx_vtabstruct_5etree__XPathEvaluatorBase {
  int ((*_checkAbsolutePath)(struct __pyx_obj_5etree__XPathEvaluatorBase *,char (*)));
  PyObject *((*_raise_parse_error)(struct __pyx_obj_5etree__XPathEvaluatorBase *));
  PyObject *((*_handle_result)(struct __pyx_obj_5etree__XPathEvaluatorBase *,xmlXPathObject (*),struct LxmlDocument *));
};
static struct __pyx_vtabstruct_5etree__XPathEvaluatorBase *__pyx_vtabptr_5etree__XPathEvaluatorBase;


struct __pyx_obj_5etree_XPathElementEvaluator {
  struct __pyx_obj_5etree__XPathEvaluatorBase __pyx_base;
  struct LxmlElement *_element;
};

struct __pyx_vtabstruct_5etree_XPathElementEvaluator {
  struct __pyx_vtabstruct_5etree__XPathEvaluatorBase __pyx_base;
};
static struct __pyx_vtabstruct_5etree_XPathElementEvaluator *__pyx_vtabptr_5etree_XPathElementEvaluator;


struct __pyx_obj_5etree_XPathDocumentEvaluator {
  struct __pyx_obj_5etree_XPathElementEvaluator __pyx_base;
};

struct __pyx_vtabstruct_5etree_XPathDocumentEvaluator {
  struct __pyx_vtabstruct_5etree_XPathElementEvaluator __pyx_base;
};
static struct __pyx_vtabstruct_5etree_XPathDocumentEvaluator *__pyx_vtabptr_5etree_XPathDocumentEvaluator;


struct __pyx_obj_5etree_XPath {
  struct __pyx_obj_5etree__XPathEvaluatorBase __pyx_base;
  xmlXPathCompExpr (*_xpath);
  PyObject *path;
};

struct __pyx_vtabstruct_5etree_XPath {
  struct __pyx_vtabstruct_5etree__XPathEvaluatorBase __pyx_base;
};
static struct __pyx_vtabstruct_5etree_XPath *__pyx_vtabptr_5etree_XPath;


struct __pyx_obj_5etree_ETXPath {
  struct __pyx_obj_5etree_XPath __pyx_base;
};

struct __pyx_vtabstruct_5etree_ETXPath {
  struct __pyx_vtabstruct_5etree_XPath __pyx_base;
  PyObject *((*_nsextract_path)(struct __pyx_obj_5etree_ETXPath *,PyObject *));
};
static struct __pyx_vtabstruct_5etree_ETXPath *__pyx_vtabptr_5etree_ETXPath;


struct __pyx_obj_5etree__XSLTResolverContext {
  struct __pyx_obj_5etree__ResolverContext __pyx_base;
  xmlDoc (*_c_style_doc);
  struct __pyx_obj_5etree__BaseParser *_parser;
};

struct __pyx_vtabstruct_5etree__XSLTResolverContext {
  struct __pyx_vtabstruct_5etree__ResolverContext __pyx_base;
};
static struct __pyx_vtabstruct_5etree__XSLTResolverContext *__pyx_vtabptr_5etree__XSLTResolverContext;


struct __pyx_obj_5etree_XSLTAccessControl {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree_XSLTAccessControl *__pyx_vtab;
  xsltSecurityPrefs (*_prefs);
};

struct __pyx_vtabstruct_5etree_XSLTAccessControl {
  PyObject *((*_setAccess)(struct __pyx_obj_5etree_XSLTAccessControl *,xsltSecurityOption ,PyObject *));
  void ((*_register_in_context)(struct __pyx_obj_5etree_XSLTAccessControl *,xsltTransformContext (*)));
};
static struct __pyx_vtabstruct_5etree_XSLTAccessControl *__pyx_vtabptr_5etree_XSLTAccessControl;


struct __pyx_obj_5etree__XSLTContext {
  struct __pyx_obj_5etree__BaseContext __pyx_base;
  xsltTransformContext (*_xsltCtxt);
};

struct __pyx_vtabstruct_5etree__XSLTContext {
  struct __pyx_vtabstruct_5etree__BaseContext __pyx_base;
  PyObject *((*register_context)(struct __pyx_obj_5etree__XSLTContext *,xsltTransformContext (*),struct LxmlDocument *));
  PyObject *((*free_context)(struct __pyx_obj_5etree__XSLTContext *));
  void ((*_addLocalExtensionFunction)(struct __pyx_obj_5etree__XSLTContext *,PyObject *,PyObject *,PyObject *));
  void ((*_registerExtensionFunctions)(struct __pyx_obj_5etree__XSLTContext *));
};
static struct __pyx_vtabstruct_5etree__XSLTContext *__pyx_vtabptr_5etree__XSLTContext;


struct __pyx_obj_5etree__ExsltRegExp {
  PyObject_HEAD
  struct __pyx_vtabstruct_5etree__ExsltRegExp *__pyx_vtab;
  PyObject *_compile_map;
};

struct __pyx_vtabstruct_5etree__ExsltRegExp {
  PyObject *((*_make_string)(struct __pyx_obj_5etree__ExsltRegExp *,PyObject *));
  PyObject *((*_compile)(struct __pyx_obj_5etree__ExsltRegExp *,PyObject *,PyObject *));
  PyObject *((*_register_in_context)(struct __pyx_obj_5etree__ExsltRegExp *,struct __pyx_obj_5etree__XSLTContext *));
};
static struct __pyx_vtabstruct_5etree__ExsltRegExp *__pyx_vtabptr_5etree__ExsltRegExp;


struct __pyx_obj_5etree_XSLT {
  PyObject_HEAD
  struct __pyx_obj_5etree__XSLTContext *_context;
  xsltStylesheet (*_c_style);
  struct __pyx_obj_5etree__XSLTResolverContext *_xslt_resolver_context;
  struct __pyx_obj_5etree_XSLTAccessControl *_access_control;
  struct __pyx_obj_5etree__ExsltRegExp *_regexp;
  struct __pyx_obj_5etree__ErrorLog *_error_log;
};


struct __pyx_obj_5etree__XSLTResultTree {
  struct LxmlElementTree __pyx_base;
  struct __pyx_obj_5etree_XSLT *_xslt;
  struct LxmlDocument *_profile;
};

struct __pyx_vtabstruct_5etree__XSLTResultTree {
  struct __pyx_vtabstruct_5etree__ElementTree __pyx_base;
  PyObject *((*_saveToStringAndSize)(struct __pyx_obj_5etree__XSLTResultTree *,char (*(*)),int (*)));
};
static struct __pyx_vtabstruct_5etree__XSLTResultTree *__pyx_vtabptr_5etree__XSLTResultTree;


struct __pyx_obj_5etree__XSLTProcessingInstruction {
  struct __pyx_obj_5etree_PIBase __pyx_base;
};

struct __pyx_vtabstruct_5etree__XSLTProcessingInstruction {
  struct __pyx_vtabstruct_5etree_PIBase __pyx_base;
};
static struct __pyx_vtabstruct_5etree__XSLTProcessingInstruction *__pyx_vtabptr_5etree__XSLTProcessingInstruction;


struct __pyx_obj_5etree__Validator {
  PyObject_HEAD
  struct __pyx_obj_5etree__ErrorLog *_error_log;
};


struct __pyx_obj_5etree_RelaxNG {
  struct __pyx_obj_5etree__Validator __pyx_base;
  xmlRelaxNG (*_c_schema);
};


struct __pyx_obj_5etree_XMLSchema {
  struct __pyx_obj_5etree__Validator __pyx_base;
  xmlSchema (*_c_schema);
};

static PyTypeObject *__pyx_ptype_5etree__TempStore = 0;
static PyTypeObject *__pyx_ptype_5etree__ExceptionContext = 0;
static PyTypeObject *__pyx_ptype_5etree_QName = 0;
static PyTypeObject *__pyx_ptype_5etree__BaseParser = 0;
static PyTypeObject *__pyx_ptype_5etree__Document = 0;
static PyTypeObject *__pyx_ptype_5etree_DocInfo = 0;
static PyTypeObject *__pyx_ptype_5etree__Element = 0;
static PyTypeObject *__pyx_ptype_5etree___ContentOnlyElement = 0;
static PyTypeObject *__pyx_ptype_5etree__Comment = 0;
static PyTypeObject *__pyx_ptype_5etree__ProcessingInstruction = 0;
static PyTypeObject *__pyx_ptype_5etree__ElementTree = 0;
static PyTypeObject *__pyx_ptype_5etree__Attrib = 0;
static PyTypeObject *__pyx_ptype_5etree__AttribIterator = 0;
static PyTypeObject *__pyx_ptype_5etree__ElementTagMatcher = 0;
static PyTypeObject *__pyx_ptype_5etree__ElementIterator = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementChildIterator = 0;
static PyTypeObject *__pyx_ptype_5etree_SiblingsIterator = 0;
static PyTypeObject *__pyx_ptype_5etree_AncestorsIterator = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementDepthFirstIterator = 0;
static PyTypeObject *__pyx_ptype_5etree__LogEntry = 0;
static PyTypeObject *__pyx_ptype_5etree__BaseErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree__ListErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree__ErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree__DomainErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree__RotatingErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree_PyErrorLog = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementBase = 0;
static PyTypeObject *__pyx_ptype_5etree_CommentBase = 0;
static PyTypeObject *__pyx_ptype_5etree_PIBase = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_FallbackElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementDefaultClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_ElementNamespaceClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_AttributeBasedElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_ParserBasedElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree_CustomElementClassLookup = 0;
static PyTypeObject *__pyx_ptype_5etree__NamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_5etree__ClassNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_5etree__FunctionNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_5etree__XPathFunctionNamespaceRegistry = 0;
static PyTypeObject *__pyx_ptype_5etree__InputDocument = 0;
static PyTypeObject *__pyx_ptype_5etree_Resolver = 0;
static PyTypeObject *__pyx_ptype_5etree__ResolverRegistry = 0;
static PyTypeObject *__pyx_ptype_5etree__ResolverContext = 0;
static PyTypeObject *__pyx_ptype_5etree__ParserContext = 0;
static PyTypeObject *__pyx_ptype_5etree__FileParserContext = 0;
static PyTypeObject *__pyx_ptype_5etree_XMLParser = 0;
static PyTypeObject *__pyx_ptype_5etree_HTMLParser = 0;
static PyTypeObject *__pyx_ptype_5etree__FilelikeWriter = 0;
static PyTypeObject *__pyx_ptype_5etree__IterparseResolverContext = 0;
static PyTypeObject *__pyx_ptype_5etree_iterparse = 0;
static PyTypeObject *__pyx_ptype_5etree_iterwalk = 0;
static PyTypeObject *__pyx_ptype_5etree__IDDict = 0;
static PyTypeObject *__pyx_ptype_5etree__BaseContext = 0;
static PyTypeObject *__pyx_ptype_5etree__XPathContext = 0;
static PyTypeObject *__pyx_ptype_5etree__XPathEvaluatorBase = 0;
static PyTypeObject *__pyx_ptype_5etree_XPathElementEvaluator = 0;
static PyTypeObject *__pyx_ptype_5etree_XPathDocumentEvaluator = 0;
static PyTypeObject *__pyx_ptype_5etree_XPath = 0;
static PyTypeObject *__pyx_ptype_5etree_ETXPath = 0;
static PyTypeObject *__pyx_ptype_5etree__XSLTResolverContext = 0;
static PyTypeObject *__pyx_ptype_5etree_XSLTAccessControl = 0;
static PyTypeObject *__pyx_ptype_5etree__XSLTContext = 0;
static PyTypeObject *__pyx_ptype_5etree__ExsltRegExp = 0;
static PyTypeObject *__pyx_ptype_5etree_XSLT = 0;
static PyTypeObject *__pyx_ptype_5etree__XSLTResultTree = 0;
static PyTypeObject *__pyx_ptype_5etree__XSLTProcessingInstruction = 0;
static PyTypeObject *__pyx_ptype_5etree__Validator = 0;
static PyTypeObject *__pyx_ptype_5etree_RelaxNG = 0;
static PyTypeObject *__pyx_ptype_5etree_XMLSchema = 0;
static PyObject *__pyx_v_5etree_True;
static PyObject *__pyx_v_5etree_False;
static PyObject *__pyx_v_5etree_set;
static PyObject *__pyx_v_5etree_id;
static PyObject *__pyx_v_5etree_super;
static PyObject *__pyx_v_5etree_StopIteration;
static PyObject *__pyx_v_5etree__elementpath;
static PyObject *__pyx_v_5etree_sys;
static PyObject *__pyx_v_5etree_re;
static PyObject *__pyx_v_5etree_ITER_EMPTY;
static int __pyx_v_5etree___DEBUG;
static int __pyx_v_5etree___MAX_LOG_SIZE;
static PyObject *__pyx_v_5etree__FILENAME_ENCODING;
static char (*__pyx_v_5etree__C_FILENAME_ENCODING);
static PyObject *__pyx_v_5etree__LxmlError;
static PyObject *__pyx_v_5etree__initError;
static int __pyx_v_5etree__LIBXML_VERSION_INT;
static PyThread_type_lock __pyx_v_5etree_ELEMENT_CREATION_LOCK;
static PyObject *__pyx_v_5etree___RE_XML_ENCODING;
static PyObject *__pyx_v_5etree___REPLACE_XML_ENCODING;
static PyObject *__pyx_v_5etree___HAS_XML_ENCODING;
static struct __pyx_obj_5etree__BaseErrorLog *__pyx_v_5etree___GLOBAL_ERROR_LOG;
static PyObject *__pyx_v_5etree___ERROR_LEVELS;
static PyObject *__pyx_v_5etree___ERROR_DOMAINS;
static PyObject *__pyx_v_5etree___ERROR_TYPES;
static PyObject *((*__pyx_v_5etree_LOOKUP_ELEMENT_CLASS)(PyObject *,struct LxmlDocument *,xmlNode (*)));
static PyObject *__pyx_v_5etree_ELEMENT_CLASS_LOOKUP_STATE;
static struct __pyx_obj_5etree_ParserBasedElementClassLookup *__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP;
static PyObject *__pyx_v_5etree___NAMESPACE_REGISTRIES;
static PyObject *__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES;
static struct __pyx_obj_5etree__ParserContext *__pyx_v_5etree___GLOBAL_PARSER_CONTEXT;
static char (*__pyx_v_5etree__UNICODE_ENCODING);
static xmlExternalEntityLoader __pyx_v_5etree___DEFAULT_ENTITY_LOADER;
static int __pyx_v_5etree__XML_DEFAULT_PARSE_OPTIONS;
static struct __pyx_obj_5etree_XMLParser *__pyx_v_5etree___DEFAULT_XML_PARSER;
static int __pyx_v_5etree__HTML_DEFAULT_PARSE_OPTIONS;
static struct __pyx_obj_5etree_HTMLParser *__pyx_v_5etree___DEFAULT_HTML_PARSER;
static PyObject *__pyx_v_5etree___ITERPARSE_CHUNK_SIZE;
static PyObject *__pyx_v_5etree__replace_strings;
static PyObject *__pyx_v_5etree__find_namespaces;
static xsltDocLoaderFunc __pyx_v_5etree_XSLT_DOC_DEFAULT_LOADER;
static PyObject *__pyx_v_5etree__FIND_PI_ATTRIBUTES;
static PyObject *__pyx_v_5etree__RE_PI_HREF;
static PyObject *__pyx_v_5etree__FIND_PI_HREF;
static PyObject *__pyx_v_5etree__REPLACE_PI_HREF;
static struct __pyx_obj_5etree_XPath *__pyx_v_5etree__findStylesheetByID;
static PyObject *__pyx_k26;
static PyObject *__pyx_k27;
static PyObject *__pyx_k28;
static PyObject *__pyx_k29;
static PyObject *__pyx_k30;
static PyObject *__pyx_k31;
static PyObject *__pyx_k32;
static PyObject *__pyx_k33;
static PyObject *__pyx_k34;
static PyObject *__pyx_k35;
static PyObject *__pyx_k36;
static PyObject *__pyx_k37;
static PyObject *__pyx_k38;
static PyObject *__pyx_k39;
static PyObject *__pyx_k40;
static PyObject *__pyx_k41;
static PyObject *__pyx_k42;
static struct __pyx_obj_5etree__BaseParser *__pyx_k43;
static PyObject *__pyx_k44;
static PyObject *__pyx_k45;
static PyObject *__pyx_k46;
static PyObject *__pyx_k47;
static PyObject *__pyx_k48;
static PyObject *__pyx_k49;
static PyObject *__pyx_k50;
static PyObject *__pyx_k51;
static PyObject *__pyx_k52;
static PyObject *__pyx_k53;
static PyObject *__pyx_k54;
static PyObject *__pyx_k55;
static PyObject *__pyx_k56;
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 struct LxmlElement *__pyx_k67;
static PyObject *__pyx_k68;
static struct __pyx_obj_5etree__BaseParser *__pyx_k69;
static struct __pyx_obj_5etree__BaseParser *__pyx_k70;
static struct __pyx_obj_5etree__BaseParser *__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_5etree__BaseParser *__pyx_k77;
static PyObject *__pyx_k79;
static PyObject *__pyx_k80;
static PyObject *__pyx_k81;
static struct LxmlElementClassLookup *__pyx_k100;
static PyObject *__pyx_k101;
static PyObject *__pyx_k102;
static PyObject *__pyx_k103;
static struct LxmlElementClassLookup *__pyx_k104;
static struct LxmlElementClassLookup *__pyx_k105;
static struct LxmlElementClassLookup *__pyx_k106;
static struct LxmlElementClassLookup *__pyx_k107;
static struct LxmlElementClassLookup *__pyx_k108;
static struct __pyx_obj_5etree_Resolver *__pyx_k111;
static PyObject *__pyx_k114;
static PyObject *__pyx_k115;
static struct LxmlElementClassLookup *__pyx_k116;
static PyObject *__pyx_k117;
static PyObject *__pyx_k118;
static PyObject *__pyx_k119;
static PyObject *__pyx_k120;
static PyObject *__pyx_k121;
static PyObject *__pyx_k122;
static PyObject *__pyx_k123;
static PyObject *__pyx_k124;
static PyObject *__pyx_k125;
static PyObject *__pyx_k126;
static struct __pyx_obj_5etree__BaseParser *__pyx_k127;
static PyObject *__pyx_k128;
static PyObject *__pyx_k129;
static PyObject *__pyx_k130;
static PyObject *__pyx_k131;
static PyObject *__pyx_k132;
static PyObject *__pyx_k134;
static PyObject *__pyx_k135;
static PyObject *__pyx_k136;
static PyObject *__pyx_k137;
static PyObject *__pyx_k138;
static PyObject *__pyx_k139;
static PyObject *__pyx_k140;
static PyObject *__pyx_k142;
static PyObject *__pyx_k143;
static PyObject *__pyx_k144;
static PyObject *__pyx_k148;
static PyObject *__pyx_k151;
static PyObject *__pyx_k152;
static PyObject *__pyx_k153;
static PyObject *__pyx_k154;
static PyObject *__pyx_k155;
static PyObject *__pyx_k156;
static PyObject *__pyx_k157;
static PyObject *__pyx_k158;
static PyObject *__pyx_k159;
static PyObject *__pyx_k162;
static PyObject *__pyx_k168;
static PyObject *__pyx_k169;
static PyObject *__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_k183;
static PyObject *__pyx_k184;
static PyObject *__pyx_k186;
static PyObject *__pyx_k188;
static PyObject *__pyx_k192;
static PyObject *__pyx_k193;
static PyObject *__pyx_k197;
static PyObject *__pyx_k198;
static PyObject *(__pyx_f_5etree___unpackDottedVersion(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree___unpackIntVersion(int )); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__documentFactory(xmlDoc (*),struct __pyx_obj_5etree__BaseParser *)); /*proto*/
static struct LxmlElement *(__pyx_f_5etree__elementFactory(struct LxmlDocument *,xmlNode (*))); /*proto*/
static struct LxmlElementTree *(__pyx_f_5etree__elementTreeFactory(struct LxmlDocument *,struct LxmlElement *)); /*proto*/
static struct LxmlElementTree *(__pyx_f_5etree__newElementTree(struct LxmlDocument *,struct LxmlElement *,PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__attributeIteratorFactory(struct LxmlElement *,int )); /*proto*/
static xmlNode (*(__pyx_f_5etree__createElement(xmlDoc (*),PyObject *))); /*proto*/
static xmlNode (*(__pyx_f_5etree__createComment(xmlDoc (*),char (*)))); /*proto*/
static xmlNode (*(__pyx_f_5etree__createPI(xmlDoc (*),char (*),char (*)))); /*proto*/
static struct LxmlElement *(__pyx_f_5etree_getProxy(xmlNode (*))); /*proto*/
static int (__pyx_f_5etree_hasProxy(xmlNode (*))); /*proto*/
static PyObject *(__pyx_f_5etree_registerProxy(struct LxmlElement *)); /*proto*/
static PyObject *(__pyx_f_5etree_unregisterProxy(struct LxmlElement *)); /*proto*/
static xmlDoc (*(__pyx_f_5etree__fakeRootDoc(xmlDoc (*),xmlNode (*)))); /*proto*/
static void (__pyx_f_5etree__destroyFakeDoc(xmlDoc (*),xmlDoc (*))); /*proto*/
static void (__pyx_f_5etree_attemptDeallocation(xmlNode (*))); /*proto*/
static xmlNode (*(__pyx_f_5etree_getDeallocationTop(xmlNode (*)))); /*proto*/
static int (__pyx_f_5etree_canDeallocateChildNodes(xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__deallocDocument(xmlDoc (*))); /*proto*/
static void (__pyx_f_5etree_moveNodeToDocument(struct LxmlElement *,struct LxmlDocument *)); /*proto*/
static void (__pyx_f_5etree_changeDocumentBelow(xmlNode (*),struct LxmlDocument *)); /*proto*/
static void (__pyx_f_5etree_displayNode(xmlNode (*),PyObject *)); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__documentOrRaise(PyObject *)); /*proto*/
static struct LxmlElement *(__pyx_f_5etree__rootNodeOrRaise(PyObject *)); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__documentOf(PyObject *)); /*proto*/
static struct LxmlElement *(__pyx_f_5etree__rootNodeOf(PyObject *)); /*proto*/
static struct LxmlElement *(__pyx_f_5etree__makeElement(PyObject *,xmlDoc (*),struct LxmlDocument *,struct __pyx_obj_5etree__BaseParser *,PyObject *,PyObject *,PyObject *,PyObject *,PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__initNodeAttributes(xmlNode (*),struct LxmlDocument *,PyObject *,PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__attributeValue(xmlNode (*),xmlAttr (*))); /*proto*/
static PyObject *(__pyx_f_5etree__attributeValueFromNsName(xmlNode (*),char (*),char (*))); /*proto*/
static PyObject *(__pyx_f_5etree__getAttributeValue(struct LxmlElement *,PyObject *,PyObject *)); /*proto*/
static int (__pyx_f_5etree__setAttributeValue(struct LxmlElement *,PyObject *,PyObject *)); /*proto*/
static int (__pyx_f_5etree__delAttribute(struct LxmlElement *,PyObject *)); /*proto*/
static int (__pyx_f_5etree__delAttributeFromNsName(xmlNode (*),char (*),char (*))); /*proto*/
static PyObject *(__pyx_f_5etree__stripEncodingDeclaration(PyObject *)); /*proto*/
static int (__pyx_f_5etree__hasEncodingDeclaration(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__stripDeclaration(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__collectText(xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__removeText(xmlNode (*))); /*proto*/
static int (__pyx_f_5etree__setNodeText(xmlNode (*),PyObject *)); /*proto*/
static int (__pyx_f_5etree__setTailText(xmlNode (*),PyObject *)); /*proto*/
static xmlNode (*(__pyx_f_5etree__findChild(xmlNode (*),Py_ssize_t ))); /*proto*/
static xmlNode (*(__pyx_f_5etree__findChildForwards(xmlNode (*),Py_ssize_t ))); /*proto*/
static xmlNode (*(__pyx_f_5etree__findChildBackwards(xmlNode (*),Py_ssize_t ))); /*proto*/
static xmlNode (*(__pyx_f_5etree__textNodeOrSkip(xmlNode (*)))); /*proto*/
static xmlNode (*(__pyx_f_5etree__nextElement(xmlNode (*)))); /*proto*/
static xmlNode (*(__pyx_f_5etree__previousElement(xmlNode (*)))); /*proto*/
static xmlNode (*(__pyx_f_5etree__parentElement(xmlNode (*)))); /*proto*/
static int (__pyx_f_5etree__tagMatches(xmlNode (*),char (*),char (*))); /*proto*/
static void (__pyx_f_5etree__removeNode(xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__moveTail(xmlNode (*),xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__copyTail(xmlNode (*),xmlNode (*))); /*proto*/
static xmlNode (*(__pyx_f_5etree__deleteSlice(xmlNode (*),Py_ssize_t ,Py_ssize_t ))); /*proto*/
static void (__pyx_f_5etree__appendChild(struct LxmlElement *,struct LxmlElement *)); /*proto*/
static int (__pyx_f_5etree_isutf8(char (*))); /*proto*/
static PyObject *(__pyx_f_5etree_funicode(char (*))); /*proto*/
static PyObject *(__pyx_f_5etree__utf8(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__encodeFilename(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__encodeFilenameUTF8(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__getNsTag(PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__namespacedName(xmlNode (*))); /*proto*/
static PyObject *(__pyx_f_5etree__namespacedNameFromNsName(char (*),char (*))); /*proto*/
static PyObject *(__pyx_f_5etree__getFilenameForFile(PyObject *)); /*proto*/
static void (__pyx_f_5etree__nullGenericErrorFunc(void (*),char (*),...)); /*proto*/
static void (__pyx_f_5etree__initThreadLogging(void)); /*proto*/
static void (__pyx_f_5etree_connectErrorLog(void (*))); /*proto*/
static PyObject *(__pyx_f_5etree___copyGlobalErrorLog(void)); /*proto*/
static void (__pyx_f_5etree__forwardError(void (*),xmlError (*))); /*proto*/
static void (__pyx_f_5etree__receiveError(void (*),xmlError (*))); /*proto*/
static void (__pyx_f_5etree__receiveXSLTError(void (*),char (*),...)); /*proto*/
static void (__pyx_f_5etree___initErrorConstants(void)); /*proto*/
static PyObject *(__pyx_f_5etree__lookupDefaultElementClass(PyObject *,struct LxmlDocument *,xmlNode (*))); /*proto*/
static PyObject *(__pyx_f_5etree__attribute_class_lookup(PyObject *,struct LxmlDocument *,xmlNode (*))); /*proto*/
static PyObject *(__pyx_f_5etree__parser_class_lookup(PyObject *,struct LxmlDocument *,xmlNode (*))); /*proto*/
static PyObject *(__pyx_f_5etree__custom_class_lookup(PyObject *,struct LxmlDocument *,xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__setElementClassLookupFunction(PyObject *((*)(PyObject *,struct LxmlDocument *,xmlNode (*))),PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__find_all_extension_prefixes(void)); /*proto*/
static PyObject *(__pyx_f_5etree__iter_extension_function_names(void)); /*proto*/
static PyObject *(__pyx_f_5etree__find_extension(PyObject *,PyObject *)); /*proto*/
static PyObject *(__pyx_f_5etree__find_nselement_class(PyObject *,struct LxmlDocument *,xmlNode (*))); /*proto*/
static int (__pyx_f_5etree__checkThreadDict(xmlDict (*))); /*proto*/
static void (__pyx_f_5etree__setupPythonUnicode(void)); /*proto*/
static char (*(__pyx_f_5etree__findEncodingName(char (*),int ))); /*proto*/
static int (__pyx_f_5etree__readFilelikeParser(void (*),char (*),int )); /*proto*/
static xmlParserInput (*(__pyx_f_5etree__parser_resolve_from_python(char (*),char (*),xmlParserCtxt (*),int (*)))); /*proto*/
static xmlParserInput (*(__pyx_f_5etree__local_resolver(char (*),char (*),xmlParserCtxt (*)))); /*proto*/
static int (__pyx_f_5etree__raiseParseError(xmlParserCtxt (*),PyObject *)); /*proto*/
static xmlDoc (*(__pyx_f_5etree__handleParseResult(xmlParserCtxt (*),xmlDoc (*),PyObject *,int ))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__internalParseDoc(char (*),int ,struct __pyx_obj_5etree__ResolverContext *))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__internalParseDocFromFile(char (*),int ,struct __pyx_obj_5etree__ResolverContext *))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__parseDoc(PyObject *,PyObject *,struct __pyx_obj_5etree__BaseParser *))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__parseDocFromFile(PyObject *,struct __pyx_obj_5etree__BaseParser *))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__parseDocFromFilelike(PyObject *,PyObject *,struct __pyx_obj_5etree__BaseParser *))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__newDoc(void))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__copyDoc(xmlDoc (*),int ))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__copyDocRoot(xmlDoc (*),xmlNode (*)))); /*proto*/
static xmlNode (*(__pyx_f_5etree__copyNodeToDoc(xmlNode (*),xmlDoc (*)))); /*proto*/
static void (__pyx_f_5etree__bugFixURL(xmlDoc (*),xmlDoc (*))); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__parseDocument(PyObject *,struct __pyx_obj_5etree__BaseParser *)); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__parseDocumentFromURL(PyObject *,struct __pyx_obj_5etree__BaseParser *)); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__parseMemoryDocument(PyObject *,PyObject *,struct __pyx_obj_5etree__BaseParser *)); /*proto*/
static struct LxmlDocument *(__pyx_f_5etree__parseFilelikeDocument(PyObject *,PyObject *,struct __pyx_obj_5etree__BaseParser *)); /*proto*/
static PyObject *(__pyx_f_5etree__tostring(struct LxmlElement *,PyObject *,int ,int )); /*proto*/
static PyObject *(__pyx_f_5etree__tounicode(struct LxmlElement *,int )); /*proto*/
static void (__pyx_f_5etree__writeNodeToBuffer(xmlOutputBuffer (*),xmlNode (*),char (*),int ,int )); /*proto*/
static void (__pyx_f_5etree__writeDeclarationToBuffer(xmlOutputBuffer (*),char (*),char (*))); /*proto*/
static void (__pyx_f_5etree__writeTail(xmlOutputBuffer (*),xmlNode (*),char (*),int )); /*proto*/
static int (__pyx_f_5etree__writeFilelikeWriter(void (*),char (*),int )); /*proto*/
static int (__pyx_f_5etree__closeFilelikeWriter(void (*))); /*proto*/
static PyObject *(__pyx_f_5etree__tofilelike(PyObject *,struct LxmlElement *,PyObject *,int ,int )); /*proto*/
static PyObject *(__pyx_f_5etree__tofilelikeC14N(PyObject *,struct LxmlElement *)); /*proto*/
static PyObject *(__pyx_f_5etree__dumpToFile(PyObject *,xmlNode (*),int )); /*proto*/
static int (__pyx_f_5etree__buildIterparseEventFilter(PyObject *)); /*proto*/
static int (__pyx_f_5etree__countNsDefs(xmlNode (*))); /*proto*/
static int (__pyx_f_5etree__appendStartNsEvents(xmlNode (*),PyObject *)); /*proto*/
static void (__pyx_f_5etree__pushSaxStartEvent(xmlParserCtxt (*),xmlNode (*))); /*proto*/
static void (__pyx_f_5etree__pushSaxEndEvent(xmlParserCtxt (*),xmlNode (*))); /*proto*/
static startElementNsSAX2Func (__pyx_f_5etree__getOrigStart(xmlParserCtxt (*))); /*proto*/
static endElementNsSAX2Func (__pyx_f_5etree__getOrigEnd(xmlParserCtxt (*))); /*proto*/
static void (__pyx_f_5etree__saxStart(void (*),char (*),char (*),char (*),int ,char (*(*)),int ,int ,char (*(*)))); /*proto*/
static void (__pyx_f_5etree__saxEnd(void (*),char (*),char (*),char (*))); /*proto*/
static void (__pyx_f_5etree__collectIdHashItemDict(void (*),void (*),char (*))); /*proto*/
static void (__pyx_f_5etree__collectIdHashItemList(void (*),void (*),char (*))); /*proto*/
static void (__pyx_f_5etree__collectIdHashKeys(void (*),void (*),char (*))); /*proto*/
static xmlXPathFunction (__pyx_f_5etree__function_check(void (*),char (*),char (*))); /*proto*/
static xmlXPathObject (*(__pyx_f_5etree__wrapXPathObject(PyObject *))); /*proto*/
static PyObject *(__pyx_f_5etree__unwrapXPathObject(xmlXPathObject (*),struct LxmlDocument *)); /*proto*/
static PyObject *(__pyx_f_5etree__createNodeSetResult(xmlXPathObject (*),struct LxmlDocument *)); /*proto*/
static void (__pyx_f_5etree__freeXPathObject(xmlXPathObject (*))); /*proto*/
static void (__pyx_f_5etree__extension_function_call(struct __pyx_obj_5etree__BaseContext *,PyObject *,xmlXPathParserContext (*),int )); /*proto*/
static void (__pyx_f_5etree__xpath_function_call(xmlXPathParserContext (*),int )); /*proto*/
static void (__pyx_f_5etree__call_python_xpath_function(xmlXPathParserContext (*),int )); /*proto*/
static void (__pyx_f_5etree__call_prepared_function(xmlXPathParserContext (*),int )); /*proto*/
static void (__pyx_f_5etree__call_prepared_python_function(xmlXPathParserContext (*),int )); /*proto*/
static void (__pyx_f_5etree__setupDict(xmlXPathContext (*))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__xslt_resolve_stylesheet(char (*),void (*)))); /*proto*/
static xmlDoc (*(__pyx_f_5etree__xslt_resolve_from_python(char (*),void (*),int ,int (*)))); /*proto*/
static void (__pyx_f_5etree__xslt_store_resolver_exception(char (*),void (*),xsltLoadType )); /*proto*/
static xmlDoc (*(__pyx_f_5etree__xslt_doc_loader(char (*),xmlDict (*),int ,void (*),xsltLoadType ))); /*proto*/
static PyObject *(__pyx_f_5etree__xsltResultTreeFactory(struct LxmlDocument *,struct __pyx_obj_5etree_XSLT *,struct LxmlDocument *)); /*proto*/
static xmlXPathFunction (__pyx_f_5etree__xslt_function_check(void (*),char (*),char (*))); /*proto*/
static void (__pyx_f_5etree_initTransformDict(xsltTransformContext (*))); /*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(void) (setElementClassLookupFunction(PyObject *((*)(PyObject *,struct LxmlDocument *,xmlNode (*))),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(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(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(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) (*(findOrBuildNodeNs(struct LxmlDocument *,xmlNode (*),char (*)))); /*proto*/


/* Implementation of etree */

static char (__pyx_k1[]) = "Element tag\n        ";
static char (__pyx_k2[]) = "Element attribute dictionary. Where possible, use get(), set(),\n        keys() and items() to access element attributes.\n        ";
static char (__pyx_k3[]) = "Text before the first subelement. This is either a string or \n        the value None, if there was no text.\n        ";
static char (__pyx_k4[]) = "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_k5[]) = "Namespace prefix or None.\n        ";
static char (__pyx_k6[]) = "Namespace prefix->URI mapping known in the context of this Element.\n        ";
static char (__pyx_k7[]) = "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_k8[]) = "The parser that was used to parse the document in this ElementTree.\n        ";
static char (__pyx_k9[]) = "Namespace prefix for extension functions.";
static char (__pyx_k10[]) = "Return an ElementTree with profiling data for the stylesheet run.\n        ";
static char (__pyx_k24[]) = "[0-9]+";
static char (__pyx_k25[]) = "Unknown libxml2 version:";
static char (__pyx_k78[]) = "^(\\s*<\\?\\s*xml[^>]+)\\s+encoding\\s*=\\s*\"[^\"]*\"\\s*";
static char (__pyx_k83[]) = "Libxml2 error levels";
static char (__pyx_k85[]) = "Libxml2 error domains";
static char (__pyx_k87[]) = "Libxml2 error types";
static char (__pyx_k88[]) = "NONE=0\nWARNING=1\nERROR=2\nFATAL=3\n";
static char (__pyx_k89[]) = "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_k90[]) = "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_k91[]) = "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_k92[]) = "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_k93[]) = "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_k94[]) = "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_k95[]) = "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_k96[]) = "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_k97[]) = "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_k98[]) = "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_k99[]) = "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_k160[]) = "(\"[^\"]*\")|(\'[^\']*\')";
static char (__pyx_k161[]) = "({[^}]+})";
static char (__pyx_k178[]) = "\\s+(\\w+)\\s*=\\s*[\"\\']([^\"\\']+)[\"\\']";
static char (__pyx_k179[]) = "\\s+href\\s*=\\s*[\"\\']([^\"\\']+)[\"\\']";
static char (__pyx_k180[]) = "//xsl:stylesheet[@xml:id = $id]";
static char (__pyx_k182[]) = "http://www.w3.org/1999/XSL/Transform";
static char (__pyx_k185[]) = "";
static char (__pyx_k187[]) = "";

static PyObject *__pyx_n_tree;
static PyObject *__pyx_n_python;
static PyObject *__pyx_n_config;
static PyObject *__pyx_n_xpath;
static PyObject *__pyx_n_xinclude;
static PyObject *__pyx_n_c14n;
static PyObject *__pyx_n_cstd;
static PyObject *__pyx_n___builtin__;
static PyObject *__pyx_n_DEBUG;
static PyObject *__pyx_n_Error;
static PyObject *__pyx_n_LxmlError;
static PyObject *__pyx_n__superError;
static PyObject *__pyx_n_LxmlSyntaxError;
static PyObject *__pyx_n_DocumentInvalid;
static PyObject *__pyx_n_XIncludeError;
static PyObject *__pyx_n_C14NError;
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_Element;
static PyObject *__pyx_n_Comment;
static PyObject *__pyx_n_ProcessingInstruction;
static PyObject *__pyx_n_SubElement;
static PyObject *__pyx_n_ElementTree;
static PyObject *__pyx_n_HTML;
static PyObject *__pyx_n_XML;
static PyObject *__pyx_n_fromstring;
static PyObject *__pyx_n_iselement;
static PyObject *__pyx_n_dump;
static PyObject *__pyx_n_tostring;
static PyObject *__pyx_n_tounicode;
static PyObject *__pyx_n_parse;
static PyObject *__pyx_n_xmlerror;
static PyObject *__pyx_n_clearErrorLog;
static PyObject *__pyx_n_useGlobalPythonLog;
static PyObject *__pyx_n_ErrorLevels;
static PyObject *__pyx_n_ErrorDomains;
static PyObject *__pyx_n_ErrorTypes;
static PyObject *__pyx_n_setElementClassLookup;
static PyObject *__pyx_n_LxmlRegistryError;
static PyObject *__pyx_n_NamespaceRegistryError;
static PyObject *__pyx_n_Namespace;
static PyObject *__pyx_n_FunctionNamespace;
static PyObject *__pyx_n_xmlparser;
static PyObject *__pyx_n_htmlparser;
static PyObject *__pyx_n_XMLSyntaxError;
static PyObject *__pyx_n_ParserError;
static PyObject *__pyx_n_setDefaultParser;
static PyObject *__pyx_n_getDefaultParser;
static PyObject *__pyx_n_set_default_parser;
static PyObject *__pyx_n_get_default_parser;
static PyObject *__pyx_n_XMLID;
static PyObject *__pyx_n_XMLDTDID;
static PyObject *__pyx_n_parseid;
static PyObject *__pyx_n_XPathError;
static PyObject *__pyx_n_XPathFunctionError;
static PyObject *__pyx_n_XPathResultError;
static PyObject *__pyx_n_Extension;
static PyObject *__pyx_n_XPathContextError;
static PyObject *__pyx_n_XPathSyntaxError;
static PyObject *__pyx_n_XPathEvaluator;
static PyObject *__pyx_n_xslt;
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_relaxng;
static PyObject *__pyx_n_RelaxNGError;
static PyObject *__pyx_n_RelaxNGParseError;
static PyObject *__pyx_n_RelaxNGValidateError;
static PyObject *__pyx_n_xmlschema;
static PyObject *__pyx_n_XMLSchemaError;
static PyObject *__pyx_n_XMLSchemaParseError;
static PyObject *__pyx_n_XMLSchemaValidateError;
static PyObject *__pyx_n_True;
static PyObject *__pyx_n_False;
static PyObject *__pyx_n_set;
static PyObject *__pyx_n_AttributeError;
static PyObject *__pyx_n_sets;
static PyObject *__pyx_n_Set;
static PyObject *__pyx_n_id;
static PyObject *__pyx_n_super;
static PyObject *__pyx_n_StopIteration;
static PyObject *__pyx_n__elementpath;
static PyObject *__pyx_n_sys;
static PyObject *__pyx_n_re;
static PyObject *__pyx_n_getfilesystemencoding;
static PyObject *__pyx_n_getdefaultencoding;
static PyObject *__pyx_n_ascii;
static PyObject *__pyx_n_Exception;
static PyObject *__pyx_n___init__;
static PyObject *__pyx_n_type;
static PyObject *__pyx_n_SyntaxError;
static PyObject *__pyx_n_int;
static PyObject *__pyx_n_match;
static PyObject *__pyx_n_group;
static PyObject *__pyx_n_compile;
static PyObject *__pyx_n_U;
static PyObject *__pyx_n_sub;
static PyObject *__pyx_n_end;
static PyObject *__pyx_n_findall;
static PyObject *__pyx_n_xsl;

static PyObject *__pyx_k24p;
static PyObject *__pyx_k25p;
static PyObject *__pyx_k78p;
static PyObject *__pyx_k83p;
static PyObject *__pyx_k85p;
static PyObject *__pyx_k87p;
static PyObject *__pyx_k88p;
static PyObject *__pyx_k89p;
static PyObject *__pyx_k90p;
static PyObject *__pyx_k91p;
static PyObject *__pyx_k92p;
static PyObject *__pyx_k93p;
static PyObject *__pyx_k94p;
static PyObject *__pyx_k95p;
static PyObject *__pyx_k96p;
static PyObject *__pyx_k97p;
static PyObject *__pyx_k98p;
static PyObject *__pyx_k99p;
static PyObject *__pyx_k160p;
static PyObject *__pyx_k161p;
static PyObject *__pyx_k178p;
static PyObject *__pyx_k179p;
static PyObject *__pyx_k180p;
static PyObject *__pyx_k182p;
static PyObject *__pyx_k185p;
static PyObject *__pyx_k187p;

static PyObject *__pyx_n_error_log;

static PyObject *__pyx_f_5etree_9LxmlError___init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_5etree_9LxmlError___init__ = {"__init__", (PyCFunction)__pyx_f_5etree_9LxmlError___init__, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_f_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) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":89 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PySequence_Tuple(__pyx_v_args); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyObject_CallObject(__pyx_v_5etree__initError, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":90 */
__pyx_2 = __pyx_f_5etree___copyGlobalErrorLog(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_v_self, __pyx_n_error_log, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; 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("etree.LxmlError.__init__");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF(__pyx_v_self);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__superError(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_obj);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":96 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_INCREF(__pyx_v_5etree__LxmlError);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_5etree__LxmlError);
Py_INCREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_obj);
__pyx_2 = PyObject_CallObject(__pyx_v_5etree_super, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PySequence_Tuple(__pyx_v_args); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; 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("etree._superError");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF(__pyx_v_obj);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static PyObject *__pyx_n_replace;
static PyObject *__pyx_n_split;
static PyObject *__pyx_n_ValueError;
static PyObject *__pyx_n_dev;
static PyObject *__pyx_n_alpha;
static PyObject *__pyx_n_beta;
static PyObject *__pyx_n_append;
static PyObject *__pyx_n_tuple;

static PyObject *__pyx_k199p;
static PyObject *__pyx_k200p;
static PyObject *__pyx_k201p;

static char (__pyx_k199[]) = "-";
static char (__pyx_k200[]) = ".";
static char (__pyx_k201[]) = ".";

static PyObject *__pyx_f_5etree___unpackDottedVersion(PyObject *__pyx_v_version) {
PyObject *__pyx_v_version_list;
PyObject *__pyx_v_l;
PyObject *__pyx_v_item;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":122 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; goto __pyx_L1;}
Py_DECREF(__pyx_v_version_list);
__pyx_v_version_list = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":123 */
__pyx_1 = PyObject_GetAttr(__pyx_v_version, __pyx_n_replace); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_INCREF(__pyx_k199p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k199p);
Py_INCREF(__pyx_k200p);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_k200p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; 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 (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_INCREF(__pyx_k201p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k201p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
__pyx_2 = PyList_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
PyList_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyInt_FromLong(4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
__pyx_4 = PyNumber_Multiply(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_2 = PyNumber_Add(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_1 = PySequence_GetSlice(__pyx_2, 0, 4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_l);
__pyx_v_l = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":124 */
__pyx_3 = PyObject_GetIter(__pyx_v_l); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
for (;;) {
  __pyx_4 = PyIter_Next(__pyx_3);
  if (!__pyx_4) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":125 */
  /*try:*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":126 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L4;}
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L4;}
    Py_INCREF(__pyx_v_item);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_item);
    __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 126; goto __pyx_L4;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_item);
    __pyx_v_item = __pyx_4;
    __pyx_4 = 0;
  }
  goto __pyx_L5;
  __pyx_L4:;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;
  Py_XDECREF(__pyx_1); __pyx_1 = 0;
  Py_XDECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":127 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
  __pyx_5 = PyErr_ExceptionMatches(__pyx_2);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_5) {
    __Pyx_AddTraceback("etree.__unpackDottedVersion");
    __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":128 */
    if (PyObject_Cmp(__pyx_v_item, __pyx_n_dev, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; goto __pyx_L1;}
    __pyx_5 = __pyx_5 == 0;
    if (__pyx_5) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":129 */
      __pyx_4 = PyInt_FromLong((-3)); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; goto __pyx_L1;}
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_4;
      __pyx_4 = 0;
      goto __pyx_L6;
    }
    if (PyObject_Cmp(__pyx_v_item, __pyx_n_alpha, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; goto __pyx_L1;}
    __pyx_5 = __pyx_5 == 0;
    if (__pyx_5) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":131 */
      __pyx_2 = PyInt_FromLong((-2)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; goto __pyx_L1;}
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L6;
    }
    if (PyObject_Cmp(__pyx_v_item, __pyx_n_beta, &__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; goto __pyx_L1;}
    __pyx_5 = __pyx_5 == 0;
    if (__pyx_5) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":133 */
      __pyx_1 = PyInt_FromLong((-1)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; goto __pyx_L1;}
      Py_DECREF(__pyx_v_item);
      __pyx_v_item = __pyx_1;
      __pyx_1 = 0;
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  goto __pyx_L1;
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":134 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_version_list, __pyx_n_append); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_INCREF(__pyx_v_item);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_item);
  __pyx_1 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":135 */
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
Py_INCREF(__pyx_v_version_list);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_version_list);
__pyx_1 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
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);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("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_version);
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":138 */
__pyx_1 = PyInt_FromLong(((__pyx_v_c_version / (100 * 100)) % 100)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong(((__pyx_v_c_version / 100) % 100)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; goto __pyx_L1;}
__pyx_3 = PyInt_FromLong((__pyx_v_c_version % 100)); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; goto __pyx_L1;}
__pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; 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("etree.__unpackIntVersion");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static int __pyx_f_5etree_10_TempStore___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":162 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__TempStore *)__pyx_v_self)->_storage);
((struct __pyx_obj_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("etree._TempStore.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_10_TempStore_add(struct __pyx_obj_5etree__TempStore *__pyx_v_self,PyObject *__pyx_v_obj) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_obj);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":165 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
Py_INCREF(__pyx_v_obj);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_obj);
__pyx_2 = PyObject_CallObject(__pyx_v_5etree_id, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyDict_SetItem(__pyx_v_self->_storage,__pyx_2,__pyx_v_obj); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._TempStore.add");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_obj);
}

static void __pyx_f_5etree_10_TempStore_clear(struct __pyx_obj_5etree__TempStore *__pyx_v_self) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":168 */
PyDict_Clear(__pyx_v_self->_storage);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_copy;

static PyObject *__pyx_f_5etree_10_TempStore_dictcopy(struct __pyx_obj_5etree__TempStore *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":171 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self->_storage, __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; 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("etree._TempStore.dictcopy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_17_ExceptionContext_clear(struct __pyx_obj_5etree__ExceptionContext *__pyx_v_self) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":177 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = Py_None;

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_exc_info;

static void __pyx_f_5etree_17_ExceptionContext__store_raised(struct __pyx_obj_5etree__ExceptionContext *__pyx_v_self) {
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":180 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree_sys, __pyx_n_exc_info); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
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("etree._ExceptionContext._store_raised");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":183 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; 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);
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("etree._ExceptionContext._store_exception");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_exception);
}

static int __pyx_f_5etree_17_ExceptionContext__has_raised(struct __pyx_obj_5etree__ExceptionContext *__pyx_v_self) {
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":186 */
__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;
}

static PyObject *__pyx_f_5etree_17_ExceptionContext__raise_if_stored(struct __pyx_obj_5etree__ExceptionContext *__pyx_v_self) {
PyObject *__pyx_v_type;
PyObject *__pyx_v_value;
PyObject *__pyx_v_traceback;
PyObject *__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":189 */
__pyx_1 = __pyx_v_self->_exc_info == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":190 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":191 */
__pyx_2 = PyObject_GetIter(__pyx_v_self->_exc_info); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
Py_DECREF(__pyx_v_type);
__pyx_v_type = __pyx_3;
__pyx_3 = 0;
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_3;
__pyx_3 = 0;
__pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; goto __pyx_L1;}
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 = 191; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":192 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_exc_info);
__pyx_v_self->_exc_info = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":193 */
__pyx_1 = __pyx_v_value == Py_None;
if (__pyx_1) {
  __pyx_1 = __pyx_v_traceback == Py_None;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":194 */
  __Pyx_Raise(__pyx_v_type, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":196 */
  __Pyx_Raise(__pyx_v_type, __pyx_v_value, __pyx_v_traceback);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; goto __pyx_L1;}
}
__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("etree._ExceptionContext._raise_if_stored");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_k205p;

static char (__pyx_k205[]) = "{%s}%s";

static int __pyx_f_5etree_5QName___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"text_or_uri","tag",0};
__pyx_v_tag = __pyx_k26;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":204 */
__pyx_1 = __pyx_v_tag != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":205 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; 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_3 = PyNumber_Remainder(__pyx_k205p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_text_or_uri);
  __pyx_v_text_or_uri = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L2;
}
__pyx_1 = (!_isString(__pyx_v_text_or_uri));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":207 */
  __pyx_2 = str(__pyx_v_text_or_uri); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text_or_uri);
  __pyx_v_text_or_uri = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":208 */
Py_INCREF(__pyx_v_text_or_uri);
Py_DECREF(((struct __pyx_obj_5etree_QName *)__pyx_v_self)->text);
((struct __pyx_obj_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_3);
__Pyx_AddTraceback("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":210 */
Py_INCREF(((struct __pyx_obj_5etree_QName *)__pyx_v_self)->text);
__pyx_r = ((struct __pyx_obj_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;
}

static PyObject *__pyx_n___hash__;

static long __pyx_f_5etree_5QName___hash__(PyObject *__pyx_v_self); /*proto*/
static long __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":212 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree_QName *)__pyx_v_self)->text, __pyx_n___hash__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; 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("etree.QName.__hash__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":214 */
__pyx_1 = str(__pyx_v_one); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
__pyx_2 = str(__pyx_v_other); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 215; goto __pyx_L1;}
__pyx_3 = PyObject_RichCompare(__pyx_1,__pyx_2,__pyx_v_op); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; 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("etree.QName.__richcmp__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_one);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":241 */
__pyx_f_5etree__deallocDocument(((struct LxmlDocument *)__pyx_v_self)->_c_doc);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":245 */
__pyx_v_c_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":246 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":247 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":248 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_self,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; 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("etree._Document.getroot");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_9_Document_getdoctype(struct LxmlDocument *__pyx_v_self) {
xmlDtd (*__pyx_v_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":253 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_public_id);
__pyx_v_public_id = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":254 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_sys_url);
__pyx_v_sys_url = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":255 */
__pyx_v_dtd = __pyx_v_self->_c_doc->intSubset;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":256 */
__pyx_1 = (__pyx_v_dtd != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":257 */
  __pyx_1 = (__pyx_v_dtd->ExternalID != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":258 */
    __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_dtd->ExternalID); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 258; goto __pyx_L1;}
    Py_DECREF(__pyx_v_public_id);
    __pyx_v_public_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":259 */
  __pyx_1 = (__pyx_v_dtd->SystemID != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":260 */
    __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_dtd->SystemID); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":261 */
__pyx_v_dtd = __pyx_v_self->_c_doc->extSubset;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":262 */
__pyx_1 = (__pyx_v_dtd != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":263 */
  __pyx_3 = PyObject_IsTrue(__pyx_v_public_id); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; goto __pyx_L1;}
  __pyx_1 = (!__pyx_3);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_dtd->ExternalID != NULL);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":264 */
    __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_dtd->ExternalID); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; goto __pyx_L1;}
    Py_DECREF(__pyx_v_public_id);
    __pyx_v_public_id = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":265 */
  __pyx_1 = PyObject_IsTrue(__pyx_v_sys_url); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; goto __pyx_L1;}
  __pyx_3 = (!__pyx_1);
  if (__pyx_3) {
    __pyx_3 = (__pyx_v_dtd->SystemID != NULL);
  }
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":266 */
    __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_dtd->SystemID); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":267 */
__pyx_v_c_root_node = xmlDocGetRootElement(__pyx_v_self->_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":268 */
__pyx_1 = (__pyx_v_c_root_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":269 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = Py_None;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":271 */
  __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_c_root_node->name); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; goto __pyx_L1;}
  Py_DECREF(__pyx_v_root_name);
  __pyx_v_root_name = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":272 */
__pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; 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("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;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":276 */
__pyx_v_c_doc = __pyx_v_self->_c_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":277 */
__pyx_1 = (__pyx_v_c_doc->version == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":278 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_version);
  __pyx_v_version = Py_None;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":280 */
  __pyx_2 = PyString_FromString(__pyx_v_c_doc->version); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 280; goto __pyx_L1;}
  Py_DECREF(__pyx_v_version);
  __pyx_v_version = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":281 */
__pyx_1 = (__pyx_v_c_doc->encoding == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":282 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = Py_None;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":284 */
  __pyx_2 = PyString_FromString(__pyx_v_c_doc->encoding); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; goto __pyx_L1;}
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":285 */
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 285; 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("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;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":288 */
__pyx_1 = (__pyx_v_self->_c_doc->URL == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":289 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":291 */
  __pyx_2 = PyString_FromString(__pyx_v_self->_c_doc->URL); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 291; 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("etree._Document.getURL");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static char (__pyx_k206[]) = "ns%d";

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":294 */
__pyx_1 = PyString_FromFormat(__pyx_k206,__pyx_v_self->_ns_counter); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":295 */
__pyx_v_self->_ns_counter = (__pyx_v_self->_ns_counter + 1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":296 */
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("etree._Document.buildNewPrefix");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static xmlNs (*__pyx_f_5etree_9_Document__findOrBuildNodeNs(struct LxmlDocument *__pyx_v_self,xmlNode (*__pyx_v_c_node),char (*__pyx_v_href))) {
xmlNs (*__pyx_v_c_ns);
PyObject *__pyx_v_prefix;
xmlNs (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":303 */
__pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_self->_c_doc,__pyx_v_c_node,__pyx_v_href);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":304 */
__pyx_1 = (__pyx_v_c_ns != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":305 */
  __pyx_r = __pyx_v_c_ns;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":308 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->__pyx_vtab)->buildNewPrefix(__pyx_v_self); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; goto __pyx_L1;}
Py_DECREF(__pyx_v_prefix);
__pyx_v_prefix = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":309 */
__pyx_v_c_ns = xmlNewNs(__pyx_v_c_node,__pyx_v_href,_cstr(__pyx_v_prefix));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":310 */
__pyx_r = __pyx_v_c_ns;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._Document._findOrBuildNodeNs");
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_9_Document__setNodeNs(struct LxmlDocument *__pyx_v_self,xmlNode (*__pyx_v_c_node),char (*__pyx_v_href)) {
xmlNs (*__pyx_v_c_ns);
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":315 */
__pyx_v_c_ns = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_self,__pyx_v_c_node,__pyx_v_href);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":316 */
xmlSetNs(__pyx_v_c_node,__pyx_v_c_ns);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_items;

static void __pyx_f_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_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":329 */
__pyx_1 = PyObject_IsTrue(__pyx_v_nsmap); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":330 */
  __pyx_1 = __pyx_v_node_ns_utf != Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":331 */
    ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->__pyx_vtab)->_setNodeNs(__pyx_v_self,__pyx_v_c_node,_cstr(__pyx_v_node_ns_utf));
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":332 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":334 */
__pyx_v_c_doc = __pyx_v_self->_c_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":335 */
__pyx_3 = PyObject_GetAttr(__pyx_v_nsmap, __pyx_n_items); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
__pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyObject_GetIter(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
for (;;) {
  __pyx_4 = PyIter_Next(__pyx_3);
  if (!__pyx_4) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
    break;
  }
  __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
  Py_DECREF(__pyx_v_prefix);
  __pyx_v_prefix = __pyx_4;
  __pyx_4 = 0;
  __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
  Py_DECREF(__pyx_v_href);
  __pyx_v_href = __pyx_4;
  __pyx_4 = 0;
  if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 335; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":336 */
  __pyx_4 = __pyx_f_5etree__utf8(__pyx_v_href); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 336; goto __pyx_L1;}
  Py_DECREF(__pyx_v_href_utf);
  __pyx_v_href_utf = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":337 */
  __pyx_v_c_href = _cstr(__pyx_v_href_utf);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":338 */
  __pyx_2 = __pyx_v_prefix != Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":339 */
    __pyx_5 = __pyx_f_5etree__utf8(__pyx_v_prefix); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix_utf);
    __pyx_v_prefix_utf = __pyx_5;
    __pyx_5 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":340 */
    __pyx_v_c_prefix = _cstr(__pyx_v_prefix_utf);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":342 */
    __pyx_v_c_prefix = NULL;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":344 */
  __pyx_v_c_ns = xmlSearchNsByHref(__pyx_v_c_doc,__pyx_v_c_node,__pyx_v_c_href);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":345 */
  __pyx_1 = (__pyx_v_c_ns == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":346 */
    __pyx_v_c_ns = xmlNewNs(__pyx_v_c_node,__pyx_v_c_href,__pyx_v_c_prefix);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":347 */
  if (PyObject_Cmp(__pyx_v_href_utf, __pyx_v_node_ns_utf, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":348 */
    xmlSetNs(__pyx_v_c_node,__pyx_v_c_ns);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":349 */
    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_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":351 */
__pyx_1 = __pyx_v_node_ns_utf != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":352 */
  ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->__pyx_vtab)->_setNodeNs(__pyx_v_self,__pyx_v_c_node,_cstr(__pyx_v_node_ns_utf));
  goto __pyx_L9;
}
__pyx_L9:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("etree._Document._setNodeNamespaces");
__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);
}

static struct LxmlDocument *__pyx_f_5etree__documentFactory(xmlDoc (*__pyx_v_c_doc),struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":356 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__Document), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 356; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":357 */
__pyx_v_result->_c_doc = __pyx_v_c_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":358 */
__pyx_v_result->_ns_counter = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":359 */
__pyx_2 = __pyx_v_parser == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":360 */
  __pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":361 */
Py_INCREF(((PyObject *)__pyx_v_parser));
Py_DECREF(((PyObject *)__pyx_v_result->_parser));
__pyx_v_result->_parser = __pyx_v_parser;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":362 */
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("etree._documentFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_k207p;

static char (__pyx_k207[]) = "Could not find root node";

static int __pyx_f_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_7DocInfo___init__[] = "Create a DocInfo object for an ElementTree object or root Element.";
static int __pyx_f_5etree_7DocInfo___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_tree = 0;
struct LxmlDocument *__pyx_v_doc;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
static char *__pyx_argnames[] = {"tree",0};
if (!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_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":376 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_tree)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":377 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getdoctype(__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 377; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":378 */
__pyx_3 = PyObject_IsTrue(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
__pyx_1 = PyInt_FromLong((!__pyx_3)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
__pyx_3 = PyObject_IsTrue(__pyx_1); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
if (__pyx_3) {
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id;
  Py_INCREF(__pyx_1);
  __pyx_3 = PyObject_IsTrue(__pyx_1); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
  if (!__pyx_3) {
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_1 = ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url;
    Py_INCREF(__pyx_1);
  }
}
__pyx_3 = PyObject_IsTrue(__pyx_1); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":379 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k207p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":380 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getxmlinfo(__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->xml_version);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->xml_version = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->encoding);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->encoding = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":381 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getURL(__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->URL);
((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->URL = __pyx_1;
__pyx_1 = 0;

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

static PyObject *__pyx_k208p;
static PyObject *__pyx_k209p;
static PyObject *__pyx_k210p;
static PyObject *__pyx_k211p;

static char (__pyx_k208[]) = "<!DOCTYPE %s PUBLIC \"%s\" \"%s\">";
static char (__pyx_k209[]) = "<!DOCTYPE %s PUBLIC \"%s\">";
static char (__pyx_k210[]) = "<!DOCTYPE %s SYSTEM \"%s\">";
static char (__pyx_k211[]) = "";

static PyObject *__pyx_f_5etree_7DocInfo_7doctype___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_7DocInfo_7doctype___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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":385 */
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":386 */
  __pyx_1 = PyObject_IsTrue(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 386; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":387 */
    __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
    Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
    PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
    Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id);
    PyTuple_SET_ITEM(__pyx_2, 1, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id);
    Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url);
    PyTuple_SET_ITEM(__pyx_2, 2, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url);
    __pyx_3 = PyNumber_Remainder(__pyx_k208p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 387; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":390 */
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
    Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
    PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
    Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id);
    PyTuple_SET_ITEM(__pyx_2, 1, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->public_id);
    __pyx_3 = PyNumber_Remainder(__pyx_k209p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 390; 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;
}
__pyx_1 = PyObject_IsTrue(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 392; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":393 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 394; goto __pyx_L1;}
  Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
  PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->root_name);
  Py_INCREF(((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url);
  PyTuple_SET_ITEM(__pyx_2, 1, ((struct __pyx_obj_5etree_DocInfo *)__pyx_v_self)->system_url);
  __pyx_3 = PyNumber_Remainder(__pyx_k210p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 393; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":396 */
  Py_INCREF(__pyx_k211p);
  __pyx_r = __pyx_k211p;
  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("etree.DocInfo.doctype.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element__init(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

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

static void __pyx_f_5etree_8_Element___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_f_5etree_8_Element___dealloc__(PyObject *__pyx_v_self) {
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":418 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":419 */
  __pyx_2 = __pyx_f_5etree_unregisterProxy(((struct LxmlElement *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":420 */
  __pyx_f_5etree_attemptDeallocation(((struct LxmlElement *)__pyx_v_self)->_c_node);
  goto __pyx_L2;
}
__pyx_L2:;

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

static PyObject *__pyx_n_IndexError;

static int __pyx_f_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index, PyObject *__pyx_v_element); /*proto*/
static char __pyx_doc_5etree_8_Element___setitem__[] = "Replaces the given subelement.\n        ";
static int __pyx_f_5etree_8_Element___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index, PyObject *__pyx_v_element) {
Py_ssize_t __pyx_v_index;
xmlNode (*__pyx_v_c_node);
xmlNode (*__pyx_v_c_next);
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
__pyx_v_index = PyInt_AsSsize_t(__pyx_arg_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; goto __pyx_L1;}
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":429 */
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_index);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":430 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":431 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; goto __pyx_L1;}
  __pyx_3 = PyInt_FromSsize_t(__pyx_v_index); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; 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[0]; __pyx_lineno = 431; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":432 */
__pyx_v_c_next = ((struct LxmlElement *)__pyx_v_element)->_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":433 */
__pyx_f_5etree__removeText(__pyx_v_c_node->next);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":434 */
xmlReplaceNode(__pyx_v_c_node,((struct LxmlElement *)__pyx_v_element)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":435 */
__pyx_f_5etree__moveTail(__pyx_v_c_next,((struct LxmlElement *)__pyx_v_element)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":436 */
__pyx_f_5etree_moveNodeToDocument(((struct LxmlElement *)__pyx_v_element),((struct LxmlElement *)__pyx_v_self)->_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":437 */
__pyx_f_5etree_attemptDeallocation(__pyx_v_c_node);

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

static int __pyx_f_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_5etree_8_Element___delitem__[] = "Deletes the given subelement.\n        ";
static int __pyx_f_5etree_8_Element___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
Py_ssize_t __pyx_v_index;
xmlNode (*__pyx_v_c_node);
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_index = PyInt_AsSsize_t(__pyx_arg_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 439; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":443 */
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_index);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":444 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":445 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
  __pyx_3 = PyInt_FromSsize_t(__pyx_v_index); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; 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[0]; __pyx_lineno = 445; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":446 */
__pyx_f_5etree__removeText(__pyx_v_c_node->next);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":447 */
__pyx_f_5etree__removeNode(__pyx_v_c_node);

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

static int __pyx_f_5etree_8_Element___delslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop); /*proto*/
static char __pyx_doc_5etree_8_Element___delslice__[] = "Deletes a number of subelements.\n        ";
static int __pyx_f_5etree_8_Element___delslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop) {
xmlNode (*__pyx_v_c_node);
int __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":453 */
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_start);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":454 */
__pyx_f_5etree__deleteSlice(__pyx_v_c_node,__pyx_v_start,__pyx_v_stop);

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

static PyObject *__pyx_n_TypeError;

static PyObject *__pyx_k212p;

static char (__pyx_k212[]) = "Node must not be None.";

static int __pyx_f_5etree_8_Element___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, PyObject *__pyx_v_value); /*proto*/
static char __pyx_doc_5etree_8_Element___setslice__[] = "Replaces a number of subelements with elements\n        from a sequence.\n        ";
static int __pyx_f_5etree_8_Element___setslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, PyObject *__pyx_v_value) {
xmlNode (*__pyx_v_c_node);
xmlNode (*__pyx_v_c_next);
struct LxmlElement *__pyx_v_element;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":464 */
__pyx_1 = (__pyx_v_start == PY_SSIZE_T_MAX);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":465 */
  __pyx_v_c_node = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":467 */
  __pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_start);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":469 */
  __pyx_1 = (__pyx_v_start != __pyx_v_stop);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":470 */
    __pyx_v_c_node = __pyx_f_5etree__deleteSlice(__pyx_v_c_node,__pyx_v_start,__pyx_v_stop);
    goto __pyx_L3;
  }
  __pyx_L3:;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":472 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":473 */
  __pyx_2 = PyObject_GetIter(__pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}
      break;
    }
    if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_3);
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":474 */
    __pyx_f_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),__pyx_v_element);
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":475 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":477 */
__pyx_3 = PyObject_GetIter(__pyx_v_value); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_3);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}
    break;
  }
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_element));
  __pyx_v_element = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":478 */
  __pyx_1 = __pyx_v_element == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":479 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k212p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; goto __pyx_L1;}
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":481 */
  __pyx_v_c_next = __pyx_v_element->_c_node->next;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":483 */
  xmlUnlinkNode(__pyx_v_element->_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":484 */
  xmlAddPrevSibling(__pyx_v_c_node,__pyx_v_element->_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":486 */
  __pyx_f_5etree__moveTail(__pyx_v_c_next,__pyx_v_element->_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":488 */
  __pyx_f_5etree_moveNodeToDocument(__pyx_v_element,((struct LxmlElement *)__pyx_v_self)->_doc);
}
Py_DECREF(__pyx_3); __pyx_3 = 0;

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

static PyObject *__pyx_n___copy__;

static PyObject *__pyx_f_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_8_Element___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_memo = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"memo",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_memo)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_memo);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":491 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n___copy__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; 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("etree._Element.__deepcopy__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_memo);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_8_Element___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
xmlDoc (*__pyx_v_c_doc);
xmlNode (*__pyx_v_c_node);
struct LxmlDocument *__pyx_v_new_doc;
PyObject *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":497 */
__pyx_v_c_doc = __pyx_f_5etree__copyDocRoot(((struct LxmlElement *)__pyx_v_self)->_doc->_c_doc,((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":498 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,((struct LxmlElement *)__pyx_v_self)->_doc->_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_new_doc));
__pyx_v_new_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":499 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_new_doc->__pyx_vtab)->getroot(__pyx_v_new_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; goto __pyx_L1;}
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":500 */
__pyx_2 = __pyx_v_root != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":501 */
  Py_INCREF(__pyx_v_root);
  __pyx_r = __pyx_v_root;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":503 */
__pyx_v_c_node = __pyx_v_c_doc->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":504 */
while (1) {
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (__pyx_2) {
    __pyx_2 = (__pyx_v_c_node->type != ((struct LxmlElement *)__pyx_v_self)->_c_node->type);
  }
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":505 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":506 */
__pyx_2 = (__pyx_v_c_node == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":507 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":508 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_new_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 508; 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("etree._Element.__copy__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_new_doc);
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_set[] = "Sets an element attribute.\n        ";
static PyObject *__pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":513 */
__pyx_1 = __pyx_f_5etree__setAttributeValue(((struct LxmlElement *)__pyx_v_self),__pyx_v_key,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Element.set");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_append[] = "Adds a subelement to the end of this element.\n        ";
static PyObject *__pyx_f_5etree_8_Element_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":518 */
__pyx_f_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),__pyx_v_element);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Element.append");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_extend[] = "Extends the current children by the elements in the iterable.\n        ";
static PyObject *__pyx_f_5etree_8_Element_extend(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_elements = 0;
PyObject *__pyx_v_element;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"elements",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_elements)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_elements);
__pyx_v_element = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":523 */
__pyx_1 = PyObject_GetIter(__pyx_v_elements); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 523; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_element);
  __pyx_v_element = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":524 */
  if (!__Pyx_TypeTest(__pyx_v_element, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
  __pyx_f_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),((struct LxmlElement *)__pyx_v_element));
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._Element.extend");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_elements);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":535 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":537 */
__pyx_f_5etree__removeText(__pyx_v_c_node->children);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":538 */
__pyx_f_5etree__removeText(__pyx_v_c_node->next);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":540 */
__pyx_v_c_attr = __pyx_v_c_node->properties;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":541 */
while (1) {
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":542 */
  __pyx_v_c_attr_next = __pyx_v_c_attr->next;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":543 */
  xmlRemoveProp(__pyx_v_c_attr);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":544 */
  __pyx_v_c_attr = __pyx_v_c_attr_next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":546 */
__pyx_v_c_node = __pyx_v_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":547 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":548 */
  __pyx_v_c_node_next = __pyx_v_c_node->next;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":549 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":550 */
    __pyx_f_5etree__removeText(__pyx_v_c_node_next);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":551 */
    __pyx_v_c_node_next = __pyx_v_c_node->next;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":552 */
    __pyx_f_5etree__removeNode(__pyx_v_c_node);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":553 */
  __pyx_v_c_node = __pyx_v_c_node_next;
}

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

static PyObject *__pyx_f_5etree_8_Element_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_insert[] = "Inserts a subelement at the given position in this element\n        ";
static PyObject *__pyx_f_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;
static char *__pyx_argnames[] = {"index","element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_index, &__pyx_v_element)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_index);
Py_INCREF(__pyx_v_element);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":560 */
__pyx_1 = PyInt_AsSsize_t(__pyx_v_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 560; goto __pyx_L1;}
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":561 */
__pyx_2 = (__pyx_v_c_node == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":562 */
  __pyx_f_5etree__appendChild(((struct LxmlElement *)__pyx_v_self),__pyx_v_element);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":563 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":564 */
__pyx_v_c_next = __pyx_v_element->_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":565 */
xmlAddPrevSibling(__pyx_v_c_node,__pyx_v_element->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":566 */
__pyx_f_5etree__moveTail(__pyx_v_c_next,__pyx_v_element->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":567 */
__pyx_f_5etree_moveNodeToDocument(__pyx_v_element,((struct LxmlElement *)__pyx_v_self)->_doc);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Element.insert");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_index);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static PyObject *__pyx_k213p;

static char (__pyx_k213[]) = "Element is not a child of this node.";

static PyObject *__pyx_f_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
xmlNode (*__pyx_v_c_node);
xmlNode (*__pyx_v_c_next);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":576 */
__pyx_v_c_node = __pyx_v_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":577 */
__pyx_1 = (__pyx_v_c_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":578 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k213p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":579 */
__pyx_v_c_next = __pyx_v_element->_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":580 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":581 */
__pyx_f_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._Element.remove");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static PyObject *__pyx_k214p;

static char (__pyx_k214[]) = "Element is not a child of this node.";

static PyObject *__pyx_f_5etree_8_Element_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_replace[] = "Replaces a subelement with the element passed as second argument.\n        ";
static PyObject *__pyx_f_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;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"old_element","new_element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_old_element, &__pyx_v_new_element)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_old_element);
Py_INCREF(__pyx_v_new_element);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_old_element), __pyx_ptype_5etree__Element, 0, "old_element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 583; goto __pyx_L1;}
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_new_element), __pyx_ptype_5etree__Element, 0, "new_element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":591 */
__pyx_v_c_old_node = __pyx_v_old_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":592 */
__pyx_1 = (__pyx_v_c_old_node->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":593 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k214p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":594 */
__pyx_v_c_old_next = __pyx_v_c_old_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":595 */
__pyx_v_c_new_node = __pyx_v_new_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":596 */
__pyx_v_c_new_next = __pyx_v_c_new_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":597 */
xmlReplaceNode(__pyx_v_c_old_node,__pyx_v_c_new_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":598 */
__pyx_f_5etree__moveTail(__pyx_v_c_new_next,__pyx_v_c_new_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":599 */
__pyx_f_5etree__moveTail(__pyx_v_c_old_next,__pyx_v_c_old_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":600 */
__pyx_f_5etree_moveNodeToDocument(__pyx_v_new_element,((struct LxmlElement *)__pyx_v_self)->_doc);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._Element.replace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_old_element);
Py_DECREF(__pyx_v_new_element);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_3tag___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":607 */
__pyx_1 = ((struct LxmlElement *)__pyx_v_self)->_tag != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":608 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":609 */
__pyx_2 = __pyx_f_5etree__namespacedName(((struct LxmlElement *)__pyx_v_self)->_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; goto __pyx_L1;}
Py_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":610 */
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("etree._Element.tag.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_5etree_8_Element_3tag___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
PyObject *__pyx_v_ns;
PyObject *__pyx_v_text;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);
__pyx_v_text = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":613 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_value); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 613; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":614 */
Py_INCREF(__pyx_v_value);
Py_DECREF(((struct LxmlElement *)__pyx_v_self)->_tag);
((struct LxmlElement *)__pyx_v_self)->_tag = __pyx_v_value;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":615 */
xmlNodeSetName(((struct LxmlElement *)__pyx_v_self)->_c_node,_cstr(__pyx_v_text));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":616 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":617 */
  ((struct LxmlElement *)__pyx_v_self)->_c_node->ns = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":619 */
  ((struct __pyx_vtabstruct_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));
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._Element.tag.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_6attrib___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":626 */
__pyx_1 = ((struct LxmlElement *)__pyx_v_self)->_attrib == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":627 */
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__Attrib), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 627; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":628 */
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("etree._Element.attrib.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":635 */
__pyx_1 = __pyx_f_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->children); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 635; 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("etree._Element.text.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_8_Element_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_5etree_8_Element_4text___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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":638 */
__pyx_1 = __pyx_f_5etree__setNodeText(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 638; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Element.text.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":646 */
__pyx_1 = __pyx_f_5etree__collectText(((struct LxmlElement *)__pyx_v_self)->_c_node->next); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 646; 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("etree._Element.tail.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_8_Element_4tail___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":649 */
__pyx_1 = __pyx_f_5etree__setTailText(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Element.tail.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_6prefix___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":656 */
__pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":657 */
  __pyx_1 = (((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":658 */
    __pyx_2 = __pyx_f_5etree_funicode(((struct LxmlElement *)__pyx_v_self)->_c_node->ns->prefix); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":659 */
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("etree._Element.prefix.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_5nsmap___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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;
Py_INCREF(__pyx_v_self);
__pyx_v_nsmap = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":668 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 668; goto __pyx_L1;}
Py_DECREF(__pyx_v_nsmap);
__pyx_v_nsmap = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":669 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":670 */
while (1) {
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (__pyx_2) {
    __pyx_2 = _isElement(__pyx_v_c_node);
  }
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":671 */
  __pyx_v_c_ns = __pyx_v_c_node->nsDef;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":672 */
  while (1) {
    __pyx_2 = (__pyx_v_c_ns != NULL);
    if (!__pyx_2) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":673 */
    __pyx_2 = (__pyx_v_c_ns->prefix == NULL);
    if (__pyx_2) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":674 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = Py_None;
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":676 */
      __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_ns->prefix); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; goto __pyx_L1;}
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":677 */
    __pyx_2 = PySequence_Contains(__pyx_v_nsmap, __pyx_v_prefix); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 677; goto __pyx_L1;}
    __pyx_2 = !__pyx_2;
    if (__pyx_2) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":678 */
      __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_ns->href); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; goto __pyx_L1;}
      if (PyObject_SetItem(__pyx_v_nsmap, __pyx_v_prefix, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 678; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":679 */
    __pyx_v_c_ns = __pyx_v_c_ns->next;
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":680 */
  __pyx_v_c_node = __pyx_v_c_node->parent;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":681 */
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("etree._Element.nsmap.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_nsmap);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_tag;

static PyObject *__pyx_k215p;

static char (__pyx_k215[]) = "<Element %s at %x>";

static PyObject *__pyx_f_5etree_8_Element___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":685 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_tag); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PyObject_CallObject(__pyx_v_5etree_id, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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_k215p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 685; 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("etree._Element.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k216p;

static char (__pyx_k216[]) = "list index out of range";

static PyObject *__pyx_f_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index); /*proto*/
static char __pyx_doc_5etree_8_Element___getitem__[] = "Returns the given subelement.\n        ";
static PyObject *__pyx_f_5etree_8_Element___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_arg_index) {
Py_ssize_t __pyx_v_index;
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_index = PyInt_AsSsize_t(__pyx_arg_index); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":691 */
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_index);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":692 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":693 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k216p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":694 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; 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("etree._Element.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element___getslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop); /*proto*/
static char __pyx_doc_5etree_8_Element___getslice__[] = "Returns a list containing subelements in the given range.\n        ";
static PyObject *__pyx_f_5etree_8_Element___getslice__(PyObject *__pyx_v_self, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop) {
xmlNode (*__pyx_v_c_node);
struct LxmlDocument *__pyx_v_doc;
Py_ssize_t __pyx_v_c;
PyObject *__pyx_v_result;
PyObject *__pyx_v_ret;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);
__pyx_v_ret = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":705 */
__pyx_v_c_node = __pyx_f_5etree__findChild(((struct LxmlElement *)__pyx_v_self)->_c_node,__pyx_v_start);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":706 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":707 */
  __pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 707; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":708 */
__pyx_v_c = __pyx_v_start;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":709 */
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 709; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":710 */
Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_self)->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlElement *)__pyx_v_self)->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":711 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_c < __pyx_v_stop);
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":712 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":713 */
    __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}
    __pyx_1 = PyList_Append(__pyx_v_result,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 713; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ret);
    __pyx_v_ret = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":714 */
    __pyx_1 = PyObject_IsTrue(__pyx_v_ret); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 714; goto __pyx_L1;}
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":715 */
      __Pyx_ReRaise();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 715; goto __pyx_L1;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":716 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":717 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":718 */
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("etree._Element.__getslice__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_ret);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static Py_ssize_t __pyx_f_5etree_8_Element___len__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_5etree_8_Element___len__[] = "Returns the number of subelements.\n        ";
static Py_ssize_t __pyx_f_5etree_8_Element___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_v_c;
xmlNode (*__pyx_v_c_node);
Py_ssize_t __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":725 */
__pyx_v_c = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":726 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":727 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":728 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":729 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":730 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":731 */
__pyx_r = __pyx_v_c;
goto __pyx_L0;

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

static int __pyx_f_5etree_8_Element___nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_f_5etree_8_Element___nonzero__(PyObject *__pyx_v_self) {
xmlNode (*__pyx_v_c_node);
int __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":735 */
__pyx_v_c_node = __pyx_f_5etree__findChildBackwards(((struct LxmlElement *)__pyx_v_self)->_c_node,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":736 */
__pyx_r = (__pyx_v_c_node != NULL);
goto __pyx_L0;

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

static int __pyx_f_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element); /*proto*/
static int __pyx_f_5etree_8_Element___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_element) {
xmlNode (*__pyx_v_c_node);
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_element);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":740 */
__pyx_1 = (!isinstance(__pyx_v_element,((PyObject*)__pyx_ptype_5etree__Element)));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":741 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":742 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_element)->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":743 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {
  __pyx_1 = (__pyx_v_c_node->parent == ((struct LxmlElement *)__pyx_v_self)->_c_node);
}
__pyx_r = __pyx_1;
goto __pyx_L0;

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

static PyObject *__pyx_f_5etree_8_Element___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":746 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_ElementChildIterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; 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("etree._Element.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_reversed;


static PyObject *__pyx_f_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_8_Element___reversed__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":749 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_n_reversed, __pyx_v_5etree_True) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_5etree_ElementChildIterator), __pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 749; 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("etree._Element.__reversed__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k218p;
static PyObject *__pyx_k219p;
static PyObject *__pyx_k220p;
static PyObject *__pyx_k221p;
static PyObject *__pyx_k222p;
static PyObject *__pyx_k223p;

static char (__pyx_k218[]) = "Element is not a child of this node.";
static char (__pyx_k219[]) = "list.index(x): x not in slice";
static char (__pyx_k220[]) = "list.index(x): x not in slice";
static char (__pyx_k221[]) = "list.index(x): x not in slice";
static char (__pyx_k222[]) = "list.index(x): x not in slice";
static char (__pyx_k223[]) = "list.index(x): x not in list";

static PyObject *__pyx_f_5etree_8_Element_index(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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_k27;
__pyx_v_stop = __pyx_k28;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_x, &__pyx_v_start, &__pyx_v_stop)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_x);
Py_INCREF(__pyx_v_start);
Py_INCREF(__pyx_v_stop);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5etree__Element, 0, "x")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":760 */
__pyx_v_c_child = __pyx_v_x->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":761 */
__pyx_1 = (__pyx_v_c_child->parent != ((struct LxmlElement *)__pyx_v_self)->_c_node);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":762 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k218p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 762; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":764 */
__pyx_1 = __pyx_v_start == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":765 */
  __pyx_v_c_start = 0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":767 */
  __pyx_3 = PyInt_AsSsize_t(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 767; goto __pyx_L1;}
  __pyx_v_c_start = __pyx_3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":768 */
__pyx_1 = __pyx_v_stop == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":769 */
  __pyx_v_c_stop = 0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":771 */
  __pyx_3 = PyInt_AsSsize_t(__pyx_v_stop); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; goto __pyx_L1;}
  __pyx_v_c_stop = __pyx_3;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":772 */
  __pyx_1 = (__pyx_v_c_stop == 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_start >= __pyx_v_c_stop);
    if (__pyx_1) {
      __pyx_1 = (__pyx_v_c_stop > 0);
      if (!__pyx_1) {
        __pyx_1 = (__pyx_v_c_start < 0);
      }
    }
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":774 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k219p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 774; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":777 */
__pyx_1 = (__pyx_v_c_start < 0);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_c_stop < 0);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":779 */
  __pyx_1 = (__pyx_v_c_start < __pyx_v_c_stop);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":780 */
    __pyx_v_k = (-__pyx_v_c_start);
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":782 */
    __pyx_v_k = (-__pyx_v_c_stop);
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":783 */
  __pyx_v_c_start_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->last;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":784 */
  __pyx_v_l = 1;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":785 */
  while (1) {
    __pyx_1 = (__pyx_v_c_start_node != __pyx_v_c_child);
    if (__pyx_1) {
      __pyx_1 = (__pyx_v_l < __pyx_v_k);
    }
    if (!__pyx_1) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":786 */
    __pyx_1 = _isElement(__pyx_v_c_start_node);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":787 */
      __pyx_v_l = (__pyx_v_l + 1);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":788 */
    __pyx_v_c_start_node = __pyx_v_c_start_node->prev;
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":789 */
  __pyx_1 = (__pyx_v_c_start_node == __pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":791 */
    __pyx_1 = (__pyx_v_c_stop < 0);
    if (__pyx_1) {
      __pyx_1 = (__pyx_v_l <= (-__pyx_v_c_stop));
    }
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":792 */
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;}
      __Pyx_Raise(__pyx_2, __pyx_k220p, 0);
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; goto __pyx_L1;}
      goto __pyx_L12;
    }
    __pyx_L12:;
    goto __pyx_L11;
  }
  __pyx_1 = (__pyx_v_c_start < 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":794 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k221p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; goto __pyx_L1;}
    goto __pyx_L11;
  }
  __pyx_L11:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":797 */
__pyx_v_c_child = __pyx_v_c_child->prev;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":798 */
__pyx_v_k = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":799 */
__pyx_1 = (__pyx_v_c_stop > 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":801 */
  while (1) {
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (__pyx_1) {
      __pyx_1 = (__pyx_v_k < __pyx_v_c_stop);
    }
    if (!__pyx_1) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":802 */
    __pyx_1 = _isElement(__pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":803 */
      __pyx_v_k = (__pyx_v_k + 1);
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":804 */
    __pyx_v_c_child = __pyx_v_c_child->prev;
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":805 */
  __pyx_1 = (__pyx_v_k < __pyx_v_c_stop);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":806 */
    __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L17;
  }
  __pyx_L17:;
  goto __pyx_L13;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":809 */
  while (1) {
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (!__pyx_1) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":810 */
    __pyx_1 = _isElement(__pyx_v_c_child);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":811 */
      __pyx_v_k = (__pyx_v_k + 1);
      goto __pyx_L20;
    }
    __pyx_L20:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":812 */
    __pyx_v_c_child = __pyx_v_c_child->prev;
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":813 */
  __pyx_1 = (__pyx_v_c_start > 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":814 */
    __pyx_1 = (__pyx_v_k >= __pyx_v_c_start);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":815 */
      __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; goto __pyx_L1;}
      __pyx_r = __pyx_2;
      __pyx_2 = 0;
      goto __pyx_L0;
      goto __pyx_L22;
    }
    __pyx_L22:;
    goto __pyx_L21;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":817 */
    __pyx_2 = PyInt_FromSsize_t(__pyx_v_k); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L21:;
}
__pyx_L13:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":818 */
__pyx_1 = (__pyx_v_c_start != 0);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_c_stop != 0);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":819 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k222p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; goto __pyx_L1;}
  goto __pyx_L23;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":821 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k223p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; goto __pyx_L1;}
}
__pyx_L23:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._Element.index");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_8_Element_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_get[] = "Gets an element attribute.\n        ";
static PyObject *__pyx_f_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_k29;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":826 */
__pyx_1 = __pyx_f_5etree__getAttributeValue(((struct LxmlElement *)__pyx_v_self),__pyx_v_key,__pyx_v_default); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 826; 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("etree._Element.get");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_keys[] = "Gets a list of attribute names. The names are returned in an arbitrary\n        order (just like for an ordinary Python dictionary).\n        ";
static PyObject *__pyx_f_5etree_8_Element_keys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":832 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(((struct LxmlElement *)__pyx_v_self),1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; goto __pyx_L1;}
__pyx_2 = PySequence_List(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; 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("etree._Element.keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_items[] = "Gets element attributes, as a sequence. The attributes are returned in\n        an arbitrary order.\n        ";
static PyObject *__pyx_f_5etree_8_Element_items(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":838 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(((struct LxmlElement *)__pyx_v_self),3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; goto __pyx_L1;}
__pyx_2 = PySequence_List(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 838; 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("etree._Element.items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_getchildren[] = "Returns all subelements. The elements are returned in document order.\n        ";
static PyObject *__pyx_f_5etree_8_Element_getchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
xmlNode (*__pyx_v_c_node);
struct LxmlDocument *__pyx_v_doc;
int __pyx_v_ret;
PyObject *__pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":846 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 846; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":847 */
Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_self)->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlElement *)__pyx_v_self)->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":848 */
__pyx_v_c_node = ((struct LxmlElement *)__pyx_v_self)->_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":849 */
while (1) {
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":850 */
  __pyx_2 = _isElement(__pyx_v_c_node);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":851 */
    __pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
    __pyx_2 = PyList_Append(__pyx_v_result,__pyx_1); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_v_ret = __pyx_2;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":852 */
    __pyx_2 = __pyx_v_ret;
    if (__pyx_2) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":853 */
      __Pyx_ReRaise();
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 853; goto __pyx_L1;}
      goto __pyx_L5;
    }
    __pyx_L5:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":854 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":855 */
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("etree._Element.getchildren");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_getparent[] = "Returns the parent of this element or None for the root element.\n        ";
static PyObject *__pyx_f_5etree_8_Element_getparent(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":861 */
__pyx_v_c_node = __pyx_f_5etree__parentElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":862 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":863 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":865 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; 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("etree._Element.getparent");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_getnext[] = "Returns the following sibling of this element or None.\n        ";
static PyObject *__pyx_f_5etree_8_Element_getnext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":871 */
__pyx_v_c_node = __pyx_f_5etree__nextElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":872 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":873 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":874 */
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("etree._Element.getnext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_getprevious[] = "Returns the preceding sibling of this element or None.\n        ";
static PyObject *__pyx_f_5etree_8_Element_getprevious(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":880 */
__pyx_v_c_node = __pyx_f_5etree__previousElement(((struct LxmlElement *)__pyx_v_self)->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":881 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":882 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlElement *)__pyx_v_self)->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":883 */
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("etree._Element.getprevious");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element_itersiblings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_preceding = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"preceding","tag",0};
__pyx_v_preceding = __pyx_k30;
__pyx_v_tag = __pyx_k31;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_preceding, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_preceding);
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":893 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_preceding);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_preceding);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_SiblingsIterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 893; 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("etree._Element.itersiblings");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_preceding);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_iterancestors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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_k32;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":901 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; 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_5etree_AncestorsIterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; 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("etree._Element.iterancestors");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_iterdescendants(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_iterdescendants[] = "Iterate over the descendants of this element in document order.\n\n        As opposed to getiterator(), 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_f_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;
static char *__pyx_argnames[] = {"tag",0};
__pyx_v_tag = __pyx_k33;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":910 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; 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);
Py_INCREF(__pyx_v_5etree_False);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_5etree_False);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_ElementDepthFirstIterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 910; 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("etree._Element.iterdescendants");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element_iterchildren(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_reversed = 0;
PyObject *__pyx_v_tag = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"reversed","tag",0};
__pyx_v_reversed = __pyx_k34;
__pyx_v_tag = __pyx_k35;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OO", __pyx_argnames, &__pyx_v_reversed, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_reversed);
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":919 */
__pyx_1 = PyTuple_New(3); if (!__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);
Py_INCREF(__pyx_v_reversed);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_reversed);
Py_INCREF(__pyx_v_tag);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_tag);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_ElementChildIterator), __pyx_1); if (!__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("etree._Element.iterchildren");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_reversed);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_8_Element_getroottree(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":928 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__elementTreeFactory(((struct LxmlElement *)__pyx_v_self)->_doc,((struct LxmlElement *)Py_None))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 928; 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("etree._Element.getroottree");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_getiterator[] = "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 or from a\n        namespace.\n        ";
static PyObject *__pyx_f_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_k36;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":937 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; 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_5etree_ElementDepthFirstIterator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 937; 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("etree._Element.getiterator");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_makeelement[] = "Creates a new element associated with the same document.\n        ";
static PyObject *__pyx_f_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_k37;
__pyx_v_nsmap = __pyx_k38;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":942 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__makeElement(__pyx_v__tag,NULL,((struct LxmlElement *)__pyx_v_self)->_doc,((struct __pyx_obj_5etree__BaseParser *)Py_None),Py_None,Py_None,__pyx_v_attrib,__pyx_v_nsmap,__pyx_v__extra)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 942; 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("etree._Element.makeelement");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_find;

static PyObject *__pyx_f_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_find[] = "Finds the first matching subelement, by tag name or path.\n        ";
static PyObject *__pyx_f_5etree_8_Element_find(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"path",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_path)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":948 */
__pyx_1 = isinstance(__pyx_v_path,((PyObject*)__pyx_ptype_5etree_QName));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":949 */
  Py_INCREF(((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":950 */
__pyx_2 = PyObject_GetAttr(__pyx_v_5etree__elementpath, __pyx_n_find); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; 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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 950; 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("etree._Element.find");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

static PyObject *__pyx_n_findtext;

static PyObject *__pyx_f_5etree_8_Element_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_findtext[] = "Finds text for the first matching subelement, by tag name or path.\n        ";
static PyObject *__pyx_f_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_k39;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_path, &__pyx_v_default)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_default);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":955 */
__pyx_1 = isinstance(__pyx_v_path,((PyObject*)__pyx_ptype_5etree_QName));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":956 */
  Py_INCREF(((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":957 */
__pyx_2 = PyObject_GetAttr(__pyx_v_5etree__elementpath, __pyx_n_findtext); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; goto __pyx_L1;}
__pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; 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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 957; 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("etree._Element.findtext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_findall[] = "Finds all matching subelements, by tag name or path.\n        ";
static PyObject *__pyx_f_5etree_8_Element_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"path",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_path)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":962 */
__pyx_1 = isinstance(__pyx_v_path,((PyObject*)__pyx_ptype_5etree_QName));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":963 */
  Py_INCREF(((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text);
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = ((struct __pyx_obj_5etree_QName *)__pyx_v_path)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":964 */
__pyx_2 = PyObject_GetAttr(__pyx_v_5etree__elementpath, __pyx_n_findall); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; 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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 964; 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("etree._Element.findall");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

static PyObject *__pyx_n_evaluate;

static PyObject *__pyx_f_5etree_8_Element_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8_Element_xpath[] = "Evaluate an xpath expression using the element as context node.\n        ";
static PyObject *__pyx_f_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_k40;
__pyx_v_extensions = __pyx_k41;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__variables) < 0) return 0;
if (!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 0;
}
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":969 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_extensions);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XPathElementEvaluator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 969; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_evaluator);
__pyx_v_evaluator = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":970 */
__pyx_1 = PyObject_GetAttr(__pyx_v_evaluator, __pyx_n_evaluate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; goto __pyx_L1;}
Py_INCREF(__pyx_v__path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__path);
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_v__variables); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 970; 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("etree._Element.xpath");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n__init;

static struct LxmlElement *__pyx_f_5etree__elementFactory(struct LxmlDocument *__pyx_v_doc,xmlNode (*__pyx_v_c_node)) {
PyThreadState (*__pyx_v_state);
struct LxmlElement *__pyx_v_result;
PyObject *__pyx_v_element_class;
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":982 */
__pyx_1 = ((PyObject *)__pyx_f_5etree_getProxy(__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 982; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":983 */
__pyx_2 = __pyx_v_result != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":984 */
  Py_INCREF(((PyObject *)__pyx_v_result));
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":985 */
__pyx_2 = (__pyx_v_c_node == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":986 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 986; goto __pyx_L1;}
  Py_INCREF(Py_None);
  __pyx_r = ((struct LxmlElement *)Py_None);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":988 */
__pyx_2 = ENABLE_THREADING;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":989 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":990 */
  PyThread_acquire_lock(__pyx_v_5etree_ELEMENT_CREATION_LOCK,WAIT_LOCK);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":991 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":992 */
  __pyx_1 = ((PyObject *)__pyx_f_5etree_getProxy(__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 992; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result));
  __pyx_v_result = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":993 */
  __pyx_2 = __pyx_v_result != Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":994 */
    PyThread_release_lock(__pyx_v_5etree_ELEMENT_CREATION_LOCK);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":995 */
    Py_INCREF(((PyObject *)__pyx_v_result));
    __pyx_r = __pyx_v_result;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":997 */
__pyx_1 = __pyx_v_5etree_LOOKUP_ELEMENT_CLASS(__pyx_v_5etree_ELEMENT_CLASS_LOOKUP_STATE,__pyx_v_doc,__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 997; goto __pyx_L1;}
Py_DECREF(__pyx_v_element_class);
__pyx_v_element_class = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":999 */
__pyx_1 = PyObject_CallObject(__pyx_v_element_class, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 999; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1000 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)__pyx_v_result->_doc));
__pyx_v_result->_doc = __pyx_v_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1001 */
__pyx_v_result->_c_node = __pyx_v_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1002 */
__pyx_1 = __pyx_f_5etree_registerProxy(__pyx_v_result); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1002; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1004 */
__pyx_2 = ENABLE_THREADING;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1005 */
  PyThread_release_lock(__pyx_v_5etree_ELEMENT_CREATION_LOCK);
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1007 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_result), __pyx_n__init); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;}
__pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1008 */
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_3);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k224p;

static char (__pyx_k224[]) = "this element does not have children or attributes";

static int __pyx_f_5etree_20__ContentOnlyElement__raiseImmutable(struct __pyx_obj_5etree___ContentOnlyElement *__pyx_v_self) {
int __pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1013 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}
__Pyx_Raise(__pyx_1, __pyx_k224p, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 1013; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("etree.__ContentOnlyElement._raiseImmutable");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_20__ContentOnlyElement_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1016 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree___ContentOnlyElement *)((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1016; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.__ContentOnlyElement.set");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_20__ContentOnlyElement_append(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_value = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"value",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_value)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1019 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree___ContentOnlyElement *)((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1019; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.__ContentOnlyElement.append");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_20__ContentOnlyElement_insert(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_index, &__pyx_v_value)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_index);
Py_INCREF(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1022 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree___ContentOnlyElement *)((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.__ContentOnlyElement.insert");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_index);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static int __pyx_f_5etree_20__ContentOnlyElement___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1025 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree___ContentOnlyElement *)((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1025; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("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;
}

static int __pyx_f_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_f_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 (!__pyx_v_start) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;}
__pyx_v_end = PyInt_FromSsize_t(__pyx_arg_end); if (!__pyx_v_end) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1027; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1028 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree___ContentOnlyElement *)((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_vtab)->_raiseImmutable(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1028; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1032 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1032; 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("etree.__ContentOnlyElement.attrib.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k225p;

static char (__pyx_k225[]) = "";

static PyObject *__pyx_f_5etree_20__ContentOnlyElement_4text___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1036 */
__pyx_1 = (((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1037 */
  Py_INCREF(__pyx_k225p);
  __pyx_r = __pyx_k225p;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1039 */
  __pyx_2 = __pyx_f_5etree_funicode(((struct __pyx_obj_5etree___ContentOnlyElement *)__pyx_v_self)->__pyx_base._c_node->content); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1039; 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("etree.__ContentOnlyElement.text.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_20__ContentOnlyElement_4text___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1044 */
__pyx_1 = __pyx_v_value == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1045 */
  __pyx_v_c_text = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1047 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1047; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1048 */
  __pyx_v_c_text = _cstr(__pyx_v_value);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1049 */
xmlNodeSetContent(((struct __pyx_obj_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("etree.__ContentOnlyElement.text.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n); /*proto*/
static PyObject *__pyx_f_5etree_20__ContentOnlyElement___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_n);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1053 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_IndexError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;}
__Pyx_Raise(__pyx_1, 0, 0);
Py_DECREF(__pyx_1); __pyx_1 = 0;
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("etree.__ContentOnlyElement.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_n);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1056 */
__pyx_r = 0;
goto __pyx_L0;

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

static PyObject *__pyx_f_5etree_20__ContentOnlyElement_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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_k42;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1059 */
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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1062 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1062; 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("etree.__ContentOnlyElement.keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1065 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; 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("etree.__ContentOnlyElement.items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1070 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_Comment); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; 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("etree._Comment.tag.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_text;

static PyObject *__pyx_k226p;

static char (__pyx_k226[]) = "<!--%s-->";

static PyObject *__pyx_f_5etree_8_Comment___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1073 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k226p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; 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("etree._Comment.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1078 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ProcessingInstruction); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1078; 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("etree._ProcessingInstruction.tag.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1083 */
__pyx_1 = __pyx_f_5etree_funicode(((struct __pyx_obj_5etree__ProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base._c_node->name); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1083; 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("etree._ProcessingInstruction.target.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_22_ProcessingInstruction_6target___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1086 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1087 */
__pyx_1 = PyString_FromString(_cstr(__pyx_v_value)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; goto __pyx_L1;}
Py_DECREF(__pyx_v_c_text);
__pyx_v_c_text = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1088 */
__pyx_2 = PyString_AsString(__pyx_v_c_text); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1088; goto __pyx_L1;}
xmlNodeSetName(((struct __pyx_obj_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("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;
}

static PyObject *__pyx_n_target;

static PyObject *__pyx_k227p;
static PyObject *__pyx_k228p;

static char (__pyx_k227[]) = "<?%s %s?>";
static char (__pyx_k228[]) = "<?%s?>";

static PyObject *__pyx_f_5etree_22_ProcessingInstruction___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1091 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1091; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1092 */
__pyx_2 = PyObject_IsTrue(__pyx_v_text); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1092; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1093 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_target); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; 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_k227p, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1093; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1095 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_target); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; goto __pyx_L1;}
  __pyx_1 = PyNumber_Remainder(__pyx_k228p, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; 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("etree._ProcessingInstruction.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k229p;

static char (__pyx_k229[]) = "ElementTree not initialized, missing root";

static PyObject *__pyx_f_5etree_12_ElementTree__assertHasRoot(struct LxmlElementTree *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1113 */
#ifndef PYREX_WITHOUT_ASSERTIONS
__pyx_1 = __pyx_v_self->_context_node != Py_None;
if (!__pyx_1) {
  PyErr_SetObject(PyExc_AssertionError, __pyx_k229p);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; goto __pyx_L1;}
}
#endif

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._ElementTree._assertHasRoot");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_parse[] = "Updates self with the content of source and returns its root\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_parse(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
struct __pyx_obj_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_k43;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser)) return 0;
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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1120 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__parseDocument(__pyx_v_source,__pyx_v_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1121 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1121; goto __pyx_L1;}
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1122 */
__pyx_2 = ((struct LxmlElementTree *)__pyx_v_self)->_context_node == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1123 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1125 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1125; goto __pyx_L1;}
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1126 */
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("etree._ElementTree.parse");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_getroot[] = "Gets the root element for this tree.\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_getroot(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1131 */
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;
}

static PyObject *__pyx_f_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_12_ElementTree___copy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1134 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1134; 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("etree._ElementTree.__copy__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_12_ElementTree___deepcopy__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_memo = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"memo",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_memo)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_memo);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1137 */
__pyx_1 = ((struct LxmlElementTree *)__pyx_v_self)->_context_node == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1138 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1138; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1140 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  __pyx_3 = PyObject_GetAttr(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node), __pyx_n___copy__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; 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("etree._ElementTree.__deepcopy__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_memo);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_7docinfo___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1148 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1148; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1149 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; 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_5etree_DocInfo), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1149; 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("etree._ElementTree.docinfo.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_12_ElementTree_6parser___get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1155 */
__pyx_1 = ((struct LxmlElementTree *)__pyx_v_self)->_context_node != Py_None;
if (__pyx_1) {
  __pyx_1 = ((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc != Py_None;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1157 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1158 */
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;
}

static PyObject *__pyx_n_bool;
static PyObject *__pyx_n_ASCII;
static PyObject *__pyx_n_upper;
static PyObject *__pyx_n_UTF8;

static PyObject *__pyx_k232p;
static PyObject *__pyx_k235p;

static char (__pyx_k232[]) = "US-ASCII";
static char (__pyx_k235[]) = "UTF-8";

static PyObject *__pyx_f_5etree_12_ElementTree_write(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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        ";
static PyObject *__pyx_f_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_pretty_print = 0;
PyObject *__pyx_v_xml_declaration = 0;
int __pyx_v_c_write_declaration;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"file","encoding","pretty_print","xml_declaration",0};
__pyx_v_encoding = __pyx_k44;
__pyx_v_pretty_print = __pyx_k45;
__pyx_v_xml_declaration = __pyx_k46;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_file, &__pyx_v_encoding, &__pyx_v_pretty_print, &__pyx_v_xml_declaration)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_file);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_pretty_print);
Py_INCREF(__pyx_v_xml_declaration);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1167 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1167; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1169 */
__pyx_2 = __pyx_v_xml_declaration != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1170 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; goto __pyx_L1;}
  Py_INCREF(__pyx_v_xml_declaration);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_xml_declaration);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1170; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_v_c_write_declaration = __pyx_2;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1171 */
  __pyx_2 = __pyx_v_encoding == Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1172 */
    Py_INCREF(__pyx_n_ASCII);
    Py_DECREF(__pyx_v_encoding);
    __pyx_v_encoding = __pyx_n_ASCII;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_2 = __pyx_v_encoding == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1174 */
  Py_INCREF(__pyx_n_ASCII);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_n_ASCII;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1175 */
  __pyx_v_c_write_declaration = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1177 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_upper); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1178 */
  __pyx_4 = PyTuple_New(4); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1179; goto __pyx_L1;}
  Py_INCREF(__pyx_k232p);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k232p);
  Py_INCREF(__pyx_n_ASCII);
  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_n_ASCII);
  Py_INCREF(__pyx_n_UTF8);
  PyTuple_SET_ITEM(__pyx_4, 2, __pyx_n_UTF8);
  Py_INCREF(__pyx_k235p);
  PyTuple_SET_ITEM(__pyx_4, 3, __pyx_k235p);
  __pyx_2 = PySequence_Contains(__pyx_4, __pyx_v_encoding); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; goto __pyx_L1;}
  __pyx_2 = !__pyx_2;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_v_c_write_declaration = __pyx_2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1180 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
Py_INCREF(__pyx_v_pretty_print);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_pretty_print);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1181; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_1 = __pyx_f_5etree__tofilelike(__pyx_v_file,((struct LxmlElementTree *)__pyx_v_self)->_context_node,__pyx_v_encoding,__pyx_v_c_write_declaration,__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; 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);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._ElementTree.write");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_file);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_pretty_print);
Py_DECREF(__pyx_v_xml_declaration);
return __pyx_r;
}

static PyObject *__pyx_k236p;
static PyObject *__pyx_k237p;

static char (__pyx_k236[]) = "Element is not in this tree.";
static char (__pyx_k237[]) = "Error creating node path.";

static PyObject *__pyx_f_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_getpath[] = "Returns a structural, absolute XPath expression to find that element.\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_getpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_element = 0;
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;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element)) return 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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1183; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1189 */
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1190 */
__pyx_1 = __pyx_v_element->_doc != __pyx_v_doc;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1191 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k236p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1191; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1192 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1193 */
__pyx_v_c_path = xmlGetNodePath(__pyx_v_element->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1194 */
__pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1195 */
__pyx_1 = (__pyx_v_c_path == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1196 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k237p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1196; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1197 */
__pyx_2 = PyString_FromString(__pyx_v_c_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1198 */
xmlFree(__pyx_v_c_path);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1199 */
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_2);
__Pyx_AddTraceback("etree._ElementTree.getpath");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_getroot;
static PyObject *__pyx_n_getiterator;

static PyObject *__pyx_f_5etree_12_ElementTree_getiterator(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_getiterator[] = "Creates an iterator for the root element. The iterator loops over all elements\n        in this tree, in document order.\n        ";
static PyObject *__pyx_f_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_k47;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_tag)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_tag);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1205 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1205; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1206 */
__pyx_3 = __pyx_v_root == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1207 */
  __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1207; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1208 */
__pyx_2 = PyObject_GetAttr(__pyx_v_root, __pyx_n_getiterator); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; 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 (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1208; 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("etree._ElementTree.getiterator");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_k238p;
static PyObject *__pyx_k239p;

static char (__pyx_k238[]) = "/";
static char (__pyx_k239[]) = ".";

static PyObject *__pyx_f_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_find[] = "Finds the first toplevel element with given tag. Same as getroot().find(path).\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_find(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 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",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_path)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1213 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1213; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1214 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1214; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1215 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_k238p, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1215; goto __pyx_L1;}
__pyx_3 = __pyx_3 == 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1216 */
  __pyx_2 = PyNumber_Add(__pyx_k239p, __pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1216; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1217 */
__pyx_1 = PyObject_GetAttr(__pyx_v_root, __pyx_n_find); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1217; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 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("etree._ElementTree.find");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

static PyObject *__pyx_k240p;
static PyObject *__pyx_k241p;

static char (__pyx_k240[]) = "/";
static char (__pyx_k241[]) = ".";

static PyObject *__pyx_f_5etree_12_ElementTree_findtext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_findtext[] = "Finds the element text for the first toplevel element with given tag. Same as getroot().findtext(path)\n        ";
static PyObject *__pyx_f_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_k48;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_path, &__pyx_v_default)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1222 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1222; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1223 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1224 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_k240p, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1224; goto __pyx_L1;}
__pyx_3 = __pyx_3 == 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1225 */
  __pyx_2 = PyNumber_Add(__pyx_k241p, __pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1225; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1226 */
__pyx_1 = PyObject_GetAttr(__pyx_v_root, __pyx_n_findtext); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_path);
Py_INCREF(__pyx_v_default);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_default);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1226; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 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("etree._ElementTree.findtext");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_k242p;
static PyObject *__pyx_k243p;

static char (__pyx_k242[]) = "/";
static char (__pyx_k243[]) = ".";

static PyObject *__pyx_f_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_findall[] = "Finds all toplevel elements with the given tag. Same as getroot().findall(path).\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_findall(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_path = 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",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_path)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_path);
__pyx_v_root = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1231 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1232 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_getroot); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1232; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1233 */
__pyx_1 = PySequence_GetSlice(__pyx_v_path, 0, 1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_k242p, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1233; goto __pyx_L1;}
__pyx_3 = __pyx_3 == 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1234 */
  __pyx_2 = PyNumber_Add(__pyx_k243p, __pyx_v_path); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1234; goto __pyx_L1;}
  Py_DECREF(__pyx_v_path);
  __pyx_v_path = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1235 */
__pyx_1 = PyObject_GetAttr(__pyx_v_root, __pyx_n_findall); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_path);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1235; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 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("etree._ElementTree.findall");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_path);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_xpath(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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_k49;
__pyx_v_extensions = __pyx_k50;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__variables) < 0) return 0;
if (!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 0;
}
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1254 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1254; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1255 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_extensions);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XPathDocumentEvaluator), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1255; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_evaluator);
__pyx_v_evaluator = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1256 */
__pyx_1 = PyObject_GetAttr(__pyx_v_evaluator, __pyx_n_evaluate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; goto __pyx_L1;}
Py_INCREF(__pyx_v__path);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__path);
__pyx_3 = PyEval_CallObjectWithKeywords(__pyx_1, __pyx_2, __pyx_v__variables); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; 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("etree._ElementTree.xpath");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_extensions;
static PyObject *__pyx_n_access_control;


static PyObject *__pyx_f_5etree_12_ElementTree_xslt(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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_k51;
__pyx_v_access_control = __pyx_k52;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__kw) < 0) return 0;
if (!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 0;
}
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1270 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1270; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1271 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
Py_INCREF(__pyx_v__xslt);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__xslt);
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_n_extensions, __pyx_v_extensions) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_n_access_control, __pyx_v_access_control) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; goto __pyx_L1;}
__pyx_3 = PyEval_CallObjectWithKeywords(((PyObject*)__pyx_ptype_5etree_XSLT), __pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1273 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_v_style, __pyx_1, __pyx_v__kw); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; 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("etree._ElementTree.xslt");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_validate;

static PyObject *__pyx_f_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_relaxng[] = "Validate this document using other document.\n\n        relaxng is a tree that should contain Relax NG XML\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_f_5etree_12_ElementTree_relaxng(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_relaxng = 0;
PyObject *__pyx_v_schema;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"relaxng",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_relaxng)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_relaxng);
__pyx_v_schema = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1287 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1287; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1288 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;}
Py_INCREF(__pyx_v_relaxng);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_relaxng);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_RelaxNG), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1288; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_schema);
__pyx_v_schema = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1289 */
__pyx_1 = PyObject_GetAttr(__pyx_v_schema, __pyx_n_validate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; 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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1289; 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("etree._ElementTree.relaxng");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_schema);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_relaxng);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_xmlschema[] = "Validate this document using other document.\n\n        xmlschema is a tree that should contain XML Schema XML.\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_f_5etree_12_ElementTree_xmlschema(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_xmlschema = 0;
PyObject *__pyx_v_schema;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"xmlschema",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_xmlschema)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_xmlschema);
__pyx_v_schema = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1303 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1303; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1304 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_INCREF(__pyx_v_xmlschema);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_xmlschema);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XMLSchema), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1304; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_schema);
__pyx_v_schema = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1305 */
__pyx_1 = PyObject_GetAttr(__pyx_v_schema, __pyx_n_validate); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; 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 (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1305; 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("etree._ElementTree.xmlschema");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_schema);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_xmlschema);
return __pyx_r;
}

static PyObject *__pyx_k246p;

static char (__pyx_k246[]) = "XInclude processing failed";

static PyObject *__pyx_f_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_xinclude[] = "Process the XInclude nodes in this document and include the\n        referenced XML fragments.\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_xinclude(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
int __pyx_v_result;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1319 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1320 */
if (PyObject_Cmp(((PyObject *)((struct LxmlElementTree *)__pyx_v_self)->_context_node->_doc->_parser), Py_None, &__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1320; goto __pyx_L1;}
__pyx_2 = __pyx_2 != 0;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1321 */
  __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_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1325 */
  __pyx_v_result = xmlXIncludeProcessTree(((struct LxmlElementTree *)__pyx_v_self)->_context_node->_c_node);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1327 */
__pyx_2 = (__pyx_v_result == (-1));
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1328 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XIncludeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k246p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("etree._ElementTree.xinclude");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_12_ElementTree_write_c14n[] = "C14N write of document. Always writes UTF-8.\n        ";
static PyObject *__pyx_f_5etree_12_ElementTree_write_c14n(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_file = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"file",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_file)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_file);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1333 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTree *)((struct LxmlElementTree *)__pyx_v_self)->__pyx_vtab)->_assertHasRoot(((struct LxmlElementTree *)__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1334 */
__pyx_1 = __pyx_f_5etree__tofilelikeC14N(__pyx_v_file,((struct LxmlElementTree *)__pyx_v_self)->_context_node); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; 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("etree._ElementTree.write_c14n");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_file);
return __pyx_r;
}

static struct LxmlElementTree *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1337 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__newElementTree(__pyx_v_doc,__pyx_v_context_node,((PyObject*)__pyx_ptype_5etree__ElementTree))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; 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("etree._elementTreeFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_context_node);
return __pyx_r;
}

static struct LxmlElementTree *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1342 */
__pyx_1 = PyObject_CallObject(__pyx_v_baseclass, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__ElementTree)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1342; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct LxmlElementTree *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1343 */
__pyx_2 = __pyx_v_context_node == Py_None;
if (__pyx_2) {
  __pyx_2 = __pyx_v_doc != Py_None;
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1344 */
  __pyx_1 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1344; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1345 */
__pyx_2 = __pyx_v_context_node == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1346 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1347 */
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1348 */
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("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;
}

static int __pyx_f_5etree_7_Attrib___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1353; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1354 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element));
((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element = __pyx_v_element;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Attrib.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static int __pyx_f_5etree_7_Attrib___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1358 */
__pyx_1 = __pyx_f_5etree__setAttributeValue(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1358; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("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;
}

static int __pyx_f_5etree_7_Attrib___delitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1361 */
__pyx_1 = __pyx_f_5etree__delAttribute(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1361; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Attrib.__delitem__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

static PyObject *__pyx_n_dict;

static PyObject *__pyx_f_5etree_7_Attrib___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_7_Attrib___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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1365 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;}
__pyx_2 = __pyx_f_5etree__attributeIteratorFactory(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = repr(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1365; 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("etree._Attrib.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_KeyError;

static PyObject *__pyx_f_5etree_7_Attrib___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1368 */
__pyx_1 = __pyx_f_5etree__getAttributeValue(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,Py_None); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1368; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1369 */
__pyx_2 = __pyx_v_result == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1370 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_v_key, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1370; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1372 */
  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("etree._Attrib.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

static int __pyx_f_5etree_7_Attrib___nonzero__(PyObject *__pyx_v_self); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1376 */
__pyx_v_c_attr = ((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1377 */
while (1) {
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1378 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1379 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1380 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1381 */
__pyx_r = 0;
goto __pyx_L0;

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

static Py_ssize_t __pyx_f_5etree_7_Attrib___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1386 */
__pyx_v_c = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1387 */
__pyx_v_c_attr = ((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element->_c_node->properties;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1388 */
while (1) {
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1389 */
  __pyx_1 = (__pyx_v_c_attr->type == XML_ATTRIBUTE_NODE);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1390 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1391 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1392 */
__pyx_r = __pyx_v_c;
goto __pyx_L0;

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

static PyObject *__pyx_f_5etree_7_Attrib_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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_k53;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);
Py_INCREF(__pyx_v_default);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1395 */
__pyx_1 = __pyx_f_5etree__getAttributeValue(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,__pyx_v_key,__pyx_v_default); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1395; 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("etree._Attrib.get");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
Py_DECREF(__pyx_v_default);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1398 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1399; goto __pyx_L1;}
__pyx_2 = PySequence_List(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1398; 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("etree._Attrib.keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_keys;

static PyObject *__pyx_f_5etree_7_Attrib___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1402 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_keys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = iter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1402; 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("etree._Attrib.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1405 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_keys); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = iter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1405; 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("etree._Attrib.iterkeys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1408 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1409; goto __pyx_L1;}
__pyx_2 = PySequence_List(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1408; 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("etree._Attrib.values");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_values;

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1412 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_values); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = iter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1412; 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("etree._Attrib.itervalues");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1415 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element,3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1416; goto __pyx_L1;}
__pyx_2 = PySequence_List(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1415; 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("etree._Attrib.items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1419 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = iter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1419; 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("etree._Attrib.iteritems");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_Attrib_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_key = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"key",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_key)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_key);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1422 */
__pyx_1 = PySequence_Contains(__pyx_v_self, __pyx_v_key); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1422; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1423 */
  Py_INCREF(__pyx_v_5etree_True);
  __pyx_r = __pyx_v_5etree_True;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1425 */
  Py_INCREF(__pyx_v_5etree_False);
  __pyx_r = __pyx_v_5etree_False;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._Attrib.has_key");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

static int __pyx_f_5etree_7_Attrib___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static int __pyx_f_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;
int __pyx_3;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1431 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1431; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1432 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1433 */
__pyx_v_c_node = ((struct __pyx_obj_5etree__Attrib *)__pyx_v_self)->_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1434 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1435 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_c_node,__pyx_v_c_tag);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1437 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_node,__pyx_v_c_tag,_cstr(__pyx_v_ns));
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1438 */
__pyx_3 = (__pyx_v_c_result == NULL);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1439 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1441 */
  xmlFree(__pyx_v_c_result);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1442 */
  __pyx_r = 1;
  goto __pyx_L0;
}
__pyx_L3:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1452 */
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;
}

static PyObject *__pyx_f_5etree_15_AttribIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1456 */
__pyx_1 = ((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_node == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1457 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1457; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1458 */
__pyx_v_c_attr = ((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_c_attr;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1459 */
while (1) {
  __pyx_1 = (__pyx_v_c_attr != NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_c_attr->type != XML_ATTRIBUTE_NODE);
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1460 */
  __pyx_v_c_attr = __pyx_v_c_attr->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1461 */
__pyx_1 = (__pyx_v_c_attr == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1462 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1462; goto __pyx_L1;}
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_node));
  ((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_node = ((struct LxmlElement *)Py_None);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1463 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1463; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1465 */
((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_c_attr = __pyx_v_c_attr->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1466 */
__pyx_1 = (((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_keysvalues == 1);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1467 */
  __pyx_2 = __pyx_f_5etree__namespacedName(((xmlNode (*))__pyx_v_c_attr)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1467; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_1 = (((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_keysvalues == 2);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1469 */
  __pyx_2 = __pyx_f_5etree__attributeValue(((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_node->_c_node,__pyx_v_c_attr); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1469; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1471 */
  __pyx_2 = __pyx_f_5etree__namespacedName(((xmlNode (*))__pyx_v_c_attr)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; goto __pyx_L1;}
  __pyx_3 = __pyx_f_5etree__attributeValue(((struct __pyx_obj_5etree__AttribIterator *)__pyx_v_self)->_node->_c_node,__pyx_v_c_attr); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1472; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1471; 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("etree._AttribIterator.__next__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__attributeIteratorFactory(struct LxmlElement *__pyx_v_element,int __pyx_v_keysvalues) {
struct __pyx_obj_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_5etree__AttribIterator *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1476 */
__pyx_1 = (__pyx_v_element->_c_node->properties == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1477 */
  Py_INCREF(__pyx_v_5etree_ITER_EMPTY);
  __pyx_r = __pyx_v_5etree_ITER_EMPTY;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1478 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__AttribIterator), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__AttribIterator)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1478; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_attribs));
__pyx_v_attribs = ((struct __pyx_obj_5etree__AttribIterator *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1479 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)__pyx_v_attribs->_node));
__pyx_v_attribs->_node = __pyx_v_element;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1480 */
__pyx_v_attribs->_c_attr = __pyx_v_element->_c_node->properties;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1481 */
__pyx_v_attribs->_keysvalues = __pyx_v_keysvalues;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1482 */
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("etree._attributeIteratorFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_attribs);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1493 */
__pyx_1 = __pyx_v_tag == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1494 */
  __pyx_v_self->_href = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1495 */
  __pyx_v_self->_name = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1497 */
  __pyx_2 = __pyx_f_5etree__getNsTag(__pyx_v_tag); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1497; goto __pyx_L1;}
  Py_DECREF(__pyx_v_self->_pystrings);
  __pyx_v_self->_pystrings = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1498 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1498; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = __pyx_3 == Py_None;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1499 */
    __pyx_v_self->_href = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1501 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;}
    __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1501; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_v_self->_href = _cstr(__pyx_3);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1502 */
  __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
  __pyx_3 = PyObject_GetItem(__pyx_v_self->_pystrings, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1502; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_self->_name = _cstr(__pyx_3);
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1503 */
  __pyx_1 = ((__pyx_v_self->_name[0]) == '*');
  if (__pyx_1) {
    __pyx_1 = ((__pyx_v_self->_name[1]) == '\0');
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1504 */
    __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("etree._ElementTagMatcher._initTagMatch");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1512 */
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;
}

static void __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1516 */
__pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1517 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {
    __pyx_1 = (!__pyx_f_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->__pyx_base._href,__pyx_v_self->__pyx_base._name));
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1519 */
  __pyx_v_c_node = __pyx_v_self->_next_element(__pyx_v_c_node);
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1520 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1521 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1521; goto __pyx_L1;}
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)__pyx_v_self->_node));
  __pyx_v_self->_node = ((struct LxmlElement *)Py_None);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1524 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_node->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1524; goto __pyx_L1;}
  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("etree._ElementIterator._storeNext");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
}

static PyObject *__pyx_f_5etree_16_ElementIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1530 */
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1531 */
__pyx_1 = __pyx_v_current_node == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1532 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1532; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1533 */
((struct __pyx_vtabstruct_5etree__ElementIterator *)((struct LxmlElementIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_storeNext(((struct LxmlElementIterator *)__pyx_v_self),__pyx_v_current_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1534 */
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("etree._ElementIterator.__next__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_current_node);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_20ElementChildIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_reversed = 0;
PyObject *__pyx_v_tag = 0;
xmlNode (*__pyx_v_c_node);
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"node","reversed","tag",0};
__pyx_v_reversed = __pyx_k54;
__pyx_v_tag = __pyx_k55;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_reversed, &__pyx_v_tag)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_reversed);
Py_INCREF(__pyx_v_tag);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_5etree__Element, 0, "node")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1538; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1540 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_ElementChildIterator *)((struct __pyx_obj_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 (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1540; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1541 */
__pyx_2 = PyObject_IsTrue(__pyx_v_reversed); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1541; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1542 */
  __pyx_v_c_node = __pyx_f_5etree__findChildBackwards(__pyx_v_node->_c_node,0);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1543 */
  ((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_5etree__previousElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1545 */
  __pyx_v_c_node = __pyx_f_5etree__findChildForwards(__pyx_v_node->_c_node,0);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1546 */
  ((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_5etree__nextElement;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1547 */
__pyx_2 = __pyx_v_tag != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1548 */
  while (1) {
    __pyx_2 = (__pyx_v_c_node != NULL);
    if (__pyx_2) {
      __pyx_2 = (!__pyx_f_5etree__tagMatches(__pyx_v_c_node,((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._href,((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base.__pyx_base._name));
    }
    if (!__pyx_2) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1550 */
    __pyx_v_c_node = ((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._next_element(__pyx_v_c_node);
  }
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1551 */
__pyx_2 = (__pyx_v_c_node != NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1553 */
  __pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_node->_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1553; goto __pyx_L1;}
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_ElementChildIterator *)__pyx_v_self)->__pyx_base._node));
  ((struct __pyx_obj_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("etree.ElementChildIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_reversed);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static int __pyx_f_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_16SiblingsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElement *__pyx_v_node = 0;
PyObject *__pyx_v_preceding = 0;
PyObject *__pyx_v_tag = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
static char *__pyx_argnames[] = {"node","preceding","tag",0};
__pyx_v_preceding = __pyx_k56;
__pyx_v_tag = __pyx_k57;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_preceding, &__pyx_v_tag)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_preceding);
Py_INCREF(__pyx_v_tag);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_5etree__Element, 0, "node")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1560; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1561 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_SiblingsIterator *)((struct __pyx_obj_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 (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1561; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1562 */
__pyx_2 = PyObject_IsTrue(__pyx_v_preceding); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1562; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1563 */
  ((struct __pyx_obj_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_5etree__previousElement;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1565 */
  ((struct __pyx_obj_5etree_SiblingsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_5etree__nextElement;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1566 */
((struct __pyx_vtabstruct_5etree_SiblingsIterator *)((struct __pyx_obj_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("etree.SiblingsIterator.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_preceding);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static int __pyx_f_5etree_17AncestorsIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k58;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_5etree__Element, 0, "node")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1570; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1571 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_AncestorsIterator *)((struct __pyx_obj_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 (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1571; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1572 */
((struct __pyx_obj_5etree_AncestorsIterator *)__pyx_v_self)->__pyx_base._next_element = __pyx_f_5etree__parentElement;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1573 */
((struct __pyx_vtabstruct_5etree_AncestorsIterator *)((struct __pyx_obj_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("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;
}

static PyObject *__pyx_n_next;

static int __pyx_f_5etree_25ElementDepthFirstIterator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k59;
__pyx_v_inclusive = __pyx_k60;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_node, &__pyx_v_tag, &__pyx_v_inclusive)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_tag);
Py_INCREF(__pyx_v_inclusive);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_node), __pyx_ptype_5etree__Element, 0, "node")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1592; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1593 */
Py_INCREF(((PyObject *)__pyx_v_node));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node));
((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_top_node = __pyx_v_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1594 */
Py_INCREF(((PyObject *)__pyx_v_node));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = __pyx_v_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1595 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._initTagMatch(((struct LxmlElementTagMatcher *)__pyx_v_self),__pyx_v_tag); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1595; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1596 */
__pyx_2 = __pyx_v_tag != Py_None;
if (__pyx_2) {
  __pyx_2 = (!__pyx_f_5etree__tagMatches(__pyx_v_node->_c_node,((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._href,((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name));
}
if (!__pyx_2) {
  __pyx_3 = PyObject_IsTrue(__pyx_v_inclusive); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1598; goto __pyx_L1;}
  __pyx_2 = (!__pyx_3);
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1600 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_next); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; goto __pyx_L1;}
  __pyx_4 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1600; 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("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);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1603 */
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;
}

static PyObject *__pyx_f_5etree_25ElementDepthFirstIterator___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1608 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
Py_DECREF(((PyObject *)__pyx_v_current_node));
__pyx_v_current_node = ((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1609 */
__pyx_1 = __pyx_v_current_node == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1610 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1610; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1611 */
__pyx_v_c_node = ((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1612 */
__pyx_1 = (((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._name == NULL);
if (__pyx_1) {
  __pyx_1 = (((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base._href == NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1613 */
  __pyx_v_c_node = ((struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_nextNodeAnyTag(((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self),__pyx_v_c_node);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1615 */
  __pyx_v_c_node = ((struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_nextNodeMatchTag(((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self),__pyx_v_c_node);
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1616 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_current_node->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1616; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node));
((struct __pyx_obj_5etree_ElementDepthFirstIterator *)__pyx_v_self)->_next_node = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1617 */
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("etree.ElementDepthFirstIterator.__next__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_current_node);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree_25ElementDepthFirstIterator__nextNodeAnyTag(struct __pyx_obj_5etree_ElementDepthFirstIterator *__pyx_v_self,xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1620 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node,__pyx_v_c_node,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1621 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1622 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1623 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree_25ElementDepthFirstIterator__nextNodeMatchTag(struct __pyx_obj_5etree_ElementDepthFirstIterator *__pyx_v_self,xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1626 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_self->_top_node->_c_node,__pyx_v_c_node,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1627 */
__pyx_1 = __pyx_f_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->__pyx_base._href,__pyx_v_self->__pyx_base._name);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1628 */
  __pyx_r = __pyx_v_c_node;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1629 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1630 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static xmlNode (*__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1634 */
__pyx_v_c_node = xmlNewDocNode(__pyx_v_c_doc,NULL,_cstr(__pyx_v_name_utf),NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1635 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_L0:;
Py_DECREF(__pyx_v_name_utf);
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__createComment(xmlDoc (*__pyx_v_c_doc),char (*__pyx_v_text))) {
xmlNode (*__pyx_v_c_node);
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1639 */
__pyx_v_c_node = xmlNewDocComment(__pyx_v_c_doc,__pyx_v_text);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1640 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__createPI(xmlDoc (*__pyx_v_c_doc),char (*__pyx_v_target),char (*__pyx_v_text))) {
xmlNode (*__pyx_v_c_node);
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1644 */
__pyx_v_c_node = xmlNewDocPI(__pyx_v_c_doc,__pyx_v_target,__pyx_v_text);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1645 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_f_5etree_Element(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_Element[] = "Element factory.  This function returns an object implementing the\n    Element interface.\n    ";
static PyObject *__pyx_f_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_k61;
__pyx_v_nsmap = __pyx_k62;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1654 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;}
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__makeElement(__pyx_v__tag,NULL,((struct LxmlDocument *)Py_None),((struct __pyx_obj_5etree__BaseParser *)Py_None),Py_None,Py_None,__pyx_v_attrib,__pyx_v_nsmap,__pyx_v__extra)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1654; 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("etree.Element");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_k247p;

static char (__pyx_k247[]) = "";

static PyObject *__pyx_f_5etree_Comment(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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;
static char *__pyx_argnames[] = {"text",0};
__pyx_v_text = __pyx_k63;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_text)) return 0;
Py_INCREF(__pyx_v_text);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1664 */
__pyx_1 = __pyx_v_text == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1665 */
  Py_INCREF(__pyx_k247p);
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_k247p;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1667 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_text); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1667; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1668 */
__pyx_v_c_doc = __pyx_f_5etree__newDoc();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1669 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
__pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,((struct __pyx_obj_5etree__BaseParser *)Py_None))); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1669; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1670 */
__pyx_v_c_node = __pyx_f_5etree__createComment(__pyx_v_c_doc,_cstr(__pyx_v_text));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1671 */
xmlAddChild(((xmlNode (*))__pyx_v_c_doc),__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1672 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1672; 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("etree.Comment");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

static PyObject *__pyx_k248p;

static char (__pyx_k248[]) = "";

static PyObject *__pyx_f_5etree_ProcessingInstruction(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_ProcessingInstruction[] = "Comment element factory. This factory function creates a special element that will\n    be serialized as an XML comment.\n    ";
static PyObject *__pyx_f_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;
static char *__pyx_argnames[] = {"target","text",0};
__pyx_v_text = __pyx_k64;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_target, &__pyx_v_text)) return 0;
Py_INCREF(__pyx_v_target);
Py_INCREF(__pyx_v_text);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1681 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_target); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1681; goto __pyx_L1;}
Py_DECREF(__pyx_v_target);
__pyx_v_target = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1682 */
__pyx_2 = __pyx_v_text == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1683 */
  Py_INCREF(__pyx_k248p);
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_k248p;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1685 */
  __pyx_1 = __pyx_f_5etree__utf8(__pyx_v_text); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1685; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text);
  __pyx_v_text = __pyx_1;
  __pyx_1 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1686 */
__pyx_v_c_doc = __pyx_f_5etree__newDoc();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1687 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,((struct __pyx_obj_5etree__BaseParser *)Py_None))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1687; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1688 */
__pyx_v_c_node = __pyx_f_5etree__createPI(__pyx_v_c_doc,_cstr(__pyx_v_target),_cstr(__pyx_v_text));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1689 */
xmlAddChild(((xmlNode (*))__pyx_v_c_doc),__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1690 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1690; 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("etree.ProcessingInstruction");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_target);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_SubElement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_SubElement[] = "Subelement factory. This function creates an element instance, and appends it to an\n    existing element.\n    ";
static PyObject *__pyx_f_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;
xmlNode (*__pyx_v_c_node);
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
xmlNode (*__pyx_3);
static char *__pyx_argnames[] = {"_parent","_tag","attrib","nsmap",0};
__pyx_v_attrib = __pyx_k65;
__pyx_v_nsmap = __pyx_k66;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 4, 0, &__pyx_v__extra) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v__parent);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);
__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);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v__parent), __pyx_ptype_5etree__Element, 0, "_parent")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1692; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1699 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v__tag); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_utf);
__pyx_v_ns_utf = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_v_name_utf);
__pyx_v_name_utf = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1699; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1700 */
Py_INCREF(((PyObject *)__pyx_v__parent->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v__parent->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1701 */
__pyx_3 = __pyx_f_5etree__createElement(__pyx_v_doc->_c_doc,__pyx_v_name_utf); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1701; goto __pyx_L1;}
__pyx_v_c_node = __pyx_3;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1702 */
xmlAddChild(__pyx_v__parent->_c_node,__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1704 */
((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNamespaces(__pyx_v_doc,__pyx_v_c_node,__pyx_v_ns_utf,__pyx_v_nsmap);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1705 */
__pyx_1 = __pyx_f_5etree__initNodeAttributes(__pyx_v_c_node,__pyx_v_doc,__pyx_v_attrib,__pyx_v__extra); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1705; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1706 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1706; 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_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree.SubElement");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v__extra);
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_attrib);
Py_DECREF(__pyx_v_nsmap);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_ElementTree(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_ElementTree[] = "ElementTree wrapper class.\n    ";
static PyObject *__pyx_f_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_5etree__BaseParser *__pyx_v_parser = 0;
xmlDoc (*__pyx_v_c_doc);
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"element","file","parser",0};
__pyx_v_element = __pyx_k67;
__pyx_v_file = __pyx_k68;
__pyx_v_parser = __pyx_k69;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_element, &__pyx_v_file, &__pyx_v_parser)) return 0;
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);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 1, "element")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1718 */
__pyx_1 = __pyx_v_element != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1719 */
  Py_INCREF(((PyObject *)__pyx_v_element->_doc));
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = __pyx_v_element->_doc;
  goto __pyx_L2;
}
__pyx_1 = __pyx_v_file != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1721 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__parseDocument(__pyx_v_file,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1721; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1723 */
  __pyx_v_c_doc = __pyx_f_5etree__newDoc();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1724 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1724; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1726 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementTreeFactory(__pyx_v_doc,__pyx_v_element)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1726; 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("etree.ElementTree");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_file);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_HTML[] = "Parses an HTML document from a string constant. This function can be used\n    to embed \"HTML literals\" in Python code.\n    ";
static PyObject *__pyx_f_5etree_HTML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct __pyx_obj_5etree__BaseParser *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"text","parser",0};
__pyx_v_parser = __pyx_k70;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_text, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1733 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1734 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1734; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1735 */
  __pyx_1 = (!isinstance(((PyObject *)__pyx_v_parser),((PyObject*)__pyx_ptype_5etree_HTMLParser)));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1736 */
    Py_INCREF(((PyObject *)__pyx_v_5etree___DEFAULT_HTML_PARSER));
    Py_DECREF(((PyObject *)__pyx_v_parser));
    __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_5etree___DEFAULT_HTML_PARSER);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1737 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__parseMemoryDocument(__pyx_v_text,Py_None,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1737; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1738 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1738; 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("etree.HTML");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_XML[] = "Parses an XML document from a string constant. This function can be used\n    to embed \"XML literals\" in Python code.\n    ";
static PyObject *__pyx_f_5etree_XML(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct __pyx_obj_5etree__BaseParser *__pyx_v_parser = 0;
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"text","parser",0};
__pyx_v_parser = __pyx_k71;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_text, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_text);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1745 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1746 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1746; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1747 */
  __pyx_1 = (!isinstance(((PyObject *)__pyx_v_parser),((PyObject*)__pyx_ptype_5etree_XMLParser)));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1748 */
    Py_INCREF(((PyObject *)__pyx_v_5etree___DEFAULT_XML_PARSER));
    Py_DECREF(((PyObject *)__pyx_v_parser));
    __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_5etree___DEFAULT_XML_PARSER);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1749 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__parseMemoryDocument(__pyx_v_text,Py_None,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1749; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1750 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1750; 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("etree.XML");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_iselement[] = "Checks if an object appears to be a valid element object.\n    ";
static PyObject *__pyx_f_5etree_iselement(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"element",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_element)) return 0;
Py_INCREF(__pyx_v_element);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1757 */
__pyx_1 = PyInt_FromLong(isinstance(__pyx_v_element,((PyObject*)__pyx_ptype_5etree__Element))); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1757; 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("etree.iselement");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static PyObject *__pyx_n_stdout;

static PyObject *__pyx_f_5etree_dump(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
static char *__pyx_argnames[] = {"elem","pretty_print",0};
__pyx_v_pretty_print = __pyx_k72;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_elem, &__pyx_v_pretty_print)) return 0;
Py_INCREF(__pyx_v_elem);
Py_INCREF(__pyx_v_pretty_print);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elem), __pyx_ptype_5etree__Element, 0, "elem")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1759; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1763 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree_sys, __pyx_n_stdout); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; goto __pyx_L1;}
Py_INCREF(__pyx_v_pretty_print);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_pretty_print);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_2 = __pyx_f_5etree__dumpToFile(__pyx_1,__pyx_v_elem->_c_node,__pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1763; 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);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree.dump");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_elem);
Py_DECREF(__pyx_v_pretty_print);
return __pyx_r;
}

static PyObject *__pyx_k251p;
static PyObject *__pyx_k253p;
static PyObject *__pyx_k254p;

static char (__pyx_k251[]) = "UTF-8";
static char (__pyx_k253[]) = "US-ASCII";
static char (__pyx_k254[]) = "Type '%s' cannot be serialized.";

static PyObject *__pyx_f_5etree_tostring(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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    ";
static PyObject *__pyx_f_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_xml_declaration = 0;
PyObject *__pyx_v_pretty_print = 0;
int __pyx_v_write_declaration;
int __pyx_v_c_pretty_print;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"element_or_tree","encoding","xml_declaration","pretty_print",0};
__pyx_v_encoding = __pyx_k73;
__pyx_v_xml_declaration = __pyx_k74;
__pyx_v_pretty_print = __pyx_k75;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_element_or_tree, &__pyx_v_encoding, &__pyx_v_xml_declaration, &__pyx_v_pretty_print)) return 0;
Py_INCREF(__pyx_v_element_or_tree);
Py_INCREF(__pyx_v_encoding);
Py_INCREF(__pyx_v_xml_declaration);
Py_INCREF(__pyx_v_pretty_print);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1779 */
__pyx_1 = __pyx_v_encoding == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1780 */
  Py_INCREF(__pyx_n_ASCII);
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_n_ASCII;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1782 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_encoding, __pyx_n_upper); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1782; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_encoding);
  __pyx_v_encoding = __pyx_3;
  __pyx_3 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1783 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; goto __pyx_L1;}
Py_INCREF(__pyx_v_pretty_print);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_pretty_print);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1783; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_v_c_pretty_print = __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1784 */
__pyx_1 = __pyx_v_xml_declaration == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1786 */
  __pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1787; goto __pyx_L1;}
  Py_INCREF(__pyx_n_ASCII);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_ASCII);
  Py_INCREF(__pyx_k251p);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_k251p);
  Py_INCREF(__pyx_n_UTF8);
  PyTuple_SET_ITEM(__pyx_2, 2, __pyx_n_UTF8);
  Py_INCREF(__pyx_k253p);
  PyTuple_SET_ITEM(__pyx_2, 3, __pyx_k253p);
  __pyx_1 = PySequence_Contains(__pyx_2, __pyx_v_encoding); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1786; goto __pyx_L1;}
  __pyx_1 = !__pyx_1;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_write_declaration = __pyx_1;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1789 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  Py_INCREF(__pyx_v_xml_declaration);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_xml_declaration);
  __pyx_2 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_1 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1789; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_write_declaration = __pyx_1;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1791 */
__pyx_1 = isinstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1792 */
  __pyx_3 = __pyx_f_5etree__tostring(((struct LxmlElement *)__pyx_v_element_or_tree),__pyx_v_encoding,__pyx_v_write_declaration,__pyx_v_c_pretty_print); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1792; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_1 = isinstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1795 */
  __pyx_4 = __pyx_f_5etree__tostring(((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node,__pyx_v_encoding,__pyx_v_write_declaration,__pyx_v_c_pretty_print); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1795; goto __pyx_L1;}
  __pyx_r = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1798 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; goto __pyx_L1;}
  Py_INCREF(__pyx_v_element_or_tree);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_element_or_tree);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k254p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1798; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[0]; __pyx_lineno = 1798; 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);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.tostring");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element_or_tree);
Py_DECREF(__pyx_v_encoding);
Py_DECREF(__pyx_v_xml_declaration);
Py_DECREF(__pyx_v_pretty_print);
return __pyx_r;
}

static PyObject *__pyx_k255p;

static char (__pyx_k255[]) = "Type '%s' cannot be serialized.";

static PyObject *__pyx_f_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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 keyword argument \'pretty_print\' (bool) enables formatted XML.\n    ";
static PyObject *__pyx_f_5etree_tounicode(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_element_or_tree = 0;
PyObject *__pyx_v_pretty_print = 0;
int __pyx_v_c_pretty_print;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"element_or_tree","pretty_print",0};
__pyx_v_pretty_print = __pyx_k76;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_element_or_tree, &__pyx_v_pretty_print)) return 0;
Py_INCREF(__pyx_v_element_or_tree);
Py_INCREF(__pyx_v_pretty_print);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1811 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_bool); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; goto __pyx_L1;}
Py_INCREF(__pyx_v_pretty_print);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_pretty_print);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = PyInt_AsLong(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1811; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_v_c_pretty_print = __pyx_4;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1812 */
__pyx_4 = isinstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1813 */
  __pyx_1 = __pyx_f_5etree__tounicode(((struct LxmlElement *)__pyx_v_element_or_tree),__pyx_v_c_pretty_print); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1813; goto __pyx_L1;}
  __pyx_r = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_4 = isinstance(__pyx_v_element_or_tree,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1815 */
  __pyx_2 = __pyx_f_5etree__tounicode(((struct LxmlElementTree *)__pyx_v_element_or_tree)->_context_node,__pyx_v_c_pretty_print); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1815; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1818 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
  Py_INCREF(__pyx_v_element_or_tree);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_element_or_tree);
  __pyx_5 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyNumber_Remainder(__pyx_k255p, __pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1818; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[0]; __pyx_lineno = 1818; goto __pyx_L1;}
}
__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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.tounicode");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element_or_tree);
Py_DECREF(__pyx_v_pretty_print);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_parse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_source = 0;
struct __pyx_obj_5etree__BaseParser *__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_k77;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1825 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__parseDocument(__pyx_v_source,__pyx_v_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1825; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1826 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; goto __pyx_L1;}
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1826; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __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("etree.parse");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static struct LxmlElement *__pyx_f_5etree_getProxy(xmlNode (*__pyx_v_c_node)) {
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":11 */
__pyx_1 = (__pyx_v_c_node != NULL);
if (__pyx_1) {
  __pyx_1 = (__pyx_v_c_node->_private != NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":12 */
  __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":14 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 14; goto __pyx_L1;}
  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("etree.getProxy");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static int __pyx_f_5etree_hasProxy(xmlNode (*__pyx_v_c_node)) {
int __pyx_r;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":17 */
__pyx_r = (__pyx_v_c_node->_private != NULL);
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k256p;

static char (__pyx_k256[]) = "double registering proxy!";

static PyObject *__pyx_f_5etree_registerProxy(struct LxmlElement *__pyx_v_proxy) {
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_proxy);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":24 */
__pyx_v_c_node = __pyx_v_proxy->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":25 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":26 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":28 */
#ifndef PYREX_WITHOUT_ASSERTIONS
if (!(__pyx_v_c_node->_private == NULL)) {
  PyErr_SetObject(PyExc_AssertionError, __pyx_k256p);
  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 28; goto __pyx_L1;}
}
#endif

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":29 */
__pyx_v_c_node->_private = ((void (*))__pyx_v_proxy);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.registerProxy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_proxy);
return __pyx_r;
}

static PyObject *__pyx_k257p;

static char (__pyx_k257[]) = "Tried to unregister unknown proxy";

static PyObject *__pyx_f_5etree_unregisterProxy(struct LxmlElement *__pyx_v_proxy) {
xmlNode (*__pyx_v_c_node);
PyObject *__pyx_r;
Py_INCREF(__pyx_v_proxy);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":35 */
__pyx_v_c_node = __pyx_v_proxy->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":36 */
#ifndef PYREX_WITHOUT_ASSERTIONS
if (!(__pyx_v_c_node->_private == ((void (*))__pyx_v_proxy))) {
  PyErr_SetObject(PyExc_AssertionError, __pyx_k257p);
  {__pyx_filename = __pyx_f[1]; __pyx_lineno = 36; goto __pyx_L1;}
}
#endif

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":37 */
__pyx_v_c_node->_private = NULL;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.unregisterProxy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_proxy);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__fakeRootDoc(xmlDoc (*__pyx_v_c_base_doc),xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_v_c_child);
xmlNode (*__pyx_v_c_root);
xmlDoc (*__pyx_v_c_doc);
xmlDoc (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":49 */
__pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_base_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":50 */
__pyx_1 = (__pyx_v_c_root == __pyx_v_c_node);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":52 */
  __pyx_r = __pyx_v_c_base_doc;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":54 */
__pyx_v_c_doc = __pyx_f_5etree__copyDoc(__pyx_v_c_base_doc,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":55 */
__pyx_v_c_root = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_c_doc,2);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":56 */
xmlDocSetRootElement(__pyx_v_c_doc,__pyx_v_c_root);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":58 */
__pyx_v_c_root->children = __pyx_v_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":59 */
__pyx_v_c_root->last = __pyx_v_c_node->last;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":60 */
__pyx_v_c_root->next = NULL;
__pyx_v_c_root->prev = NULL;
__pyx_v_c_root->parent = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":63 */
__pyx_v_c_doc->_private = __pyx_v_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":66 */
__pyx_v_c_child = __pyx_v_c_root->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":67 */
while (1) {
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":68 */
  __pyx_v_c_child->parent = __pyx_v_c_root;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":69 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":71 */
__pyx_v_c_doc->children = __pyx_v_c_root;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":72 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":79 */
__pyx_1 = (__pyx_v_c_doc != __pyx_v_c_base_doc);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":80 */
  __pyx_v_c_root = xmlDocGetRootElement(__pyx_v_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":83 */
  __pyx_v_c_parent = ((xmlNode (*))__pyx_v_c_doc->_private);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":84 */
  __pyx_v_c_child = __pyx_v_c_root->children;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":85 */
  while (1) {
    __pyx_1 = (__pyx_v_c_child != NULL);
    if (!__pyx_1) break;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":86 */
    __pyx_v_c_child->parent = __pyx_v_c_parent;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":87 */
    __pyx_v_c_child = __pyx_v_c_child->next;
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":90 */
  __pyx_v_c_root->children = NULL;
  __pyx_v_c_root->last = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":91 */
  xmlFreeDoc(__pyx_v_c_doc);
  goto __pyx_L2;
}
__pyx_L2:;

}

static void __pyx_f_5etree_attemptDeallocation(xmlNode (*__pyx_v_c_node)) {
xmlNode (*__pyx_v_c_top);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":101 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":103 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":104 */
__pyx_v_c_top = __pyx_f_5etree_getDeallocationTop(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":105 */
__pyx_1 = (__pyx_v_c_top != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":107 */
  __pyx_f_5etree__removeText(__pyx_v_c_top->next);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":108 */
  xmlFreeNode(__pyx_v_c_top);
  goto __pyx_L3;
}
__pyx_L3:;

__pyx_L0:;
}

static xmlNode (*__pyx_f_5etree_getDeallocationTop(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_v_c_current);
xmlNode (*__pyx_v_c_top);
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":116 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":118 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":119 */
__pyx_v_c_current = __pyx_v_c_node->parent;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":120 */
__pyx_v_c_top = __pyx_v_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":121 */
while (1) {
  __pyx_1 = (__pyx_v_c_current != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":123 */
  __pyx_1 = (__pyx_v_c_current->type == XML_DOCUMENT_NODE);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_current->type == XML_HTML_DOCUMENT_NODE);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":126 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":128 */
  __pyx_1 = (__pyx_v_c_current->_private != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":130 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":131 */
  __pyx_v_c_top = __pyx_v_c_current;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":132 */
  __pyx_v_c_current = __pyx_v_c_current->parent;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":134 */
__pyx_1 = __pyx_f_5etree_canDeallocateChildNodes(__pyx_v_c_top);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":135 */
  __pyx_r = __pyx_v_c_top;
  goto __pyx_L0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":137 */
  __pyx_r = NULL;
  goto __pyx_L0;
}
__pyx_L7:;

__pyx_L0:;
return __pyx_r;
}

static int __pyx_f_5etree_canDeallocateChildNodes(xmlNode (*__pyx_v_c_parent)) {
xmlNode (*__pyx_v_c_node);
int __pyx_r;
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":141 */
__pyx_v_c_node = __pyx_v_c_parent->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":142 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_parent,__pyx_v_c_node,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":143 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":144 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":145 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":146 */
__pyx_r = 1;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__deallocDocument(xmlDoc (*__pyx_v_c_doc)) {
xmlNode (*__pyx_v_c_node);
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":154 */
__pyx_v_c_node = __pyx_v_c_doc->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":155 */
BEGIN_FOR_EACH_ELEMENT_FROM(((xmlNode (*))__pyx_v_c_doc),__pyx_v_c_node,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":156 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":157 */
  __pyx_2 = (PyObject *)__pyx_v_c_node->_private;
  Py_INCREF(__pyx_2);
  ((struct LxmlElement *)__pyx_2)->_c_node = NULL;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":158 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":159 */
xmlFreeDoc(__pyx_v_c_doc);

}

static void __pyx_f_5etree_moveNodeToDocument(struct LxmlElement *__pyx_v_node,struct LxmlDocument *__pyx_v_doc) {
int __pyx_1;
Py_INCREF(__pyx_v_node);
Py_INCREF(__pyx_v_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":172 */
xmlReconciliateNs(__pyx_v_doc->_c_doc,__pyx_v_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":173 */
__pyx_1 = __pyx_v_node->_doc != __pyx_v_doc;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":174 */
  Py_INCREF(((PyObject *)__pyx_v_doc));
  Py_DECREF(((PyObject *)__pyx_v_node->_doc));
  __pyx_v_node->_doc = __pyx_v_doc;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":175 */
  __pyx_f_5etree_changeDocumentBelow(__pyx_v_node->_c_node,__pyx_v_doc);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_doc);
}

static void __pyx_f_5etree_changeDocumentBelow(xmlNode (*__pyx_v_c_parent),struct LxmlDocument *__pyx_v_doc) {
xmlNode (*__pyx_v_c_node);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":185 */
__pyx_v_c_node = __pyx_v_c_parent->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":186 */
BEGIN_FOR_EACH_ELEMENT_FROM(__pyx_v_c_parent,__pyx_v_c_node,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":187 */
__pyx_1 = (__pyx_v_c_node->_private != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":188 */
  __pyx_2 = (PyObject *)__pyx_v_c_node->_private;
  Py_INCREF(__pyx_2);
  Py_INCREF(((PyObject *)__pyx_v_doc));
  Py_DECREF(((PyObject *)((struct LxmlElement *)__pyx_2)->_doc));
  ((struct LxmlElement *)__pyx_2)->_doc = __pyx_v_doc;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/proxy.pxi":189 */
END_FOR_EACH_ELEMENT_FROM(__pyx_v_c_node);

Py_DECREF(__pyx_v_doc);
}

static PyObject *__pyx_k258p;

static char (__pyx_k258[]) = " ";

static void __pyx_f_5etree_displayNode(xmlNode (*__pyx_v_c_node),PyObject *__pyx_v_indent) {
xmlNode (*__pyx_v_c_child);
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_indent);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":6 */
__pyx_1 = PyNumber_Multiply(__pyx_v_indent, __pyx_k258p); if (!__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;
__pyx_1 = PyInt_FromLong(((long )__pyx_v_c_node)); if (!__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":7 */
__pyx_v_c_child = __pyx_v_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":8 */
while (1) {
  __pyx_2 = (__pyx_v_c_child != NULL);
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":9 */
  __pyx_1 = PyInt_FromLong(1); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
  __pyx_3 = PyNumber_Add(__pyx_v_indent, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_f_5etree_displayNode(__pyx_v_c_child,__pyx_3);
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":10 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("etree.displayNode");
__pyx_L0:;
Py_DECREF(__pyx_v_indent);
}

static PyObject *__pyx_k259p;
static PyObject *__pyx_k260p;

static char (__pyx_k259[]) = "Invalid input object: %s";
static char (__pyx_k260[]) = "Input object has no document: %s";

static struct LxmlDocument *__pyx_f_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;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":20 */
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":21 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":22 */
  __pyx_1 = __pyx_v_element != Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":23 */
    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;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":25 */
  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;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Document));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":27 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":29 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_input);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k259p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[2]; __pyx_lineno = 29; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":30 */
__pyx_1 = __pyx_v_doc == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":31 */
  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_input);
  __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyNumber_Remainder(__pyx_k260p, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, __pyx_5, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 31; goto __pyx_L1;}
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":33 */
  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);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k261p;
static PyObject *__pyx_k262p;

static char (__pyx_k261[]) = "Invalid input object: %s";
static char (__pyx_k262[]) = "Input object has no element: %s";

static struct LxmlElement *__pyx_f_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;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_input);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":42 */
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":43 */
  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;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":45 */
  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;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Document));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":47 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 47; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":49 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_input);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k261p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[2]; __pyx_lineno = 49; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":50 */
__pyx_1 = __pyx_v_node == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":51 */
  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_INCREF(__pyx_v_input);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_input);
  __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyNumber_Remainder(__pyx_k262p, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __Pyx_Raise(__pyx_4, __pyx_5, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 51; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":53 */
  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);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._rootNodeOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

static struct LxmlDocument *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":60 */
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":61 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":62 */
  __pyx_1 = __pyx_v_element != Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":63 */
    Py_INCREF(((PyObject *)__pyx_v_element->_doc));
    __pyx_r = __pyx_v_element->_doc;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":65 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)->_doc));
  __pyx_r = ((struct LxmlElement *)__pyx_v_input)->_doc;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Document));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":67 */
  Py_INCREF(((PyObject *)((struct LxmlDocument *)__pyx_v_input)));
  __pyx_r = ((struct LxmlDocument *)__pyx_v_input);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":68 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; goto __pyx_L1;}
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("etree._documentOf");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

static struct LxmlElement *__pyx_f_5etree__rootNodeOf(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":74 */
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":75 */
  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;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":77 */
  Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_input)));
  __pyx_r = ((struct LxmlElement *)__pyx_v_input);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = isinstance(__pyx_v_input,((PyObject*)__pyx_ptype_5etree__Document));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":79 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)((struct LxmlDocument *)__pyx_v_input)->__pyx_vtab)->getroot(((struct LxmlDocument *)__pyx_v_input)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 79; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":81 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 81; goto __pyx_L1;}
  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("etree._rootNodeOf");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

static struct LxmlElement *__pyx_f_5etree__makeElement(PyObject *__pyx_v_tag,xmlDoc (*__pyx_v_c_doc),struct LxmlDocument *__pyx_v_doc,struct __pyx_obj_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;
int __pyx_3;
xmlNode (*__pyx_4);
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":101 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_tag); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_utf);
__pyx_v_ns_utf = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; goto __pyx_L1;}
Py_DECREF(__pyx_v_name_utf);
__pyx_v_name_utf = __pyx_1;
__pyx_1 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":102 */
__pyx_3 = __pyx_v_doc != Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":103 */
  __pyx_v_c_doc = __pyx_v_doc->_c_doc;
  goto __pyx_L2;
}
__pyx_3 = (__pyx_v_c_doc == NULL);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":105 */
  __pyx_v_c_doc = __pyx_f_5etree__newDoc();
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":106 */
__pyx_4 = __pyx_f_5etree__createElement(__pyx_v_c_doc,__pyx_v_name_utf); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 106; goto __pyx_L1;}
__pyx_v_c_node = __pyx_4;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":107 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":108 */
  __pyx_3 = __pyx_v_text != Py_None;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":109 */
    __pyx_3 = __pyx_f_5etree__setNodeText(__pyx_v_c_node,__pyx_v_text); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; goto __pyx_L3;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":110 */
  __pyx_3 = __pyx_v_tail != Py_None;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":111 */
    __pyx_3 = __pyx_f_5etree__setTailText(__pyx_v_c_node,__pyx_v_tail); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 111; goto __pyx_L3;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":112 */
  __pyx_3 = __pyx_v_doc == Py_None;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":113 */
    xmlDocSetRootElement(__pyx_v_c_doc,__pyx_v_c_node);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":114 */
    __pyx_1 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; goto __pyx_L3;}
    Py_DECREF(((PyObject *)__pyx_v_doc));
    __pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":116 */
  ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_setNodeNamespaces(__pyx_v_doc,__pyx_v_c_node,__pyx_v_ns_utf,__pyx_v_nsmap);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":117 */
  __pyx_2 = __pyx_f_5etree__initNodeAttributes(__pyx_v_c_node,__pyx_v_doc,__pyx_v_attrib,__pyx_v_extra_attrs); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 117; goto __pyx_L3;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":118 */
  __pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; goto __pyx_L3;}
  __pyx_r = ((struct LxmlElement *)__pyx_1);
  __pyx_1 = 0;
  goto __pyx_L0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_2); __pyx_2 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":119 */
/*except:*/ {
  __Pyx_AddTraceback("etree._makeElement");
  __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":121 */
  __pyx_3 = (__pyx_v_c_node->doc != __pyx_v_c_doc);
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":123 */
    __pyx_3 = __pyx_v_tail != Py_None;
    if (__pyx_3) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":124 */
      __pyx_f_5etree__removeText(__pyx_v_c_node->next);
      goto __pyx_L9;
    }
    __pyx_L9:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":125 */
    xmlFreeNode(__pyx_v_c_node);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":126 */
  __pyx_3 = __pyx_v_doc == Py_None;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":128 */
    xmlFreeDoc(__pyx_v_c_doc);
    goto __pyx_L10;
  }
  __pyx_L10:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":129 */
  __Pyx_ReRaise();
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; goto __pyx_L1;}
  goto __pyx_L4;
}
__pyx_L4:;

__pyx_r = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_n_update;

static PyObject *__pyx_k264p;

static char (__pyx_k264[]) = "Invalid attribute dictionary: %s";

static PyObject *__pyx_f_5etree__initNodeAttributes(xmlNode (*__pyx_v_c_node),struct LxmlDocument *__pyx_v_doc,PyObject *__pyx_v_attrib,PyObject *__pyx_v_extra) {
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;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":136 */
__pyx_1 = __pyx_v_attrib != Py_None;
if (__pyx_1) {
  __pyx_1 = (!hasattr(__pyx_v_attrib,__pyx_n_items));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":137 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_attrib);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k264p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 137; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[2]; __pyx_lineno = 137; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":138 */
__pyx_1 = __pyx_v_extra != Py_None;
__pyx_4 = PyInt_FromLong(__pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; goto __pyx_L1;}
__pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; goto __pyx_L1;}
if (__pyx_1) {
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_4 = __pyx_v_extra;
  Py_INCREF(__pyx_4);
}
__pyx_1 = PyObject_IsTrue(__pyx_4); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 138; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":139 */
  __pyx_1 = __pyx_v_attrib == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":140 */
    Py_INCREF(__pyx_v_extra);
    Py_DECREF(__pyx_v_attrib);
    __pyx_v_attrib = __pyx_v_extra;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":142 */
    __pyx_5 = PyObject_GetAttr(__pyx_v_attrib, __pyx_n_update); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; goto __pyx_L1;}
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; goto __pyx_L1;}
    Py_INCREF(__pyx_v_extra);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_extra);
    __pyx_3 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 142; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":143 */
__pyx_1 = PyObject_IsTrue(__pyx_v_attrib); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 143; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":144 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_attrib, __pyx_n_items); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
  __pyx_5 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyObject_GetIter(__pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
      break;
    }
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
    Py_DECREF(__pyx_v_name);
    __pyx_v_name = __pyx_5;
    __pyx_5 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 144; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":145 */
    __pyx_5 = __pyx_f_5etree__getNsTag(__pyx_v_name); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; goto __pyx_L1;}
    __pyx_3 = PyObject_GetIter(__pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_4 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_v_attr_ns_utf);
    __pyx_v_attr_ns_utf = __pyx_4;
    __pyx_4 = 0;
    __pyx_5 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_v_attr_name_utf);
    __pyx_v_attr_name_utf = __pyx_5;
    __pyx_5 = 0;
    if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":146 */
    __pyx_4 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value_utf);
    __pyx_v_value_utf = __pyx_4;
    __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":147 */
    __pyx_1 = __pyx_v_attr_ns_utf == Py_None;
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":148 */
      xmlNewProp(__pyx_v_c_node,_cstr(__pyx_v_attr_name_utf),_cstr(__pyx_v_value_utf));
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":150 */
      __pyx_v_c_ns = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc,__pyx_v_c_node,_cstr(__pyx_v_attr_ns_utf));

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":151 */
      xmlNewNsProp(__pyx_v_c_node,__pyx_v_c_ns,_cstr(__pyx_v_attr_name_utf),_cstr(__pyx_v_value_utf));
    }
    __pyx_L8:;
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

__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("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;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":157 */
__pyx_v_href = _getNs(((xmlNode (*))__pyx_v_c_attrib_node));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":158 */
__pyx_1 = (__pyx_v_href == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":159 */
  __pyx_v_value = xmlGetNoNsProp(__pyx_v_c_element,__pyx_v_c_attrib_node->name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":161 */
  __pyx_v_value = xmlGetNsProp(__pyx_v_c_element,__pyx_v_c_attrib_node->name,__pyx_v_href);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":162 */
__pyx_2 = __pyx_f_5etree_funicode(__pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":163 */
xmlFree(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":164 */
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("etree._attributeValue");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":169 */
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":170 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_c_element,__pyx_v_c_name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":172 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_c_element,__pyx_v_c_name,__pyx_v_c_href);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":173 */
__pyx_1 = (__pyx_v_c_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":174 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":175 */
__pyx_2 = __pyx_f_5etree_funicode(__pyx_v_c_result); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":176 */
xmlFree(__pyx_v_c_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":177 */
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("etree._attributeValueFromNsName");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

static PyObject *__pyx_f_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;
int __pyx_3;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":182 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 182; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":183 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":184 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":185 */
  __pyx_v_c_result = xmlGetNoNsProp(__pyx_v_element->_c_node,__pyx_v_c_tag);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":187 */
  __pyx_v_c_result = xmlGetNsProp(__pyx_v_element->_c_node,__pyx_v_c_tag,_cstr(__pyx_v_ns));
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":188 */
__pyx_3 = (__pyx_v_c_result == NULL);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":190 */
  Py_INCREF(__pyx_v_default);
  __pyx_r = __pyx_v_default;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":191 */
__pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_result); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 191; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":192 */
xmlFree(__pyx_v_c_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":193 */
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);
__Pyx_AddTraceback("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;
}

static int __pyx_f_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;
int __pyx_3;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":199 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 199; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":200 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":201 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 201; goto __pyx_L1;}
Py_DECREF(__pyx_v_value);
__pyx_v_value = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":202 */
__pyx_v_c_value = _cstr(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":203 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":204 */
  xmlSetProp(__pyx_v_element->_c_node,__pyx_v_c_tag,__pyx_v_c_value);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":206 */
  __pyx_v_c_ns = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_element->_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_element->_doc,__pyx_v_element->_c_node,_cstr(__pyx_v_ns));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":207 */
  xmlSetNsProp(__pyx_v_element->_c_node,__pyx_v_c_ns,__pyx_v_c_tag,__pyx_v_c_value);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":208 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static int __pyx_f_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;
int __pyx_3;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":213 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_key); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 213; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":214 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":215 */
  __pyx_v_c_href = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":217 */
  __pyx_v_c_href = _cstr(__pyx_v_ns);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":218 */
__pyx_3 = __pyx_f_5etree__delAttributeFromNsName(__pyx_v_element->_c_node,__pyx_v_c_href,_cstr(__pyx_v_tag));
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":219 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_v_key, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 219; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":220 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":224 */
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":225 */
  __pyx_v_c_attr = xmlHasProp(__pyx_v_c_node,__pyx_v_c_name);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":227 */
  __pyx_v_c_attr = xmlHasNsProp(__pyx_v_c_node,__pyx_v_c_name,__pyx_v_c_href);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":228 */
__pyx_1 = (__pyx_v_c_attr == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":230 */
  __pyx_r = (-1);
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":231 */
xmlRemoveProp(__pyx_v_c_attr);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":232 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k265p;

static char (__pyx_k265[]) = "\\g<1>";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":246 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; goto __pyx_L1;}
Py_INCREF(__pyx_k265p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k265p);
Py_INCREF(__pyx_v_xml_string);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_xml_string);
__pyx_2 = PyObject_CallObject(__pyx_v_5etree___REPLACE_XML_ENCODING, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 246; 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("etree._stripEncodingDeclaration");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":250 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; 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_5etree___HAS_XML_ENCODING, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 250; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__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("etree._hasEncodingDeclaration");
__pyx_L0:;
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

static PyObject *__pyx_n_strip;

static PyObject *__pyx_k266p;
static PyObject *__pyx_k267p;
static PyObject *__pyx_k268p;

static char (__pyx_k266[]) = "<?xml";
static char (__pyx_k267[]) = "?>";
static char (__pyx_k268[]) = "\n\r ";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":254 */
__pyx_1 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_n_strip); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 254; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":255 */
__pyx_1 = PySequence_GetSlice(__pyx_v_xml_string, 0, 5); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_1, __pyx_k266p, &__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 255; goto __pyx_L1;}
__pyx_3 = __pyx_3 == 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":256 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_xml_string, __pyx_n_find); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; goto __pyx_L1;}
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; goto __pyx_L1;}
  Py_INCREF(__pyx_k267p);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k267p);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 256; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_i);
  __pyx_v_i = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":257 */
  __pyx_2 = PyInt_FromLong((-1)); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_v_i, __pyx_2, &__pyx_3) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 257; goto __pyx_L1;}
  __pyx_3 = __pyx_3 != 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":258 */
    __pyx_1 = PyInt_FromLong(2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 258; goto __pyx_L1;}
    __pyx_4 = PyNumber_Add(__pyx_v_i, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 258; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_4;
    __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":259 */
    while (1) {
      __pyx_5 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      __pyx_1 = PyNumber_Add(__pyx_v_i, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_6 = PyInt_AsSsize_t(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_4 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_5, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      __pyx_3 = PySequence_Contains(__pyx_k268p, __pyx_4); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 259; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      if (!__pyx_3) break;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":260 */
      __pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; goto __pyx_L1;}
      __pyx_1 = PyNumber_Add(__pyx_v_i, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 260; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_1;
      __pyx_1 = 0;
    }

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":261 */
    __pyx_5 = PyInt_AsSsize_t(__pyx_v_i); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; goto __pyx_L1;}
    __pyx_4 = PySequence_GetSlice(__pyx_v_xml_string, __pyx_5, PY_SSIZE_T_MAX); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 261; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":262 */
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("etree._stripDeclaration");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_i);
Py_DECREF(__pyx_v_xml_string);
return __pyx_r;
}

static PyObject *__pyx_k269p;
static PyObject *__pyx_k270p;

static char (__pyx_k269[]) = "";
static char (__pyx_k270[]) = "";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":275 */
__pyx_v_scount = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":276 */
__pyx_v_text = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":277 */
__pyx_1 = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_node);
__pyx_v_c_node_cur = __pyx_1;
__pyx_v_c_node = __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":278 */
while (1) {
  __pyx_2 = (__pyx_v_c_node_cur != NULL);
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":279 */
  __pyx_2 = ((__pyx_v_c_node_cur->content[0]) != '\0');
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":280 */
    __pyx_v_text = __pyx_v_c_node_cur->content;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":281 */
  __pyx_v_scount = (__pyx_v_scount + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":282 */
  __pyx_v_c_node_cur = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_node_cur->next);
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":285 */
__pyx_2 = (__pyx_v_text == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":286 */
  __pyx_2 = (__pyx_v_scount > 0);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":287 */
    Py_INCREF(__pyx_k269p);
    __pyx_r = __pyx_k269p;
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":289 */
    Py_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L6:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":290 */
__pyx_2 = (__pyx_v_scount == 1);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":291 */
  __pyx_3 = __pyx_f_5etree_funicode(__pyx_v_text); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 291; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":294 */
Py_INCREF(__pyx_k270p);
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_k270p;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":295 */
while (1) {
  __pyx_2 = (__pyx_v_c_node != NULL);
  if (!__pyx_2) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":296 */
  __pyx_3 = PyString_FromString(__pyx_v_c_node->content); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; goto __pyx_L1;}
  __pyx_4 = PyNumber_Add(__pyx_v_result, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 296; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":297 */
  __pyx_v_c_node = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_node->next);
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":298 */
__pyx_5 = PyString_AsString(__pyx_v_result); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; goto __pyx_L1;}
__pyx_3 = __pyx_f_5etree_funicode(__pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 298; 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("etree._collectText");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
return __pyx_r;
}

static void __pyx_f_5etree__removeText(xmlNode (*__pyx_v_c_node)) {
xmlNode (*__pyx_v_c_next);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":306 */
__pyx_v_c_node = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":307 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":308 */
  __pyx_v_c_next = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_node->next);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":309 */
  xmlUnlinkNode(__pyx_v_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":310 */
  xmlFreeNode(__pyx_v_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":311 */
  __pyx_v_c_node = __pyx_v_c_next;
}

}

static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":316 */
__pyx_f_5etree__removeText(__pyx_v_c_node->children);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":317 */
__pyx_1 = __pyx_v_value == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":318 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":320 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 320; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":321 */
__pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc,_cstr(__pyx_v_text));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":322 */
__pyx_1 = (__pyx_v_c_node->children == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":323 */
  xmlAddChild(__pyx_v_c_node,__pyx_v_c_text_node);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":325 */
  xmlAddPrevSibling(__pyx_v_c_node->children,__pyx_v_c_text_node);
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":326 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._setNodeText");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":331 */
__pyx_f_5etree__removeText(__pyx_v_c_node->next);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":332 */
__pyx_1 = __pyx_v_value == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":333 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":334 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; goto __pyx_L1;}
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":335 */
__pyx_v_c_text_node = xmlNewDocText(__pyx_v_c_node->doc,_cstr(__pyx_v_text));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":337 */
xmlAddNextSibling(__pyx_v_c_node,__pyx_v_c_text_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":338 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._setTailText");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF(__pyx_v_text);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__findChild(xmlNode (*__pyx_v_c_node),Py_ssize_t __pyx_v_index)) {
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":341 */
__pyx_1 = (__pyx_v_index < 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":342 */
  __pyx_r = __pyx_f_5etree__findChildBackwards(__pyx_v_c_node,((-__pyx_v_index) - 1));
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":344 */
  __pyx_r = __pyx_f_5etree__findChildForwards(__pyx_v_c_node,__pyx_v_index);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":351 */
__pyx_v_c_child = __pyx_v_c_node->children;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":352 */
__pyx_v_c = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":353 */
while (1) {
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":354 */
  __pyx_1 = _isElement(__pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":355 */
    __pyx_1 = (__pyx_v_c == __pyx_v_index);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":356 */
      __pyx_r = __pyx_v_c_child;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":357 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":358 */
  __pyx_v_c_child = __pyx_v_c_child->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":359 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":367 */
__pyx_v_c_child = __pyx_v_c_node->last;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":368 */
__pyx_v_c = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":369 */
while (1) {
  __pyx_1 = (__pyx_v_c_child != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":370 */
  __pyx_1 = _isElement(__pyx_v_c_child);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":371 */
    __pyx_1 = (__pyx_v_c == __pyx_v_index);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":372 */
      __pyx_r = __pyx_v_c_child;
      goto __pyx_L0;
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":373 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":374 */
  __pyx_v_c_child = __pyx_v_c_child->prev;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":375 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__textNodeOrSkip(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":384 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":385 */
  __pyx_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":386 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_1 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":389 */
    __pyx_v_c_node = __pyx_v_c_node->next;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":391 */
    __pyx_r = NULL;
    goto __pyx_L0;
  }
  __pyx_L4:;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":392 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__nextElement(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":397 */
__pyx_v_c_node = __pyx_v_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":398 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":399 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":400 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":401 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":402 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__previousElement(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":407 */
__pyx_v_c_node = __pyx_v_c_node->prev;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":408 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":409 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":410 */
    __pyx_r = __pyx_v_c_node;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":411 */
  __pyx_v_c_node = __pyx_v_c_node->prev;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":412 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__parentElement(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":416 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {
  __pyx_1 = (!_isElement(__pyx_v_c_node));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":417 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":418 */
__pyx_v_c_node = __pyx_v_c_node->parent;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":419 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {
  __pyx_1 = (!_isElement(__pyx_v_c_node));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":420 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":421 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":438 */
__pyx_1 = (__pyx_v_c_name == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":439 */
  __pyx_1 = (__pyx_v_c_href == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":441 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":443 */
    __pyx_v_c_node_href = _getNs(__pyx_v_c_node);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":444 */
    __pyx_1 = (__pyx_v_c_node_href == NULL);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":445 */
      __pyx_r = ((__pyx_v_c_href[0]) == '\0');
      goto __pyx_L0;
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":447 */
      __pyx_r = (strcmp(__pyx_v_c_node_href,__pyx_v_c_href) == 0);
      goto __pyx_L0;
    }
    __pyx_L4:;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_c_href == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":449 */
  __pyx_1 = (_getNs(__pyx_v_c_node) != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":450 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":451 */
  __pyx_r = (strcmp(__pyx_v_c_node->name,__pyx_v_c_name) == 0);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (strcmp(__pyx_v_c_node->name,__pyx_v_c_name) == 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":453 */
  __pyx_v_c_node_href = _getNs(__pyx_v_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":454 */
  __pyx_1 = (__pyx_v_c_node_href == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":455 */
    __pyx_r = ((__pyx_v_c_href[0]) == '\0');
    goto __pyx_L0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":457 */
    __pyx_r = (strcmp(__pyx_v_c_node_href,__pyx_v_c_href) == 0);
    goto __pyx_L0;
  }
  __pyx_L6:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":459 */
  __pyx_r = 0;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__removeNode(xmlNode (*__pyx_v_c_node)) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":464 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":465 */
__pyx_f_5etree_attemptDeallocation(__pyx_v_c_node);

}

static void __pyx_f_5etree__moveTail(xmlNode (*__pyx_v_c_tail),xmlNode (*__pyx_v_c_target)) {
xmlNode (*__pyx_v_c_next);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":471 */
__pyx_v_c_tail = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_tail);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":472 */
while (1) {
  __pyx_1 = (__pyx_v_c_tail != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":473 */
  __pyx_v_c_next = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_tail->next);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":474 */
  xmlUnlinkNode(__pyx_v_c_tail);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":475 */
  xmlAddNextSibling(__pyx_v_c_target,__pyx_v_c_tail);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":476 */
  __pyx_v_c_target = __pyx_v_c_tail;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":477 */
  __pyx_v_c_tail = __pyx_v_c_next;
}

}

static void __pyx_f_5etree__copyTail(xmlNode (*__pyx_v_c_tail),xmlNode (*__pyx_v_c_target)) {
xmlNode (*__pyx_v_c_new_tail);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":483 */
__pyx_v_c_tail = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_tail);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":484 */
while (1) {
  __pyx_1 = (__pyx_v_c_tail != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":485 */
  __pyx_1 = (__pyx_v_c_target->doc != __pyx_v_c_tail->doc);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":486 */
    __pyx_v_c_new_tail = xmlDocCopyNode(__pyx_v_c_tail,__pyx_v_c_target->doc,0);
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":488 */
    __pyx_v_c_new_tail = xmlCopyNode(__pyx_v_c_tail,0);
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":489 */
  xmlAddNextSibling(__pyx_v_c_target,__pyx_v_c_new_tail);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":490 */
  __pyx_v_c_target = __pyx_v_c_new_tail;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":491 */
  __pyx_v_c_tail = __pyx_f_5etree__textNodeOrSkip(__pyx_v_c_tail->next);
}

}

static xmlNode (*__pyx_f_5etree__deleteSlice(xmlNode (*__pyx_v_c_node),Py_ssize_t __pyx_v_start,Py_ssize_t __pyx_v_stop)) {
xmlNode (*__pyx_v_c_next);
Py_ssize_t __pyx_v_c;
xmlNode (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":498 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":499 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":501 */
__pyx_v_c = __pyx_v_start;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":502 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_c < __pyx_v_stop);
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":503 */
  __pyx_v_c_next = __pyx_v_c_node->next;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":504 */
  __pyx_1 = _isElement(__pyx_v_c_node);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":505 */
    __pyx_f_5etree__removeText(__pyx_v_c_node->next);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":506 */
    __pyx_v_c_next = __pyx_v_c_node->next;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":507 */
    __pyx_f_5etree__removeNode(__pyx_v_c_node);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":508 */
    __pyx_v_c = (__pyx_v_c + 1);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":509 */
  __pyx_v_c_node = __pyx_v_c_next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":510 */
__pyx_r = __pyx_v_c_node;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__appendChild(struct LxmlElement *__pyx_v_parent,struct LxmlElement *__pyx_v_child) {
xmlNode (*__pyx_v_c_next);
xmlNode (*__pyx_v_c_node);
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_child);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":517 */
__pyx_v_c_node = __pyx_v_child->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":519 */
__pyx_v_c_next = __pyx_v_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":521 */
xmlUnlinkNode(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":523 */
xmlAddChild(__pyx_v_parent->_c_node,__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":524 */
__pyx_f_5etree__moveTail(__pyx_v_c_next,__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":527 */
__pyx_f_5etree_moveNodeToDocument(__pyx_v_child,__pyx_v_parent->_doc);

Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_child);
}

static int __pyx_f_5etree_isutf8(char (*__pyx_v_s)) {
char __pyx_v_c;
int __pyx_r;
int __pyx_1;
long __pyx_2;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":531 */
__pyx_v_c = (__pyx_v_s[0]);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":532 */
while (1) {
  __pyx_1 = (__pyx_v_c != '\0');
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":533 */
  __pyx_2 = (__pyx_v_c & 0x80);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":534 */
    __pyx_r = 1;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":535 */
  __pyx_v_s = (__pyx_v_s + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":536 */
  __pyx_v_c = (__pyx_v_s[0]);
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":537 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":543 */
__pyx_v_spos = __pyx_v_s;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":544 */
__pyx_v_c = (__pyx_v_spos[0]);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":545 */
while (1) {
  __pyx_1 = (__pyx_v_c != '\0');
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":546 */
  __pyx_2 = (__pyx_v_c & 0x80);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":547 */
    goto __pyx_L3;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":548 */
  __pyx_v_spos = (__pyx_v_spos + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":549 */
  __pyx_v_c = (__pyx_v_spos[0]);
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":550 */
__pyx_v_slen = (__pyx_v_spos - __pyx_v_s);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":551 */
__pyx_1 = (__pyx_v_c != '\0');
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":552 */
  __pyx_3 = PyUnicode_DecodeUTF8(__pyx_v_s,(__pyx_v_slen + strlen(__pyx_v_spos)),NULL); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 552; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":553 */
__pyx_3 = PyString_FromStringAndSize(__pyx_v_s,__pyx_v_slen); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; 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("etree.funicode");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k271p;
static PyObject *__pyx_k272p;

static char (__pyx_k271[]) = "All strings must be Unicode or ASCII";
static char (__pyx_k272[]) = "Argument must be string or unicode.";

static PyObject *__pyx_f_5etree__utf8(PyObject *__pyx_v_s) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_s);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":556 */
__pyx_1 = PyString_Check(__pyx_v_s);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":557 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  if (!(!__pyx_f_5etree_isutf8(_cstr(__pyx_v_s)))) {
    PyErr_SetObject(PyExc_AssertionError, __pyx_k271p);
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 557; goto __pyx_L1;}
  }
  #endif

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":558 */
  Py_INCREF(__pyx_v_s);
  __pyx_r = __pyx_v_s;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = PyUnicode_Check(__pyx_v_s);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":560 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_s); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 560; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":562 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k272p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._utf8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

static PyObject *__pyx_k273p;

static char (__pyx_k273[]) = "Argument must be string or unicode.";

static PyObject *__pyx_f_5etree__encodeFilename(PyObject *__pyx_v_filename) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_filename);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":565 */
__pyx_1 = __pyx_v_filename == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":566 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = PyString_Check(__pyx_v_filename);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":568 */
  Py_INCREF(__pyx_v_filename);
  __pyx_r = __pyx_v_filename;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = PyUnicode_Check(__pyx_v_filename);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":570 */
  __pyx_2 = PyUnicode_AsEncodedString(__pyx_v_filename,__pyx_v_5etree__C_FILENAME_ENCODING,NULL); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 570; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":573 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k273p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 573; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._encodeFilename");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

static PyObject *__pyx_n_UnicodeDecodeError;

static PyObject *__pyx_k274p;

static char (__pyx_k274[]) = "Argument must be string or unicode.";

static PyObject *__pyx_f_5etree__encodeFilenameUTF8(PyObject *__pyx_v_filename) {
char (*__pyx_v_c_filename);
PyObject *__pyx_v_decode_exc;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_filename);
__pyx_v_decode_exc = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":580 */
__pyx_1 = __pyx_v_filename == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":581 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = PyString_Check(__pyx_v_filename);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":583 */
  __pyx_v_c_filename = _cstr(__pyx_v_filename);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":584 */
  __pyx_1 = (!__pyx_f_5etree_isutf8(__pyx_v_c_filename));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":586 */
    Py_INCREF(__pyx_v_filename);
    __pyx_r = __pyx_v_filename;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":587 */
  /*try:*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":589 */
    __pyx_2 = PyUnicode_Decode(__pyx_v_c_filename,PyString_GET_SIZE(__pyx_v_filename),__pyx_v_5etree__C_FILENAME_ENCODING,NULL); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 589; goto __pyx_L4;}
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_2;
    __pyx_2 = 0;
  }
  goto __pyx_L5;
  __pyx_L4:;
  Py_XDECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":592 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_UnicodeDecodeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; goto __pyx_L1;}
  __pyx_1 = PyErr_ExceptionMatches(__pyx_2);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (__pyx_1) {
    __Pyx_AddTraceback("etree._encodeFilenameUTF8");
    __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 592; goto __pyx_L1;}
    Py_DECREF(__pyx_v_decode_exc);
    __pyx_v_decode_exc = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":593 */
    /*try:*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":595 */
      __pyx_2 = PyUnicode_DecodeUTF8(__pyx_v_c_filename,PyString_GET_SIZE(__pyx_v_filename),NULL); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 595; goto __pyx_L6;}
      Py_DECREF(__pyx_v_filename);
      __pyx_v_filename = __pyx_2;
      __pyx_2 = 0;
    }
    goto __pyx_L7;
    __pyx_L6:;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":597 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_UnicodeDecodeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; goto __pyx_L1;}
    __pyx_1 = PyErr_ExceptionMatches(__pyx_2);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {
      __Pyx_AddTraceback("etree._encodeFilenameUTF8");
      __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":598 */
      __Pyx_Raise(__pyx_v_decode_exc, 0, 0);
      {__pyx_filename = __pyx_f[2]; __pyx_lineno = 598; goto __pyx_L1;}
      goto __pyx_L7;
    }
    goto __pyx_L1;
    __pyx_L7:;
    goto __pyx_L5;
  }
  goto __pyx_L1;
  __pyx_L5:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":599 */
__pyx_1 = PyUnicode_Check(__pyx_v_filename);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":600 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 600; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":602 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k274p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; goto __pyx_L1;}
}
__pyx_L8:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._encodeFilenameUTF8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_decode_exc);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

static PyObject *__pyx_k275p;
static PyObject *__pyx_k276p;
static PyObject *__pyx_k277p;

static char (__pyx_k275[]) = "Invalid tag name";
static char (__pyx_k276[]) = "Empty tag name";
static char (__pyx_k277[]) = "Empty tag name";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":612 */
__pyx_1 = isinstance(__pyx_v_tag,((PyObject*)__pyx_ptype_5etree_QName));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":613 */
  Py_INCREF(((struct __pyx_obj_5etree_QName *)__pyx_v_tag)->text);
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = ((struct __pyx_obj_5etree_QName *)__pyx_v_tag)->text;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":614 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_tag); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; goto __pyx_L1;}
Py_DECREF(__pyx_v_tag);
__pyx_v_tag = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":615 */
__pyx_v_c_tag = _cstr(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":616 */
__pyx_1 = ((__pyx_v_c_tag[0]) == '{');
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":617 */
    __pyx_v_c_tag = (__pyx_v_c_tag + 1);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":618 */
  __pyx_v_c_ns_end = strchr(__pyx_v_c_tag,'}');

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":619 */
  __pyx_1 = (__pyx_v_c_ns_end == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":620 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 620; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k275p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 620; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":621 */
  __pyx_v_nslen = (__pyx_v_c_ns_end - __pyx_v_c_tag);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":622 */
  __pyx_v_taglen = ((PyString_GET_SIZE(__pyx_v_tag) - __pyx_v_nslen) - 2);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":623 */
  __pyx_1 = (__pyx_v_taglen == 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":624 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 624; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k276p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[2]; __pyx_lineno = 624; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":625 */
  __pyx_1 = (__pyx_v_nslen > 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":626 */
    __pyx_2 = PyString_FromStringAndSize(__pyx_v_c_tag,__pyx_v_nslen); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 626; goto __pyx_L1;}
    Py_DECREF(__pyx_v_ns);
    __pyx_v_ns = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":627 */
  __pyx_2 = PyString_FromStringAndSize((__pyx_v_c_ns_end + 1),__pyx_v_taglen); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 627; goto __pyx_L1;}
  Py_DECREF(__pyx_v_tag);
  __pyx_v_tag = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_1 = (PyString_GET_SIZE(__pyx_v_tag) == 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":629 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k277p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[2]; __pyx_lineno = 629; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":630 */
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 630; 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("etree._getNsTag");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__namespacedName(xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":633 */
__pyx_1 = __pyx_f_5etree__namespacedNameFromNsName(_getNs(__pyx_v_c_node),__pyx_v_c_node->name); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; 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("etree._namespacedName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static char (__pyx_k278[]) = "{%s}%s";
static char (__pyx_k279[]) = "UTF-8";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":636 */
__pyx_1 = (__pyx_v_href == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":637 */
  __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":639 */
  __pyx_2 = PyString_FromFormat(__pyx_k278,__pyx_v_href,__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 639; goto __pyx_L1;}
  Py_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":640 */
  __pyx_1 = __pyx_f_5etree_isutf8(__pyx_v_href);
  if (!__pyx_1) {
    __pyx_1 = __pyx_f_5etree_isutf8(__pyx_v_name);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":641 */
    __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_s,__pyx_k279,NULL); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 641; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":643 */
    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("etree._namespacedNameFromNsName");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

static PyObject *__pyx_n_name;
static PyObject *__pyx_n_filename;
static PyObject *__pyx_n_geturl;


static PyObject *__pyx_f_5etree__getFilenameForFile(PyObject *__pyx_v_source) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_source);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":651 */
__pyx_1 = hasattr(__pyx_v_source,__pyx_n_name);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":652 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_source, __pyx_n_name); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":654 */
__pyx_1 = hasattr(__pyx_v_source,__pyx_n_filename);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":655 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_source, __pyx_n_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":657 */
__pyx_1 = hasattr(__pyx_v_source,__pyx_n_geturl);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":658 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_source, __pyx_n_geturl); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 658; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 658; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":659 */
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);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._getFilenameForFile");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_source);
return __pyx_r;
}

static PyObject *__pyx_n_clear;

static PyObject *__pyx_f_5etree_clearErrorLog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_clearErrorLog[] = "Clear the global error log.\n    Note that this log is already bounded to a fixed size.";
static PyObject *__pyx_f_5etree_clearErrorLog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":10 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG), __pyx_n_clear); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 10; 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("etree.clearErrorLog");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__nullGenericErrorFunc(void (*__pyx_v_ctxt),char (*__pyx_v_msg),...) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":14 */

}

static void __pyx_f_5etree__initThreadLogging(void) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":20 */
xmlThrDefSetGenericErrorFunc(NULL,__pyx_f_5etree__nullGenericErrorFunc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":21 */
xmlSetGenericErrorFunc(NULL,__pyx_f_5etree__nullGenericErrorFunc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":24 */
xmlThrDefSetStructuredErrorFunc(NULL,__pyx_f_5etree__receiveError);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":25 */
__pyx_f_5etree_connectErrorLog(NULL);

}

static void __pyx_f_5etree_connectErrorLog(void (*__pyx_v_log)) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":28 */
xmlSetStructuredErrorFunc(__pyx_v_log,__pyx_f_5etree__receiveError);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":29 */
xsltSetGenericErrorFunc(__pyx_v_log,__pyx_f_5etree__receiveXSLTError);

}

static PyObject *__pyx_k283p;

static char (__pyx_k283[]) = "<string>";

static PyObject *__pyx_f_5etree_9_LogEntry__setError(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":43 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->domain); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 43; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->domain);
__pyx_v_self->domain = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":44 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->code); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 44; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->type);
__pyx_v_self->type = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":45 */
__pyx_1 = PyInt_FromLong(((int )__pyx_v_error->level)); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 45; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->level);
__pyx_v_self->level = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":46 */
__pyx_1 = PyInt_FromLong(__pyx_v_error->line); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 46; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->line);
__pyx_v_self->line = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":47 */
__pyx_v_size = strlen(__pyx_v_error->message);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":48 */
__pyx_2 = (__pyx_v_size > 0);
if (__pyx_2) {
  __pyx_2 = ((__pyx_v_error->message[(__pyx_v_size - 1)]) == '\n');
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":49 */
  __pyx_v_size = (__pyx_v_size - 1);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":50 */
__pyx_1 = PyString_FromStringAndSize(__pyx_v_error->message,__pyx_v_size); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 50; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->message);
__pyx_v_self->message = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":51 */
__pyx_2 = (__pyx_v_error->file == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":52 */
  Py_INCREF(__pyx_k283p);
  Py_DECREF(__pyx_v_self->filename);
  __pyx_v_self->filename = __pyx_k283p;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":54 */
  __pyx_1 = PyString_FromString(__pyx_v_error->file); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 54; goto __pyx_L1;}
  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("etree._LogEntry._setError");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_9_LogEntry__setGeneric(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":58 */
__pyx_1 = PyInt_FromLong(__pyx_v_domain); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 58; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->domain);
__pyx_v_self->domain = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":59 */
__pyx_1 = PyInt_FromLong(__pyx_v_type); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 59; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->type);
__pyx_v_self->type = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":60 */
__pyx_1 = PyInt_FromLong(__pyx_v_level); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->level);
__pyx_v_self->level = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":61 */
__pyx_1 = PyInt_FromLong(__pyx_v_line); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 61; goto __pyx_L1;}
Py_DECREF(__pyx_v_self->line);
__pyx_v_self->line = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":62 */
Py_INCREF(__pyx_v_message);
Py_DECREF(__pyx_v_self->message);
__pyx_v_self->message = __pyx_v_message;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":63 */
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("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;
}

static PyObject *__pyx_n_level_name;
static PyObject *__pyx_n_domain_name;
static PyObject *__pyx_n_type_name;

static PyObject *__pyx_k284p;

static char (__pyx_k284[]) = "%s:%d:%s:%s:%s: %s";

static PyObject *__pyx_f_5etree_9_LogEntry___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":66 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_level_name); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_domain_name); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_v_self, __pyx_n_type_name); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_4 = PyTuple_New(6); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 67; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->filename);
PyTuple_SET_ITEM(__pyx_4, 0, ((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->filename);
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->line);
PyTuple_SET_ITEM(__pyx_4, 1, ((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->line);
PyTuple_SET_ITEM(__pyx_4, 2, __pyx_1);
PyTuple_SET_ITEM(__pyx_4, 3, __pyx_2);
PyTuple_SET_ITEM(__pyx_4, 4, __pyx_3);
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->message);
PyTuple_SET_ITEM(__pyx_4, 5, ((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->message);
__pyx_1 = 0;
__pyx_2 = 0;
__pyx_3 = 0;
__pyx_1 = PyNumber_Remainder(__pyx_k284p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 66; 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("etree._LogEntry.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n__getName;
static PyObject *__pyx_n_unknown;


static PyObject *__pyx_f_5etree_9_LogEntry_11domain_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":72 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorDomains); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->domain);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 72; 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("etree._LogEntry.domain_name.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}


static PyObject *__pyx_f_5etree_9_LogEntry_9type_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":76 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->type);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 76; 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("etree._LogEntry.type_name.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}


static PyObject *__pyx_f_5etree_9_LogEntry_10level_name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":80 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n__getName); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__LogEntry *)__pyx_v_self)->level);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 80; 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("etree._LogEntry.level_name.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_13_BaseErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_last_error = 0;
int __pyx_r;
static char *__pyx_argnames[] = {"last_error",0};
__pyx_v_last_error = __pyx_k79;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_last_error)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_last_error);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":85 */
Py_INCREF(__pyx_v_last_error);
Py_DECREF(((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_self)->last_error = __pyx_v_last_error;

__pyx_r = 0;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_last_error);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":88 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_self)->last_error);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__BaseErrorLog), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 88; 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("etree._BaseErrorLog.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k288p;

static char (__pyx_k288[]) = "";

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":91 */
Py_INCREF(__pyx_k288p);
__pyx_r = __pyx_k288p;
goto __pyx_L0;

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

static PyObject *__pyx_n_receive;

static void __pyx_f_5etree_13_BaseErrorLog__receive(struct __pyx_obj_5etree__BaseErrorLog *__pyx_v_self,xmlError (*__pyx_v_error)) {
int __pyx_v_is_error;
struct __pyx_obj_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_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":96 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__LogEntry), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 96; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 96; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entry));
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":97 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__LogEntry *)__pyx_v_entry->__pyx_vtab)->_setError(__pyx_v_entry,__pyx_v_error); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 97; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":98 */
__pyx_2 = (__pyx_v_error->level == XML_ERR_ERROR);
if (!__pyx_2) {
  __pyx_2 = (__pyx_v_error->level == XML_ERR_FATAL);
}
__pyx_v_is_error = __pyx_2;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":100 */
__pyx_2 = __pyx_v_5etree___GLOBAL_ERROR_LOG != __pyx_v_self;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":101 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG), __pyx_n_receive); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 101; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 101; 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 (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 101; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":102 */
  __pyx_2 = __pyx_v_is_error;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":103 */
    Py_INCREF(((PyObject *)__pyx_v_entry));
    Py_DECREF(__pyx_v_5etree___GLOBAL_ERROR_LOG->last_error);
    __pyx_v_5etree___GLOBAL_ERROR_LOG->last_error = ((PyObject *)__pyx_v_entry);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":104 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_receive); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; 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 (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 104; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":105 */
__pyx_2 = __pyx_v_is_error;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":106 */
  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("etree._BaseErrorLog._receive");
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_self);
}

static void __pyx_f_5etree_13_BaseErrorLog__receiveGeneric(struct __pyx_obj_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) {
struct __pyx_obj_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_is_error;
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_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_is_error = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":111 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__LogEntry), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_entry));
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":112 */
__pyx_1 = ((struct __pyx_vtabstruct_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 (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 112; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":113 */
__pyx_2 = (__pyx_v_level == XML_ERR_ERROR);
if (!__pyx_2) {
  __pyx_2 = (__pyx_v_level == XML_ERR_FATAL);
}
__pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 113; goto __pyx_L1;}
Py_DECREF(__pyx_v_is_error);
__pyx_v_is_error = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":115 */
__pyx_2 = __pyx_v_5etree___GLOBAL_ERROR_LOG != __pyx_v_self;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":116 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG), __pyx_n_receive); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; 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 (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 116; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":117 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_is_error); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 117; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":118 */
    Py_INCREF(((PyObject *)__pyx_v_entry));
    Py_DECREF(__pyx_v_5etree___GLOBAL_ERROR_LOG->last_error);
    __pyx_v_5etree___GLOBAL_ERROR_LOG->last_error = ((PyObject *)__pyx_v_entry);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":119 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_receive); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; 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 (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 119; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":120 */
__pyx_2 = PyObject_IsTrue(__pyx_v_is_error); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 120; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":121 */
  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("etree._BaseErrorLog._receiveGeneric");
__pyx_L0:;
Py_DECREF(__pyx_v_entry);
Py_DECREF(__pyx_v_is_error);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_filename);
}

static int __pyx_f_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_13_ListErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entries = 0;
PyObject *__pyx_v_last_error = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"entries","last_error",0};
__pyx_v_last_error = __pyx_k80;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_entries, &__pyx_v_last_error)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entries);
Py_INCREF(__pyx_v_last_error);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":127 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseErrorLog), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(__pyx_v_last_error);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_last_error);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 127; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":128 */
Py_INCREF(__pyx_v_entries);
Py_DECREF(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries);
((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries = __pyx_v_entries;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._ListErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entries);
Py_DECREF(__pyx_v_last_error);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":131 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries);
PyTuple_SET_ITEM(__pyx_1, 0, ((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries);
Py_INCREF(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
PyTuple_SET_ITEM(__pyx_1, 1, ((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->__pyx_base.last_error);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 131; 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("etree._ListErrorLog.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":134 */
__pyx_1 = iter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 134; 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("etree._ListErrorLog.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_join;

static PyObject *__pyx_k289p;

static char (__pyx_k289[]) = "\n";

static PyObject *__pyx_f_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_13_ListErrorLog___repr__(PyObject *__pyx_v_self) {
PyObject *__pyx_v_l;
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);
__pyx_v_l = Py_None; Py_INCREF(Py_None);
__pyx_v_entry = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":137 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 137; goto __pyx_L1;}
Py_DECREF(__pyx_v_l);
__pyx_v_l = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":138 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 138; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_entry);
  __pyx_v_entry = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":139 */
  __pyx_2 = repr(__pyx_v_entry); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; goto __pyx_L1;}
  __pyx_3 = PyList_Append(__pyx_v_l,__pyx_2); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 139; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":140 */
__pyx_2 = PyObject_GetAttr(__pyx_k289p, __pyx_n_join); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 140; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 140; goto __pyx_L1;}
Py_INCREF(__pyx_v_l);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_l);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 140; 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("etree._ListErrorLog.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_l);
Py_DECREF(__pyx_v_entry);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_13_ListErrorLog___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":143 */
__pyx_1 = PyObject_GetItem(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries, __pyx_v_index); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 143; 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("etree._ListErrorLog.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_index);
return __pyx_r;
}

static PyObject *__pyx_n_len;

static Py_ssize_t __pyx_f_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_f_5etree_13_ListErrorLog___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_ssize_t __pyx_4;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":146 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries);
PyTuple_SET_ITEM(__pyx_2, 0, ((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = PyInt_AsSsize_t(__pyx_3); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_r = __pyx_4;
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("etree._ListErrorLog.__len__");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_domains(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_domains = 0;
struct __pyx_obj_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"domains",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_domains)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_domains);
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":150 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 150; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":151 */
__pyx_2 = (!PySequence_Check(__pyx_v_domains));
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":152 */
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 152; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":153 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_1);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; goto __pyx_L1;}
    break;
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":154 */
  __pyx_2 = PySequence_Contains(__pyx_v_domains, __pyx_v_entry->domain); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 154; goto __pyx_L1;}
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":155 */
    __pyx_2 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":156 */
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filtered);
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 156; 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("etree._ListErrorLog.filter_domains");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_types(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_types = 0;
struct __pyx_obj_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"types",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_types)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_types);
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":160 */
__pyx_1 = (!PySequence_Check(__pyx_v_types));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":161 */
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 161; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":162 */
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":163 */
__pyx_2 = PyObject_GetIter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; goto __pyx_L1;}
    break;
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 163; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":164 */
  __pyx_1 = PySequence_Contains(__pyx_v_types, __pyx_v_entry->type); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 164; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":165 */
    __pyx_1 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":166 */
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 166; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filtered);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 166; goto __pyx_L1;}
Py_DECREF(__pyx_3); __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_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._ListErrorLog.filter_types");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_13_ListErrorLog_filter_levels[] = "Return a log with all messages of the requested level(s). Takes a\n        single log level or a sequence.";
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_levels(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_levels = 0;
struct __pyx_obj_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"levels",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_levels)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_levels);
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":172 */
__pyx_1 = (!PySequence_Check(__pyx_v_levels));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":173 */
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 173; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":174 */
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 174; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":175 */
__pyx_2 = PyObject_GetIter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; goto __pyx_L1;}
    break;
  }
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 175; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":176 */
  __pyx_1 = PySequence_Contains(__pyx_v_levels, __pyx_v_entry->level); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 176; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":177 */
    __pyx_1 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 177; goto __pyx_L1;}
    goto __pyx_L5;
  }
  __pyx_L5:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":178 */
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filtered);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; goto __pyx_L1;}
Py_DECREF(__pyx_3); __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_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._ListErrorLog.filter_levels");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_13_ListErrorLog_filter_from_level[] = "Return a log with all messages of the requested level of worse.";
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_level(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_level = 0;
struct __pyx_obj_5etree__LogEntry *__pyx_v_entry;
PyObject *__pyx_v_filtered;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
static char *__pyx_argnames[] = {"level",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_level)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_level);
__pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)Py_None); Py_INCREF(Py_None);
__pyx_v_filtered = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":183 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 183; goto __pyx_L1;}
Py_DECREF(__pyx_v_filtered);
__pyx_v_filtered = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":184 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_5etree__ListErrorLog *)__pyx_v_self)->_entries); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; goto __pyx_L1;}
    break;
  }
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__LogEntry)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 184; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_entry));
  __pyx_v_entry = ((struct __pyx_obj_5etree__LogEntry *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":185 */
  if (PyObject_Cmp(__pyx_v_entry->level, __pyx_v_level, &__pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 185; goto __pyx_L1;}
  __pyx_3 = __pyx_3 >= 0;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":186 */
    __pyx_3 = PyList_Append(__pyx_v_filtered,((PyObject *)__pyx_v_entry)); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 186; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":187 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; goto __pyx_L1;}
Py_INCREF(__pyx_v_filtered);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_filtered);
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 187; 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("etree._ListErrorLog.filter_from_level");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_filter_from_level;
static PyObject *__pyx_n_FATAL;

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_13_ListErrorLog_filter_from_fatals[] = "Convenience method to get all fatal error messages.";
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_fatals(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":191 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_FATAL); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 191; 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("etree._ListErrorLog.filter_from_fatals");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_ERROR;

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_13_ListErrorLog_filter_from_errors[] = "Convenience method to get all error messages or worse.";
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_errors(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":195 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_ERROR); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 195; 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("etree._ListErrorLog.filter_from_errors");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_WARNING;

static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_13_ListErrorLog_filter_from_warnings[] = "Convenience method to get all warnings or worse.";
static PyObject *__pyx_f_5etree_13_ListErrorLog_filter_from_warnings(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":199 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_filter_from_level); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_WARNING); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 199; 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("etree._ListErrorLog.filter_from_warnings");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_9_ErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":203 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 203; goto __pyx_L1;}
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 203; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 203; 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);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 203; 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("etree._ErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_9_ErrorLog_connect(struct __pyx_obj_5etree__ErrorLog *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":206 */
if (PySequence_DelSlice(__pyx_v_self->__pyx_base._entries, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 206; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":207 */
__pyx_f_5etree_connectErrorLog(((void (*))__pyx_v_self));

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("etree._ErrorLog.connect");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
}

static void __pyx_f_5etree_9_ErrorLog_disconnect(struct __pyx_obj_5etree__ErrorLog *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":210 */
__pyx_f_5etree_connectErrorLog(NULL);

Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_f_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_9_ErrorLog_clear(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":213 */
if (PySequence_DelSlice(((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 213; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._ErrorLog.clear");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":216 */
__pyx_1 = PySequence_GetSlice(((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
PyTuple_SET_ITEM(__pyx_2, 1, ((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base.last_error);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 216; 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("etree._ErrorLog.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_9_ErrorLog___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":219 */
__pyx_1 = PySequence_GetSlice(((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries, 0, PY_SSIZE_T_MAX); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; goto __pyx_L1;}
__pyx_2 = iter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; 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("etree._ErrorLog.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_9_ErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"entry",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_entry)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":222 */
__pyx_1 = PyList_Append(((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_self)->__pyx_base._entries,__pyx_v_entry); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 222; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._ErrorLog.receive");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

static PyObject *__pyx_n__accepted_domains;

static int __pyx_f_5etree_15_DomainErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":226 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ErrorLog), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; 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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 226; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":227 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_tuple); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; goto __pyx_L1;}
Py_INCREF(__pyx_v_domains);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_domains);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_v_self, __pyx_n__accepted_domains, __pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 227; goto __pyx_L1;}
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("etree._DomainErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_domains);
return __pyx_r;
}

static PyObject *__pyx_n_domain;

static PyObject *__pyx_f_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_15_DomainErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"entry",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_entry)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":230 */
__pyx_1 = PyObject_GetAttr(__pyx_v_entry, __pyx_n_domain); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 230; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n__accepted_domains); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 230; goto __pyx_L1;}
__pyx_3 = PySequence_Contains(__pyx_2, __pyx_1); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 230; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":231 */
  __pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ErrorLog), __pyx_n_receive); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; 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 (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 231; 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("etree._DomainErrorLog.receive");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

static int __pyx_f_5etree_17_RotatingErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":236 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ErrorLog), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 236; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 236; 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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 236; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":237 */
__pyx_4 = PyInt_AsLong(__pyx_v_max_len); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 237; goto __pyx_L1;}
((struct __pyx_obj_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("etree._RotatingErrorLog.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_max_len);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_17_RotatingErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_v_entries;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"entry",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_entry)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);
__pyx_v_entries = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":240 */
Py_INCREF(((struct __pyx_obj_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries);
Py_DECREF(__pyx_v_entries);
__pyx_v_entries = ((struct __pyx_obj_5etree__RotatingErrorLog *)__pyx_v_self)->__pyx_base.__pyx_base._entries;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":241 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_entries) > ((struct __pyx_obj_5etree__RotatingErrorLog *)__pyx_v_self)->_max_len);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":242 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  if (PyObject_DelItem(__pyx_v_entries, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 242; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":243 */
__pyx_1 = PyList_Append(__pyx_v_entries,__pyx_v_entry); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 243; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._RotatingErrorLog.receive");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_entries);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

static PyObject *__pyx_n_logging;
static PyObject *__pyx_n_CRITICAL;
static PyObject *__pyx_n_getLogger;
static PyObject *__pyx_n_log;


static int __pyx_f_5etree_10PyErrorLog___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k81;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":266 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseErrorLog), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; 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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 266; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":267 */
__pyx_1 = __Pyx_Import(__pyx_n_logging, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 267; goto __pyx_L1;}
Py_DECREF(__pyx_v_logging);
__pyx_v_logging = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":268 */
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_WARNING); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_WARNING); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 269; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; goto __pyx_L1;}
__pyx_3 = PyObject_GetAttr(__pyx_1, __pyx_n_ERROR); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_ERROR); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 270; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_3, __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_3, __pyx_n_FATAL); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_3 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_CRITICAL); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 271; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_2, __pyx_1, __pyx_3) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 268; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->level_map);
((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->level_map = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":273 */
__pyx_4 = PyObject_IsTrue(__pyx_v_logger_name); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 273; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":274 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_getLogger); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_INCREF(__pyx_v_logger_name);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_logger_name);
  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_logger);
  __pyx_v_logger = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":276 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_logging, __pyx_n_getLogger); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_logger);
  __pyx_v_logger = __pyx_3;
  __pyx_3 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":277 */
__pyx_2 = PyObject_GetAttr(__pyx_v_logger, __pyx_n_log); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 277; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->_log);
((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->_log = __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("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":280 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ListErrorLog), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 280; 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("etree.PyErrorLog.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_get;
static PyObject *__pyx_n_level;

static PyObject *__pyx_f_5etree_10PyErrorLog_log(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_4 = 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) return 0;
if (!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 0;
}
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);
Py_INCREF(__pyx_v_message_format_string);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":283 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->level_map, __pyx_n_get); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_v_entry, __pyx_n_level); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; goto __pyx_L1;}
__pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; goto __pyx_L1;}
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; 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 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 284; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 283; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
Py_INCREF(__pyx_v_message_format_string);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_message_format_string);
__pyx_2 = 0;
__pyx_1 = PySequence_Tuple(__pyx_v_args); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 283; goto __pyx_L1;}
__pyx_4 = PyNumber_Add(__pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 283; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_2 = PyObject_CallObject(((struct __pyx_obj_5etree_PyErrorLog *)__pyx_v_self)->_log, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 283; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 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);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree.PyErrorLog.log");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_10PyErrorLog_receive(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_entry = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"entry",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_entry)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_entry);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":289 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_log); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 289; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 289; 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 (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 289; 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("etree.PyErrorLog.receive");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_entry);
return __pyx_r;
}

static PyObject *__pyx_f_5etree___copyGlobalErrorLog(void) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":297 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG), __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 297; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__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("etree.__copyGlobalErrorLog");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_f_5etree_useGlobalPythonLog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_useGlobalPythonLog[] = "Replace the global error log by an etree.PyErrorLog that uses the\n    standard Python logging package.\n\n    Note that this slows down processing and disables access to the global\n    error log from exceptions.  Parsers, XSLT etc. will continue to provide\n    their normal local error log.\n    ";
static PyObject *__pyx_f_5etree_useGlobalPythonLog(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5etree_PyErrorLog *__pyx_v_log = 0;
PyObject *__pyx_r;
static char *__pyx_argnames[] = {"log",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_log)) return 0;
Py_INCREF((PyObject *)__pyx_v_log);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_log), __pyx_ptype_5etree_PyErrorLog, 0, "log")) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 299; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":308 */
Py_INCREF(((PyObject *)__pyx_v_log));
Py_DECREF(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG));
__pyx_v_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_log);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.useGlobalPythonLog");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_log);
return __pyx_r;
}

static void __pyx_f_5etree__forwardError(void (*__pyx_v_c_log_handler),xmlError (*__pyx_v_error)) {
struct __pyx_obj_5etree__ErrorLog *__pyx_v_log_handler;
int __pyx_1;
PyObject *__pyx_2 = 0;
__pyx_v_log_handler = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":314 */
__pyx_1 = (__pyx_v_c_log_handler != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":315 */
  __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_5etree__ErrorLog *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":317 */
  if (!__Pyx_TypeTest(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG), __pyx_ptype_5etree__ErrorLog)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 317; goto __pyx_L1;}
  Py_INCREF(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG));
  Py_DECREF(((PyObject *)__pyx_v_log_handler));
  __pyx_v_log_handler = ((struct __pyx_obj_5etree__ErrorLog *)__pyx_v_5etree___GLOBAL_ERROR_LOG);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":318 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_log_handler->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._receive(((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_v_log_handler),__pyx_v_error);

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._forwardError");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_log_handler);
}

static void __pyx_f_5etree__receiveError(void (*__pyx_v_c_log_handler),xmlError (*__pyx_v_error)) {
PyGILState_STATE __pyx_v_gil_state;
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":324 */
__pyx_1 = (__pyx_v_5etree___DEBUG != 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":325 */
  __pyx_v_gil_state = PyGILState_Ensure();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":326 */
  __pyx_f_5etree__forwardError(__pyx_v_c_log_handler,__pyx_v_error);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":327 */
  PyGILState_Release(__pyx_v_gil_state);
  goto __pyx_L2;
}
__pyx_L2:;

}

static char (__pyx_k291[]) = "file %s";
static char (__pyx_k292[]) = "XSLT:";
static char (__pyx_k293[]) = "<xslt>";
static char (__pyx_k294[]) = "line %d";
static char (__pyx_k295[]) = "element %s";
static char (__pyx_k296[]) = "";
static char (__pyx_k297[]) = "%s, element '%s'";

static void __pyx_f_5etree__receiveXSLTError(void (*__pyx_v_c_log_handler),char (*__pyx_v_msg),...) {
PyGILState_STATE __pyx_v_gil_state;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":339 */
__pyx_1 = (__pyx_v_5etree___DEBUG == 0);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_msg == NULL);
  if (!__pyx_1) {
    __pyx_1 = ((__pyx_v_msg[0]) == '\n');
  }
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":340 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":342 */
va_start(__pyx_v_args,__pyx_v_msg);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":343 */
__pyx_1 = ((__pyx_v_msg[0]) == '%');
if (__pyx_1) {
  __pyx_1 = ((__pyx_v_msg[1]) == 's');
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":344 */
  __pyx_v_c_text = va_charptr(__pyx_v_args);
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":346 */
  __pyx_v_c_text = NULL;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":347 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k291) != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":348 */
  __pyx_v_c_error.file = va_charptr(__pyx_v_args);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":349 */
  __pyx_1 = (__pyx_v_c_error.file != NULL);
  if (__pyx_1) {
    __pyx_1 = (strlen(__pyx_v_c_error.file) > 0);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":350 */
    __pyx_1 = (strncmp(__pyx_v_c_error.file,__pyx_k292,5) == 0);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":351 */
      __pyx_v_c_error.file = __pyx_k293;
      goto __pyx_L6;
    }
    __pyx_L6:;
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":353 */
  __pyx_v_c_error.file = NULL;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":354 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k294) != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":355 */
  __pyx_v_c_error.line = va_int(__pyx_v_args);
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":357 */
  __pyx_v_c_error.line = (-1);
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":358 */
__pyx_1 = (strstr(__pyx_v_msg,__pyx_k295) != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":359 */
  __pyx_v_c_element = va_charptr(__pyx_v_args);
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":361 */
  __pyx_v_c_element = NULL;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":362 */
va_end(__pyx_v_args);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":364 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":365 */
__pyx_v_c_message = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":366 */
__pyx_1 = (__pyx_v_c_text == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":367 */
  __pyx_v_c_error.message = __pyx_k296;
  goto __pyx_L9;
}
__pyx_1 = (__pyx_v_c_element == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":369 */
  __pyx_v_c_error.message = __pyx_v_c_text;
  goto __pyx_L9;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":371 */
  __pyx_v_text_size = strlen(__pyx_v_c_text);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":372 */
  __pyx_v_element_size = strlen(__pyx_v_c_element);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":373 */
  __pyx_v_c_message = ((char (*))PyMem_Malloc(((((__pyx_v_text_size + 12) + __pyx_v_element_size) + 1) * (sizeof(char )))));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":375 */
  sprintf(__pyx_v_c_message,__pyx_k297,__pyx_v_c_text,__pyx_v_c_element);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":376 */
  __pyx_v_c_error.message = __pyx_v_c_message;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":378 */
__pyx_v_c_error.domain = XML_FROM_XSLT;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":379 */
__pyx_v_c_error.code = XML_ERR_OK;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":380 */
__pyx_v_c_error.level = XML_ERR_ERROR;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":382 */
__pyx_f_5etree__forwardError(__pyx_v_c_log_handler,(&__pyx_v_c_error));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":384 */
__pyx_1 = (__pyx_v_c_message != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":385 */
  PyMem_Free(__pyx_v_c_error.message);
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":386 */
PyGILState_Release(__pyx_v_gil_state);

__pyx_L0:;
}

static PyObject *__pyx_n__names;

static PyObject *__pyx_k298p;

static char (__pyx_k298[]) = "\\s*([a-zA-Z0-9_]+)\\s*=\\s*([0-9]+)";

static void __pyx_f_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;
PyObject *__pyx_5 = 0;
int __pyx_6;
__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":395 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 395; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 395; goto __pyx_L1;}
Py_INCREF(__pyx_k298p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k298p);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 395; 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 (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 395; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":396 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorLevels); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 396; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 396; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
Py_INCREF(__pyx_v_5etree___ERROR_LEVELS);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_5etree___ERROR_LEVELS);
__pyx_2 = 0;
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorDomains); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 397; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 397; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
Py_INCREF(__pyx_v_5etree___ERROR_DOMAINS);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_5etree___ERROR_DOMAINS);
__pyx_1 = 0;
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ErrorTypes); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 398; goto __pyx_L1;}
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 398; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
Py_INCREF(__pyx_v_5etree___ERROR_TYPES);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_5etree___ERROR_TYPES);
__pyx_1 = 0;
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 396; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":399 */
__pyx_3 = PyObject_GetIter(__pyx_v_const_defs); if (!__pyx_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_3);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
    break;
  }
  __pyx_4 = PyObject_GetIter(__pyx_2); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
  Py_DECREF(__pyx_v_cls);
  __pyx_v_cls = __pyx_1;
  __pyx_1 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
  Py_DECREF(__pyx_v_constant_tuple);
  __pyx_v_constant_tuple = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 399; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":400 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 400; goto __pyx_L1;}
  Py_DECREF(__pyx_v_reverse_dict);
  __pyx_v_reverse_dict = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":401 */
  if (PyObject_SetAttr(__pyx_v_cls, __pyx_n__names, __pyx_v_reverse_dict) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 401; goto __pyx_L1;}

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":402 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_reverse_dict, __pyx_n_get); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_v_cls, __pyx_n__getName, __pyx_2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 402; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":403 */
  __pyx_4 = PyObject_GetIter(__pyx_v_constant_tuple); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 403; goto __pyx_L1;}
  for (;;) {
    __pyx_1 = PyIter_Next(__pyx_4);
    if (!__pyx_1) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 403; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_constants);
    __pyx_v_constants = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":405 */
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; 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 (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    for (;;) {
      __pyx_1 = PyIter_Next(__pyx_2);
      if (!__pyx_1) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
        break;
      }
      __pyx_5 = PyObject_GetIter(__pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_1 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_1;
      __pyx_1 = 0;
      __pyx_1 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
      Py_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_1;
      __pyx_1 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 405; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":406 */
      __pyx_1 = PyNumber_Int(__pyx_v_value); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 406; goto __pyx_L1;}
      Py_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_1;
      __pyx_1 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":407 */
      PyObject_SetAttr(__pyx_v_cls,__pyx_v_name,__pyx_v_value);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":408 */
      __pyx_6 = PyDict_SetItem(__pyx_v_reverse_dict,__pyx_v_value,__pyx_v_name); if (__pyx_6 == (-1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 408; 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_5);
__Pyx_WriteUnraisable("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);
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":50 */
((struct LxmlElementClassLookup *)__pyx_v_self)->_lookup_function = NULL;

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

static PyObject *__pyx_n_setFallback;

static int __pyx_f_5etree_26FallbackElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k100;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_5etree_ElementClassLookup, 1, "fallback")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":60 */
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->__pyx_base._lookup_function = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":61 */
__pyx_1 = __pyx_v_fallback != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":62 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_setFallback); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; 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 (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 62; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":64 */
  ((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = __pyx_f_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("etree.FallbackElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_26FallbackElementClassLookup_setFallback(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_26FallbackElementClassLookup_setFallback[] = "Sets the fallback scheme for this lookup method.\n        ";
static PyObject *__pyx_f_5etree_26FallbackElementClassLookup_setFallback(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};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_lookup)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_lookup);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_5etree_ElementClassLookup, 0, "lookup")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 66; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":69 */
Py_INCREF(((PyObject *)__pyx_v_lookup));
Py_DECREF(((PyObject *)((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->fallback));
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->fallback = __pyx_v_lookup;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":70 */
((struct LxmlFallbackElementClassLookup *)__pyx_v_self)->_fallback_function = __pyx_v_lookup->_lookup_function;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.FallbackElementClassLookup.setFallback");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_26FallbackElementClassLookup__callFallback(struct LxmlFallbackElementClassLookup *__pyx_v_self,PyObject *__pyx_v_doc,xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":73 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; goto __pyx_L1;}
__pyx_1 = __pyx_v_self->_fallback_function(((PyObject *)__pyx_v_self->fallback),((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 73; 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("etree.FallbackElementClassLookup._callFallback");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_k299p;
static PyObject *__pyx_k300p;
static PyObject *__pyx_k301p;

static char (__pyx_k299[]) = "element class must be subclass of ElementBase";
static char (__pyx_k300[]) = "comment class must be subclass of CommentBase";
static char (__pyx_k301[]) = "PI class must be subclass of PIBase";

static int __pyx_f_5etree_25ElementDefaultClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"element","comment","pi",0};
__pyx_v_element = __pyx_k101;
__pyx_v_comment = __pyx_k102;
__pyx_v_pi = __pyx_k103;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOO", __pyx_argnames, &__pyx_v_element, &__pyx_v_comment, &__pyx_v_pi)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_comment);
Py_INCREF(__pyx_v_pi);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":87 */
((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->__pyx_base._lookup_function = __pyx_f_5etree__lookupDefaultElementClass;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":88 */
__pyx_1 = __pyx_v_element == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":89 */
  Py_INCREF(((PyObject*)__pyx_ptype_5etree__Element));
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = ((PyObject*)__pyx_ptype_5etree__Element);
  goto __pyx_L2;
}
__pyx_1 = issubclass(__pyx_v_element,((PyObject*)__pyx_ptype_5etree_ElementBase));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":91 */
  Py_INCREF(__pyx_v_element);
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->element_class = __pyx_v_element;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":93 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k299p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 93; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":95 */
__pyx_1 = __pyx_v_comment == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":96 */
  Py_INCREF(((PyObject*)__pyx_ptype_5etree__Comment));
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = ((PyObject*)__pyx_ptype_5etree__Comment);
  goto __pyx_L3;
}
__pyx_1 = issubclass(__pyx_v_comment,((PyObject*)__pyx_ptype_5etree_CommentBase));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":98 */
  Py_INCREF(__pyx_v_comment);
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->comment_class = __pyx_v_comment;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":100 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 100; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k300p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 100; goto __pyx_L1;}
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":102 */
__pyx_1 = __pyx_v_pi == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":103 */
  Py_INCREF(((PyObject*)__pyx_ptype_5etree__ProcessingInstruction));
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = ((PyObject*)__pyx_ptype_5etree__ProcessingInstruction);
  goto __pyx_L4;
}
__pyx_1 = issubclass(__pyx_v_pi,((PyObject*)__pyx_ptype_5etree_PIBase));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":105 */
  Py_INCREF(__pyx_v_pi);
  Py_DECREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class);
  ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_self)->pi_class = __pyx_v_pi;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":107 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 107; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k301p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[4]; __pyx_lineno = 107; goto __pyx_L1;}
}
__pyx_L4:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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);
return __pyx_r;
}

static PyObject *__pyx_k305p;

static char (__pyx_k302[]) = "xml-stylesheet";
static char (__pyx_k303[]) = "text/xsl";
static char (__pyx_k304[]) = "text/xml";
static char (__pyx_k305[]) = "Unknown node type: %s";

static PyObject *__pyx_f_5etree__lookupDefaultElementClass(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v__doc,xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_state);
Py_INCREF(__pyx_v__doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":111 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":112 */
  __pyx_1 = __pyx_v_state == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":113 */
    Py_INCREF(((PyObject*)__pyx_ptype_5etree__Element));
    __pyx_r = ((PyObject*)__pyx_ptype_5etree__Element);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":115 */
    Py_INCREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class);
    __pyx_r = ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->element_class;
    goto __pyx_L0;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":117 */
  __pyx_1 = __pyx_v_state == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":118 */
    Py_INCREF(((PyObject*)__pyx_ptype_5etree__Comment));
    __pyx_r = ((PyObject*)__pyx_ptype_5etree__Comment);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":120 */
    Py_INCREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class);
    __pyx_r = ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->comment_class;
    goto __pyx_L0;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_c_node->type == XML_PI_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":122 */
  __pyx_1 = __pyx_v_state == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":124 */
    __pyx_1 = (__pyx_v_c_node->name != NULL);
    if (__pyx_1) {
      __pyx_1 = (__pyx_v_c_node->content != NULL);
    }
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":125 */
      __pyx_1 = (strcmp(__pyx_v_c_node->name,__pyx_k302) == 0);
      if (__pyx_1) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":126 */
        __pyx_1 = (strstr(__pyx_v_c_node->content,__pyx_k303) != NULL);
        if (!__pyx_1) {
          __pyx_1 = (strstr(__pyx_v_c_node->content,__pyx_k304) != NULL);
        }
        if (__pyx_1) {

          /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":128 */
          Py_INCREF(((PyObject*)__pyx_ptype_5etree__XSLTProcessingInstruction));
          __pyx_r = ((PyObject*)__pyx_ptype_5etree__XSLTProcessingInstruction);
          goto __pyx_L0;
          goto __pyx_L8;
        }
        __pyx_L8:;
        goto __pyx_L7;
      }
      __pyx_L7:;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":129 */
    Py_INCREF(((PyObject*)__pyx_ptype_5etree__ProcessingInstruction));
    __pyx_r = ((PyObject*)__pyx_ptype_5etree__ProcessingInstruction);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":131 */
    Py_INCREF(((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class);
    __pyx_r = ((struct __pyx_obj_5etree_ElementDefaultClassLookup *)__pyx_v_state)->pi_class;
    goto __pyx_L0;
  }
  __pyx_L5:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":133 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_2 = PyInt_FromLong(__pyx_v_c_node->type); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; goto __pyx_L1;}
  __pyx_3 = PyNumber_Remainder(__pyx_k305p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!0) {
    PyErr_SetObject(PyExc_AssertionError, __pyx_3);
    {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; goto __pyx_L1;}
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  #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("etree._lookupDefaultElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v__doc);
return __pyx_r;
}

static int __pyx_f_5etree_27ElementNamespaceClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k104;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_5etree_ElementClassLookup, 1, "fallback")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":140 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_FallbackElementClassLookup), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; 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 (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 140; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":141 */
((struct __pyx_obj_5etree_ElementNamespaceClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_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("etree.ElementNamespaceClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

static int __pyx_f_5etree_32AttributeBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k105;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_5etree_ElementClassLookup, 1, "fallback")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 160; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":161 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_attribute_name); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 161; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag);
((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":162 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_pytag); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 162; goto __pyx_L1;}
__pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 162; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_2;
__pyx_2 = 0;
__pyx_2 = __Pyx_UnpackItem(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 162; goto __pyx_L1;}
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 = 162; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":163 */
__pyx_3 = __pyx_v_ns == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":164 */
  ((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":166 */
  ((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_ns = _cstr(__pyx_v_ns);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":167 */
((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_c_name = _cstr(__pyx_v_name);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":168 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 168; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 168; goto __pyx_L1;}
Py_INCREF(__pyx_v_class_mapping);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_class_mapping);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 168; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping);
((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->_class_mapping = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":170 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_FallbackElementClassLookup), __pyx_n___init__); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; goto __pyx_L1;}
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; 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 (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":171 */
((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_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("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;
}

static PyObject *__pyx_f_5etree__attribute_class_lookup(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode (*__pyx_v_c_node)) {
struct __pyx_obj_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_5etree_AttributeBasedElementClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_value = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":177 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":178 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":179 */
  __pyx_2 = __pyx_f_5etree__attributeValueFromNsName(__pyx_v_c_node,__pyx_v_lookup->_c_ns,__pyx_v_lookup->_c_name); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 179; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":181 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_lookup->_class_mapping,__pyx_v_value);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":182 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":183 */
    __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":184 */
__pyx_2 = ((struct __pyx_vtabstruct_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 (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 184; 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("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;
}

static int __pyx_f_5etree_29ParserBasedElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k106;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_5etree_ElementClassLookup, 1, "fallback")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":191 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_FallbackElementClassLookup), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; 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 (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 191; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":192 */
((struct __pyx_obj_5etree_ParserBasedElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_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("etree.ParserBasedElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":196 */
Py_INCREF(((PyObject *)((struct LxmlFallbackElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct LxmlFallbackElementClassLookup *)__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":197 */
__pyx_1 = (__pyx_v_c_node->type == XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":198 */
  __pyx_1 = __pyx_v_doc->_parser->_class_lookup != Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":199 */
    __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 (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 199; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":201 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *)__pyx_v_lookup->__pyx_vtab)->_callFallback(__pyx_v_lookup,((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 201; 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("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;
}

static int __pyx_f_5etree_24CustomElementClassLookup___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k107;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_fallback), __pyx_ptype_5etree_ElementClassLookup, 1, "fallback")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 219; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":220 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_FallbackElementClassLookup), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; 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 (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 220; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":221 */
((struct __pyx_obj_5etree_CustomElementClassLookup *)__pyx_v_self)->__pyx_base.__pyx_base._lookup_function = __pyx_f_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("etree.CustomElementClassLookup.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_fallback);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_24CustomElementClassLookup_lookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOOO", __pyx_argnames, &__pyx_v_type, &__pyx_v_doc, &__pyx_v_namespace, &__pyx_v_name)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":224 */
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;
}

static PyObject *__pyx_n_comment;
static PyObject *__pyx_n_PI;
static PyObject *__pyx_n_element;
static PyObject *__pyx_n_lookup;


static PyObject *__pyx_f_5etree__custom_class_lookup(PyObject *__pyx_v_state,struct LxmlDocument *__pyx_v_doc,xmlNode (*__pyx_v_c_node)) {
struct __pyx_obj_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_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":230 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_CustomElementClassLookup *)__pyx_v_state)));
Py_DECREF(((PyObject *)__pyx_v_lookup));
__pyx_v_lookup = ((struct __pyx_obj_5etree_CustomElementClassLookup *)__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":232 */
__pyx_1 = (__pyx_v_c_node->type == XML_COMMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":233 */
  Py_INCREF(__pyx_n_comment);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_comment;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_c_node->type == XML_PI_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":235 */
  Py_INCREF(__pyx_n_PI);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_PI;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":237 */
  Py_INCREF(__pyx_n_element);
  Py_DECREF(__pyx_v_element_type);
  __pyx_v_element_type = __pyx_n_element;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":238 */
__pyx_1 = (__pyx_v_c_node->name == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":239 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = Py_None;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":241 */
  __pyx_2 = PyString_FromString(__pyx_v_c_node->name); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 241; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":242 */
__pyx_v_c_str = _getNs(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":243 */
__pyx_1 = (__pyx_v_c_str == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":244 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = Py_None;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":246 */
  __pyx_2 = PyString_FromString(__pyx_v_c_str); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns);
  __pyx_v_ns = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":248 */
__pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_lookup), __pyx_n_lookup); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; goto __pyx_L1;}
__pyx_3 = PyTuple_New(4); if (!__pyx_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; 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 (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":249 */
__pyx_1 = __pyx_v_cls != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":250 */
  Py_INCREF(__pyx_v_cls);
  __pyx_r = __pyx_v_cls;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":251 */
__pyx_2 = ((struct __pyx_vtabstruct_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 (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 251; 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("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;
}

static void __pyx_f_5etree__setElementClassLookupFunction(PyObject *((*__pyx_v_function)(PyObject *,struct LxmlDocument *,xmlNode (*))),PyObject *__pyx_v_state) {
int __pyx_1;
Py_INCREF(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":263 */
__pyx_1 = (__pyx_v_function == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":264 */
  Py_INCREF(((PyObject *)__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
  Py_DECREF(__pyx_v_state);
  __pyx_v_state = ((PyObject *)__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":265 */
  __pyx_v_function = __pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP->__pyx_base.__pyx_base._lookup_function;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":267 */
Py_INCREF(__pyx_v_state);
Py_DECREF(__pyx_v_5etree_ELEMENT_CLASS_LOOKUP_STATE);
__pyx_v_5etree_ELEMENT_CLASS_LOOKUP_STATE = __pyx_v_state;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":268 */
__pyx_v_5etree_LOOKUP_ELEMENT_CLASS = __pyx_v_function;

Py_DECREF(__pyx_v_state);
}

static PyObject *__pyx_f_5etree_setElementClassLookup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_setElementClassLookup(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_k108;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup)) return 0;
Py_INCREF(__pyx_v_lookup);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_5etree_ElementClassLookup, 1, "lookup")) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 270; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":271 */
__pyx_1 = __pyx_v_lookup == Py_None;
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_lookup->_lookup_function == NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":272 */
  __pyx_f_5etree__setElementClassLookupFunction(NULL,Py_None);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":274 */
  __pyx_f_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("etree.setElementClassLookup");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_Namespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_Namespace[] = "Retrieve the namespace object associated with the given URI. Creates a\n    new one if it does not yet exist.";
static PyObject *__pyx_f_5etree_Namespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ns_uri = 0;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_registry;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"ns_uri",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_ns_uri)) return 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":19 */
__pyx_1 = PyObject_IsTrue(__pyx_v_ns_uri); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 19; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":20 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_ns_uri); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":22 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = Py_None;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":23 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":24 */
  __pyx_2 = PyObject_GetItem(__pyx_v_5etree___NAMESPACE_REGISTRIES, __pyx_v_ns_utf); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 24; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":25 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; goto __pyx_L1;}
__pyx_1 = PyErr_ExceptionMatches(__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
  __Pyx_AddTraceback("etree.Namespace");
  __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 25; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":27 */
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_uri);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns_uri);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ClassNamespaceRegistry), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 27; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_INCREF(__pyx_3);
  Py_DECREF(__pyx_v_registry);
  __pyx_v_registry = __pyx_3;
  if (PyObject_SetItem(__pyx_v_5etree___NAMESPACE_REGISTRIES, __pyx_v_ns_utf, __pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 26; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":28 */
  Py_INCREF(__pyx_v_registry);
  __pyx_r = __pyx_v_registry;
  goto __pyx_L0;
  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_3);
__Pyx_AddTraceback("etree.Namespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_FunctionNamespace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_ns_uri = 0;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_registry;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"ns_uri",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_ns_uri)) return 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":34 */
__pyx_1 = PyObject_IsTrue(__pyx_v_ns_uri); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 34; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":35 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_ns_uri); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 35; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":37 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = Py_None;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":38 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":39 */
  __pyx_2 = PyObject_GetItem(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 39; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":40 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; goto __pyx_L1;}
__pyx_1 = PyErr_ExceptionMatches(__pyx_2);
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {
  __Pyx_AddTraceback("etree.FunctionNamespace");
  __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 40; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":42 */
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_uri);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns_uri);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__XPathFunctionNamespaceRegistry), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 42; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_INCREF(__pyx_3);
  Py_DECREF(__pyx_v_registry);
  __pyx_v_registry = __pyx_3;
  if (PyObject_SetItem(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_v_ns_utf, __pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 41; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":43 */
  Py_INCREF(__pyx_v_registry);
  __pyx_r = __pyx_v_registry;
  goto __pyx_L0;
  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_3);
__Pyx_AddTraceback("etree.FunctionNamespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

static int __pyx_f_5etree_18_NamespaceRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":53 */
Py_INCREF(__pyx_v_ns_uri);
Py_DECREF(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri);
((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri = __pyx_v_ns_uri;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":54 */
__pyx_1 = __pyx_v_ns_uri == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":55 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
  ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = Py_None;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":56 */
  ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":58 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_ns_uri); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 58; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
  ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":59 */
  ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_c_ns_uri_utf = _cstr(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_ns_uri_utf);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":60 */
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_entries);
((struct __pyx_obj_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("etree._NamespaceRegistry.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_ns_uri);
return __pyx_r;
}

static PyObject *__pyx_n__;


static PyObject *__pyx_f_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_18_NamespaceRegistry_update(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_class_dict_iterable = 0;
PyObject *__pyx_v_name;
PyObject *__pyx_v_item;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"class_dict_iterable",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_class_dict_iterable)) return 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":67 */
__pyx_1 = hasattr(__pyx_v_class_dict_iterable,__pyx_n_items);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":68 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_class_dict_iterable, __pyx_n_items); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 68; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 68; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":69 */
__pyx_2 = PyObject_GetIter(__pyx_v_class_dict_iterable); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
    break;
  }
  __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 69; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":70 */
  __pyx_1 = __pyx_v_name == Py_None;
  if (!__pyx_1) {
    __pyx_3 = PySequence_GetSlice(__pyx_v_name, 0, 1); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
    if (PyObject_Cmp(__pyx_3, __pyx_n__, &__pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 70; goto __pyx_L1;}
    __pyx_1 = __pyx_1 != 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  if (__pyx_1) {
    __pyx_1 = callable(__pyx_v_item);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":71 */
    if (PyObject_SetItem(__pyx_v_self, __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 71; 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_4);
__Pyx_AddTraceback("etree._NamespaceRegistry.update");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_18_NamespaceRegistry___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":74 */
__pyx_1 = __pyx_v_name != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":75 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":76 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__NamespaceRegistry *)((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->__pyx_vtab)->_get(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self),__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 76; 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("etree._NamespaceRegistry.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

static PyObject *__pyx_k311p;

static char (__pyx_k311[]) = "Name not registered.";

static PyObject *__pyx_f_5etree_18_NamespaceRegistry__get(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":80 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_entries,__pyx_v_name);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":81 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":82 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k311p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 82; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":83 */
__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("etree._NamespaceRegistry._get");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_name);
return __pyx_r;
}

static PyObject *__pyx_k312p;

static char (__pyx_k312[]) = "Name not registered.";

static PyObject *__pyx_f_5etree_18_NamespaceRegistry__getForString(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":87 */
__pyx_v_dict_result = PyDict_GetItemString(__pyx_v_self->_entries,__pyx_v_name);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":88 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":89 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k312p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 89; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":90 */
__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("etree._NamespaceRegistry._getForString");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":93 */
__pyx_1 = iter(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_entries); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 93; 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("etree._NamespaceRegistry.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":96 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_entries, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 96; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 96; 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("etree._NamespaceRegistry.items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_iteritems;

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":99 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_entries, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 99; 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("etree._NamespaceRegistry.iteritems");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":102 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_v_self)->_entries, __pyx_n_clear); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 102; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 102; 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("etree._NamespaceRegistry.clear");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k313p;

static char (__pyx_k313[]) = "Registered element classes must be subtypes of ElementBase";

static int __pyx_f_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
static int __pyx_f_5etree_23_ClassNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_name);
Py_INCREF(__pyx_v_item);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":107 */
__pyx_1 = (!PyType_Check(__pyx_v_item));
if (!__pyx_1) {
  __pyx_1 = (!issubclass(__pyx_v_item,((PyObject*)__pyx_ptype_5etree_ElementBase)));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":108 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_NamespaceRegistryError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 108; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k313p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 108; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":110 */
__pyx_1 = __pyx_v_name != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":111 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":112 */
if (PyObject_SetItem(((struct __pyx_obj_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries, __pyx_v_name, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 112; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k314p;

static char (__pyx_k314[]) = "Namespace(%r)";

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":115 */
__pyx_1 = PyNumber_Remainder(__pyx_k314p, ((struct __pyx_obj_5etree__ClassNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 115; 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("etree._ClassNamespaceRegistry.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k315p;
static PyObject *__pyx_k316p;

static char (__pyx_k315[]) = "Registered functions must be callable.";
static char (__pyx_k316[]) = "extensions must have non empty names";

static int __pyx_f_5etree_26_FunctionNamespaceRegistry___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_name, PyObject *__pyx_v_item); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":119 */
__pyx_1 = (!callable(__pyx_v_item));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":120 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_NamespaceRegistryError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 120; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k315p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 120; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":122 */
__pyx_1 = PyObject_IsTrue(__pyx_v_name); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 122; goto __pyx_L1;}
__pyx_3 = (!__pyx_1);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":123 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k316p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[5]; __pyx_lineno = 123; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":125 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 125; goto __pyx_L1;}
if (PyObject_SetItem(((struct __pyx_obj_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._entries, __pyx_2, __pyx_v_item) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 125; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k317p;

static char (__pyx_k317[]) = "FunctionNamespace(%r)";

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":128 */
__pyx_1 = PyNumber_Remainder(__pyx_k317p, ((struct __pyx_obj_5etree__FunctionNamespaceRegistry *)__pyx_v_self)->__pyx_base._ns_uri); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 128; 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("etree._FunctionNamespaceRegistry.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":136 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = Py_None;

__pyx_r = 0;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":138 */
Py_INCREF(((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
__pyx_r = ((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix;
goto __pyx_L0;

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

static PyObject *__pyx_k318p;

static char (__pyx_k318[]) = "";

static int __pyx_f_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix); /*proto*/
static int __pyx_f_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_prefix) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_prefix);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":140 */
__pyx_1 = __pyx_v_prefix == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":141 */
  Py_INCREF(__pyx_k318p);
  Py_DECREF(__pyx_v_prefix);
  __pyx_v_prefix = __pyx_k318p;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":142 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_prefix); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 142; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf);
((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":143 */
Py_INCREF(__pyx_v_prefix);
Py_DECREF(((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix);
((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_v_self)->_prefix = __pyx_v_prefix;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._XPathFunctionNamespaceRegistry.prefix.__set__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__find_all_extension_prefixes(void) {
struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *__pyx_v_registry;
PyObject *__pyx_v_ns_prefixes;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
__pyx_v_registry = ((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_ns_prefixes = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":148 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 148; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_prefixes);
__pyx_v_ns_prefixes = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":149 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__XPathFunctionNamespaceRegistry)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_registry));
  __pyx_v_registry = ((struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)__pyx_2);
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 149; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":150 */
  __pyx_4 = __pyx_v_registry->_prefix_utf != Py_None;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":151 */
    if (PyObject_SetItem(__pyx_v_ns_prefixes, __pyx_v_registry->_prefix_utf, __pyx_v_ns_utf) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 151; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":152 */
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_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._find_all_extension_prefixes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_registry);
Py_DECREF(__pyx_v_ns_prefixes);
Py_DECREF(__pyx_v_ns_utf);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__iter_extension_function_names(void) {
PyObject *__pyx_v_l;
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_registry;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
__pyx_v_l = Py_None; Py_INCREF(Py_None);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_registry = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":155 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 155; goto __pyx_L1;}
Py_DECREF(__pyx_v_l);
__pyx_v_l = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":156 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_DECREF(__pyx_v_registry);
  __pyx_v_registry = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 156; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":157 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 157; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_utf);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns_utf);
  Py_INCREF(__pyx_v_registry);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_registry);
  __pyx_4 = PyList_Append(__pyx_v_l,__pyx_2); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 157; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":158 */
Py_INCREF(__pyx_v_l);
__pyx_r = __pyx_v_l;
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("etree._iter_extension_function_names");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_l);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_registry);
return __pyx_r;
}

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":162 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES,__pyx_v_ns_uri_utf);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":164 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":165 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":166 */
__pyx_2 = (PyObject *)__pyx_v_dict_result;
Py_INCREF(__pyx_2);
Py_INCREF(((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_2)->_entries);
Py_DECREF(__pyx_v_extensions);
__pyx_v_extensions = ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_2)->_entries;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":167 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_extensions,__pyx_v_name_utf);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":168 */
__pyx_1 = (__pyx_v_dict_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":169 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":171 */
  __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;
}

static PyObject *__pyx_f_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_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_registry = ((struct __pyx_obj_5etree__NamespaceRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_classes = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":177 */
__pyx_1 = (__pyx_v_c_node->type != XML_ELEMENT_NODE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":178 */
  __pyx_1 = __pyx_v_state == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":179 */
    __pyx_2 = __pyx_f_5etree__lookupDefaultElementClass(Py_None,__pyx_v_doc,__pyx_v_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 179; goto __pyx_L1;}
    __pyx_r = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":180 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *)((struct LxmlFallbackElementClassLookup *)__pyx_v_state)->__pyx_vtab)->_callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 180; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":181 */
__pyx_v_c_namespace_utf = _getNs(__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":182 */
__pyx_1 = (__pyx_v_c_namespace_utf != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":183 */
  __pyx_v_dict_result = PyDict_GetItemString(__pyx_v_5etree___NAMESPACE_REGISTRIES,__pyx_v_c_namespace_utf);
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":186 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_5etree___NAMESPACE_REGISTRIES,Py_None);
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":188 */
__pyx_1 = (__pyx_v_dict_result != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":189 */
  __pyx_2 = (PyObject *)__pyx_v_dict_result;
  Py_INCREF(__pyx_2);
  Py_DECREF(((PyObject *)__pyx_v_registry));
  __pyx_v_registry = ((struct __pyx_obj_5etree__NamespaceRegistry *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":190 */
  Py_INCREF(__pyx_v_registry->_entries);
  Py_DECREF(__pyx_v_classes);
  __pyx_v_classes = __pyx_v_registry->_entries;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":192 */
  __pyx_1 = (__pyx_v_c_node->name != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":193 */
    __pyx_v_dict_result = PyDict_GetItemString(__pyx_v_classes,__pyx_v_c_node->name);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":196 */
    __pyx_v_dict_result = NULL;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":198 */
  __pyx_1 = (__pyx_v_dict_result == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":199 */
    __pyx_v_dict_result = PyDict_GetItem(__pyx_v_classes,Py_None);
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":201 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":202 */
    __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":204 */
__pyx_1 = __pyx_v_state == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":205 */
  __pyx_2 = __pyx_f_5etree__lookupDefaultElementClass(Py_None,__pyx_v_doc,__pyx_v_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 205; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":206 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *)((struct LxmlFallbackElementClassLookup *)__pyx_v_state)->__pyx_vtab)->_callFallback(((struct LxmlFallbackElementClassLookup *)__pyx_v_state),((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 206; 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("etree._find_nselement_class");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_classes);
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8Resolver_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_system_url, &__pyx_v_public_id, &__pyx_v_context)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_system_url);
Py_INCREF(__pyx_v_public_id);
Py_INCREF(__pyx_v_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":17 */
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;
}

static PyObject *__pyx_f_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8Resolver_resolve_empty[] = "Return an empty input document.";
static PyObject *__pyx_f_5etree_8Resolver_resolve_empty(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context = 0;
struct __pyx_obj_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"context",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_context)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":22 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__InputDocument), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 22; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 22; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":23 */
__pyx_v_doc_ref->_type = __pyx_e_5etree_PARSER_DATA_EMPTY;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":24 */
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("etree.Resolver.resolve_empty");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8Resolver_resolve_string[] = "Return a parsable string as input document.";
static PyObject *__pyx_f_5etree_8Resolver_resolve_string(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_string = 0;
PyObject *__pyx_v_context = 0;
struct __pyx_obj_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"string","context",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_string, &__pyx_v_context)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_string);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":29 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__InputDocument), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 29; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":30 */
__pyx_v_doc_ref->_type = __pyx_e_5etree_PARSER_DATA_STRING;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":31 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_string); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 31; goto __pyx_L1;}
Py_DECREF(__pyx_v_doc_ref->_data_bytes);
__pyx_v_doc_ref->_data_bytes = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":32 */
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("etree.Resolver.resolve_string");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_string);
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_8Resolver_resolve_filename(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8Resolver_resolve_filename[] = "Return the name of a parsable file as input document.";
static PyObject *__pyx_f_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_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"filename","context",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_filename, &__pyx_v_context)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filename);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":37 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__InputDocument), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 37; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 37; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":38 */
__pyx_v_doc_ref->_type = __pyx_e_5etree_PARSER_DATA_FILENAME;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":39 */
__pyx_1 = __pyx_f_5etree__encodeFilename(__pyx_v_filename); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 39; goto __pyx_L1;}
Py_DECREF(__pyx_v_doc_ref->_data_bytes);
__pyx_v_doc_ref->_data_bytes = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":40 */
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("etree.Resolver.resolve_filename");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_read;

static PyObject *__pyx_k320p;

static char (__pyx_k320[]) = "Argument is not a file-like object";

static PyObject *__pyx_f_5etree_8Resolver_resolve_file(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_8Resolver_resolve_file[] = "Return an open file-like object as input document.";
static PyObject *__pyx_f_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_5etree__InputDocument *__pyx_v_doc_ref;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"f","context",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_f, &__pyx_v_context)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_context);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":45 */
__pyx_1 = (!hasattr(__pyx_v_f,__pyx_n_read));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":46 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 46; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k320p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[6]; __pyx_lineno = 46; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":47 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__InputDocument), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 47; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 47; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc_ref));
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":48 */
__pyx_v_doc_ref->_type = __pyx_e_5etree_PARSER_DATA_FILE;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":49 */
Py_INCREF(__pyx_v_f);
Py_DECREF(__pyx_v_doc_ref->_file);
__pyx_v_doc_ref->_file = __pyx_v_f;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":50 */
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_2);
__Pyx_AddTraceback("etree.Resolver.resolve_file");
__pyx_r = 0;
__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;
}

static int __pyx_f_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_17_ResolverRegistry___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_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_k111;
if (!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 (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_default_resolver), __pyx_ptype_5etree_Resolver, 1, "default_resolver")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 55; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":56 */
__pyx_1 = PyObject_CallObject(__pyx_v_5etree_set, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 56; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers);
((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":57 */
Py_INCREF(((PyObject *)__pyx_v_default_resolver));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver));
((struct __pyx_obj_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("etree._ResolverRegistry.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_default_resolver);
return __pyx_r;
}

static PyObject *__pyx_n_add;

static PyObject *__pyx_f_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_17_ResolverRegistry_add(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5etree_Resolver *__pyx_v_resolver = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"resolver",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_resolver)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_resolver);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_resolver), __pyx_ptype_5etree_Resolver, 0, "resolver")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 59; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":68 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_n_add); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 68; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_resolver));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_resolver));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 68; 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("etree._ResolverRegistry.add");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_resolver);
return __pyx_r;
}

static PyObject *__pyx_n_discard;

static PyObject *__pyx_f_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_17_ResolverRegistry_remove(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_resolver = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"resolver",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_resolver)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_resolver);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":71 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers, __pyx_n_discard); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; 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 (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 71; 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("etree._ResolverRegistry.remove");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_resolver);
return __pyx_r;
}

static struct __pyx_obj_5etree__ResolverRegistry *__pyx_f_5etree_17_ResolverRegistry__copy(struct __pyx_obj_5etree__ResolverRegistry *__pyx_v_self) {
struct __pyx_obj_5etree__ResolverRegistry *__pyx_v_registry;
struct __pyx_obj_5etree__ResolverRegistry *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_registry = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":75 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; 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_5etree__ResolverRegistry), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 75; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_registry));
__pyx_v_registry = ((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":76 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self->_resolvers, __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 76; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_registry->_resolvers);
__pyx_v_registry->_resolvers = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":77 */
Py_INCREF(((PyObject *)__pyx_v_registry));
__pyx_r = __pyx_v_registry;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._ResolverRegistry._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_registry);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":80 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ResolverRegistry *)((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->__pyx_vtab)->_copy(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self))); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 80; 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("etree._ResolverRegistry.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_resolve;

static PyObject *__pyx_f_5etree_17_ResolverRegistry_resolve(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
static char *__pyx_argnames[] = {"system_url","public_id","context",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_system_url, &__pyx_v_public_id, &__pyx_v_context)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":83 */
__pyx_1 = PyObject_GetIter(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 83; goto __pyx_L1;}
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 83; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_resolver);
  __pyx_v_resolver = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":84 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_resolver, __pyx_n_resolve); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_INCREF(__pyx_v_system_url);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_system_url);
  Py_INCREF(__pyx_v_public_id);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_public_id);
  Py_INCREF(__pyx_v_context);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_context);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 84; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":85 */
  __pyx_5 = __pyx_v_result != Py_None;
  if (__pyx_5) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":86 */
    Py_INCREF(__pyx_v_result);
    __pyx_r = __pyx_v_result;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":87 */
__pyx_5 = ((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver == Py_None;
if (__pyx_5) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":88 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":89 */
__pyx_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_default_resolver), __pyx_n_resolve); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 89; goto __pyx_L1;}
__pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 89; goto __pyx_L1;}
Py_INCREF(__pyx_v_system_url);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_system_url);
Py_INCREF(__pyx_v_public_id);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_public_id);
Py_INCREF(__pyx_v_context);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_context);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 89; 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_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._ResolverRegistry.resolve");
__pyx_r = 0;
__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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":92 */
__pyx_1 = repr(((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_v_self)->_resolvers); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 92; 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("etree._ResolverRegistry.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_16_ResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_16_ResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5etree__ResolverRegistry *__pyx_v_resolvers = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"resolvers",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_resolvers)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_resolvers);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_resolvers), __pyx_ptype_5etree__ResolverRegistry, 0, "resolvers")) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 97; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":98 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ExceptionContext), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 98; 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 (!__pyx_3) {__pyx_filename = __pyx_f[6]; __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":99 */
Py_INCREF(((PyObject *)__pyx_v_resolvers));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_self)->_resolvers));
((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_self)->_resolvers = __pyx_v_resolvers;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":100 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__TempStore), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__TempStore)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 100; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_self)->_storage));
((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_self)->_storage = ((struct __pyx_obj_5etree__TempStore *)__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("etree._ResolverContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_resolvers);
return __pyx_r;
}

static void __pyx_f_5etree_16_ResolverContext_clear(struct __pyx_obj_5etree__ResolverContext *__pyx_v_self) {
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":103 */
__pyx_vtabptr_5etree__ExceptionContext->clear(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_self));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":104 */
((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_storage->__pyx_vtab)->clear(__pyx_v_self->_storage);

Py_DECREF((PyObject *)__pyx_v_self);
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":31 */
__pyx_1 = (((struct __pyx_obj_5etree__ParserContext *)__pyx_v_self)->_c_dict != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":32 */
  xmlDictFree(((struct __pyx_obj_5etree__ParserContext *)__pyx_v_self)->_c_dict);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n__ParserContext;


static void __pyx_f_5etree_14_ParserContext_initMainParserContext(struct __pyx_obj_5etree__ParserContext *__pyx_v_self) {
PyObject (*__pyx_v_thread_dict);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":39 */
__pyx_v_thread_dict = PyThreadState_GetDict();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":40 */
__pyx_1 = (__pyx_v_thread_dict != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":41 */
  __pyx_2 = (PyObject *)__pyx_v_thread_dict;
  Py_INCREF(__pyx_2);
  __pyx_1 = PyDict_SetItem(__pyx_2,__pyx_n__ParserContext,((PyObject *)__pyx_v_self)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 41; 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("etree._ParserContext.initMainParserContext");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
}


static struct __pyx_obj_5etree__ParserContext *__pyx_f_5etree_14_ParserContext__findThreadParserContext(struct __pyx_obj_5etree__ParserContext *__pyx_v_self) {
PyObject (*__pyx_v_thread_dict);
PyObject (*__pyx_v_result);
struct __pyx_obj_5etree__ParserContext *__pyx_v_context;
PyObject *__pyx_v_d;
struct __pyx_obj_5etree__ParserContext *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_d = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":48 */
__pyx_v_thread_dict = PyThreadState_GetDict();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":49 */
__pyx_1 = (__pyx_v_thread_dict == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":50 */
  Py_INCREF(((PyObject *)__pyx_v_self));
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":51 */
__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":52 */
__pyx_v_result = PyDict_GetItem(__pyx_v_d,__pyx_n__ParserContext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":53 */
__pyx_1 = (__pyx_v_result != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":54 */
  __pyx_2 = (PyObject *)__pyx_v_result;
  Py_INCREF(__pyx_2);
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 54; goto __pyx_L1;}
  __pyx_r = ((struct __pyx_obj_5etree__ParserContext *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":55 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ParserContext), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 55; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":56 */
__pyx_1 = PyDict_SetItem(__pyx_v_d,__pyx_n__ParserContext,((PyObject *)__pyx_v_context)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 56; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":57 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = __pyx_v_context;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._ParserContext._findThreadParserContext");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_14_ParserContext_setDefaultParser(struct __pyx_obj_5etree__ParserContext *__pyx_v_self,struct __pyx_obj_5etree__BaseParser *__pyx_v_parser) {
struct __pyx_obj_5etree__ParserContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_parser);
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":62 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 62; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":63 */
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("etree._ParserContext.setDefaultParser");
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_parser);
}

static struct __pyx_obj_5etree__BaseParser *__pyx_f_5etree_14_ParserContext_getDefaultParser(struct __pyx_obj_5etree__ParserContext *__pyx_v_self) {
struct __pyx_obj_5etree__ParserContext *__pyx_v_context;
struct __pyx_obj_5etree__BaseParser *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":68 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 68; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":69 */
__pyx_2 = __pyx_v_context->_default_parser == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":70 */
  __pyx_2 = __pyx_v_self->_default_parser == Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":71 */
    __pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree_XMLParser *)__pyx_v_5etree___DEFAULT_XML_PARSER->__pyx_base.__pyx_vtab)->__pyx_base._copy(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_5etree___DEFAULT_XML_PARSER))); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 71; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_self->_default_parser));
    __pyx_v_self->_default_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":72 */
  __pyx_2 = __pyx_v_context != __pyx_v_self;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":73 */
    __pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->_default_parser->__pyx_vtab)->_copy(__pyx_v_self->_default_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 73; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_context->_default_parser));
    __pyx_v_context->_default_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_1);
    __pyx_1 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":74 */
Py_INCREF(((PyObject *)__pyx_v_context->_default_parser));
__pyx_r = __pyx_v_context->_default_parser;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("etree._ParserContext.getDefaultParser");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static xmlDict (*__pyx_f_5etree_14_ParserContext__getThreadDict(struct __pyx_obj_5etree__ParserContext *__pyx_v_self,xmlDict (*__pyx_v_default))) {
struct __pyx_obj_5etree__ParserContext *__pyx_v_context;
xmlDict (*__pyx_r);
PyObject *__pyx_1 = 0;
int __pyx_2;
Py_INCREF(__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":79 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->_findThreadParserContext(__pyx_v_self)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 79; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__ParserContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":80 */
__pyx_2 = (__pyx_v_context->_c_dict == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":82 */
  __pyx_2 = (__pyx_v_default != NULL);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":83 */
    __pyx_v_context->_c_dict = __pyx_v_default;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":84 */
    xmlDictReference(__pyx_v_default);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":85 */
    __pyx_r = __pyx_v_default;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":86 */
  __pyx_2 = (__pyx_v_self->_c_dict == NULL);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":87 */
    __pyx_v_self->_c_dict = xmlDictCreate();
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":88 */
  __pyx_2 = __pyx_v_context != __pyx_v_self;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":89 */
    __pyx_v_context->_c_dict = xmlDictCreateSub(__pyx_v_self->_c_dict);
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":90 */
__pyx_r = __pyx_v_context->_c_dict;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("etree._ParserContext._getThreadDict");
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_14_ParserContext_initThreadDictRef(struct __pyx_obj_5etree__ParserContext *__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":95 */
__pyx_v_c_dict = (__pyx_v_c_dict_ref[0]);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":96 */
__pyx_v_c_thread_dict = ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->_getThreadDict(__pyx_v_self,__pyx_v_c_dict);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":97 */
__pyx_1 = (__pyx_v_c_dict == __pyx_v_c_thread_dict);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":98 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":99 */
__pyx_1 = (__pyx_v_c_dict != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":100 */
  xmlDictFree(__pyx_v_c_dict);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":101 */
(__pyx_v_c_dict_ref[0]) = __pyx_v_c_thread_dict;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":102 */
xmlDictReference(__pyx_v_c_thread_dict);

__pyx_L0:;
Py_DECREF(__pyx_v_self);
}

static void __pyx_f_5etree_14_ParserContext_initParserDict(struct __pyx_obj_5etree__ParserContext *__pyx_v_self,xmlParserCtxt (*__pyx_v_pctxt)) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":106 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_pctxt->dict));

Py_DECREF(__pyx_v_self);
}

static void __pyx_f_5etree_14_ParserContext_initXPathParserDict(struct __pyx_obj_5etree__ParserContext *__pyx_v_self,xmlXPathContext (*__pyx_v_pctxt)) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":110 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_pctxt->dict));

Py_DECREF(__pyx_v_self);
}

static void __pyx_f_5etree_14_ParserContext_initDocDict(struct __pyx_obj_5etree__ParserContext *__pyx_v_self,xmlDoc (*__pyx_v_result)) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":117 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_self->__pyx_vtab)->initThreadDictRef(__pyx_v_self,(&__pyx_v_result->dict));

Py_DECREF(__pyx_v_self);
}

static int __pyx_f_5etree__checkThreadDict(xmlDict (*__pyx_v_c_dict)) {
int __pyx_r;
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":127 */
__pyx_1 = (__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->_c_dict == __pyx_v_c_dict);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":128 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":129 */
__pyx_1 = (((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->_getThreadDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,NULL) == __pyx_v_c_dict);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":130 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":131 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static char (__pyx_k324[]) = "<test/>";
static char (__pyx_k325[]) = "strict";

static void __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":151 */
__pyx_1 = PyUnicode_DecodeUTF8(__pyx_k324,7,__pyx_k325); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_v_utext);
__pyx_v_utext = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":152 */
__pyx_v_l = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":153 */
__pyx_v_buffer = PyUnicode_AS_DATA(__pyx_v_utext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":154 */
__pyx_v_enc = __pyx_f_5etree__findEncodingName(__pyx_v_buffer,__pyx_v_l);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":155 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_enc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":156 */
__pyx_2 = (__pyx_v_enchandler != NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":158 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":159 */
  __pyx_v_5etree__UNICODE_ENCODING = __pyx_v_enc;
  goto __pyx_L2;
}
__pyx_L2:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("etree._setupPythonUnicode");
__pyx_L0:;
Py_DECREF(__pyx_v_utext);
}

static char (__pyx_k326[]) = "UTF16LE";
static char (__pyx_k327[]) = "UTF16BE";
static char (__pyx_k328[]) = "UCS-4LE";
static char (__pyx_k329[]) = "UCS-4BE";

static char (*__pyx_f_5etree__findEncodingName(char (*__pyx_v_buffer),int __pyx_v_size)) {
xmlCharEncoding __pyx_v_enc;
char (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":164 */
__pyx_v_enc = xmlDetectCharEncoding(__pyx_v_buffer,__pyx_v_size);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":165 */
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16LE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":166 */
  __pyx_r = __pyx_k326;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UTF16BE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":168 */
  __pyx_r = __pyx_k327;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4LE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":170 */
  __pyx_r = __pyx_k328;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_enc == XML_CHAR_ENCODING_UCS4BE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":172 */
  __pyx_r = __pyx_k329;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":174 */
  __pyx_r = xmlGetCharEncodingName(__pyx_v_enc);
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k330p;

static char (__pyx_k330[]) = "";

static int __pyx_f_5etree_18_FileParserContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_18_FileParserContext___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;
int __pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"filelike","exc_context","url",0};
__pyx_v_url = __pyx_k114;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_filelike, &__pyx_v_exc_context, &__pyx_v_url)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filelike);
Py_INCREF(__pyx_v_exc_context);
Py_INCREF(__pyx_v_url);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":190 */
if (!__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 190; goto __pyx_L1;}
Py_INCREF(__pyx_v_exc_context);
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_exc_context));
((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_exc_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":191 */
Py_INCREF(__pyx_v_filelike);
Py_DECREF(((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_filelike);
((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_filelike = __pyx_v_filelike;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":192 */
Py_INCREF(__pyx_v_url);
Py_DECREF(((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_url);
((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_url = __pyx_v_url;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":193 */
__pyx_1 = __pyx_v_url == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":194 */
  ((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_c_url = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":196 */
  ((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_c_url = _cstr(__pyx_v_url);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":197 */
Py_INCREF(__pyx_k330p);
Py_DECREF(((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_bytes);
((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_bytes = __pyx_k330p;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":198 */
((struct __pyx_obj_5etree__FileParserContext *)__pyx_v_self)->_bytes_read = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._FileParserContext.__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);
return __pyx_r;
}

static xmlParserInput (*__pyx_f_5etree_18_FileParserContext__createParserInput(struct __pyx_obj_5etree__FileParserContext *__pyx_v_self,xmlParserCtxt (*__pyx_v_ctxt))) {
xmlParserInputBuffer (*__pyx_v_c_buffer);
xmlParserInput (*__pyx_r);
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":202 */
__pyx_v_c_buffer = xmlAllocParserInputBuffer(0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":203 */
__pyx_v_c_buffer->context = ((PyObject (*))__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":204 */
__pyx_v_c_buffer->readcallback = __pyx_f_5etree__readFilelikeParser;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":205 */
__pyx_r = xmlNewIOInputStream(__pyx_v_ctxt,__pyx_v_c_buffer,0);
goto __pyx_L0;

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

static xmlDoc (*__pyx_f_5etree_18_FileParserContext__readDoc(struct __pyx_obj_5etree__FileParserContext *__pyx_v_self,xmlParserCtxt (*__pyx_v_ctxt),int __pyx_v_options,__pyx_t_5etree_LxmlParserType __pyx_v_parser_type)) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlDoc (*__pyx_r);
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":211 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":212 */
__pyx_1 = (__pyx_v_parser_type == __pyx_e_5etree_LXML_XML_PARSER);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":213 */
  __pyx_v_result = xmlCtxtReadIO(__pyx_v_ctxt,__pyx_f_5etree__readFilelikeParser,NULL,((PyObject (*))__pyx_v_self),__pyx_v_self->_c_url,NULL,__pyx_v_options);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":217 */
  __pyx_v_result = htmlCtxtReadIO(__pyx_v_ctxt,__pyx_f_5etree__readFilelikeParser,NULL,((PyObject (*))__pyx_v_self),__pyx_v_self->_c_url,NULL,__pyx_v_options);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":220 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":221 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

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

static PyObject *__pyx_k331p;

static char (__pyx_k331[]) = "reading file objects must return plain strings";

static int __pyx_f_5etree_18_FileParserContext_copyToBuffer(struct __pyx_obj_5etree__FileParserContext *__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;
PyGILState_STATE __pyx_v_gil_state;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":227 */
__pyx_1 = (__pyx_v_self->_bytes_read < 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":228 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":229 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":230 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":231 */
  __pyx_v_byte_count = PyString_GET_SIZE(__pyx_v_self->_bytes);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":232 */
  __pyx_v_remaining = (__pyx_v_byte_count - __pyx_v_self->_bytes_read);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":233 */
  __pyx_1 = (__pyx_v_remaining <= 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":234 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_n_read); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L3;}
    __pyx_3 = PyInt_FromLong(__pyx_v_c_size); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L3;}
    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L3;}
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
    __pyx_3 = 0;
    __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 234; goto __pyx_L3;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_self->_bytes);
    __pyx_v_self->_bytes = __pyx_3;
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":235 */
    __pyx_1 = (!PyString_Check(__pyx_v_self->_bytes));
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":236 */
      __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 236; goto __pyx_L3;}
      __Pyx_Raise(__pyx_2, __pyx_k331p, 0);
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      {__pyx_filename = __pyx_f[7]; __pyx_lineno = 236; goto __pyx_L3;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":237 */
    __pyx_v_remaining = PyString_GET_SIZE(__pyx_v_self->_bytes);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":238 */
    __pyx_v_self->_bytes_read = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":239 */
    __pyx_1 = (__pyx_v_remaining == 0);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":240 */
      __pyx_v_self->_bytes_read = (-1);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":241 */
      PyGILState_Release(__pyx_v_gil_state);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":242 */
      __pyx_r = 0;
      goto __pyx_L0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":243 */
  __pyx_1 = (__pyx_v_c_size > __pyx_v_remaining);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":244 */
    __pyx_v_c_size = __pyx_v_remaining;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":245 */
  __pyx_v_c_start = (_cstr(__pyx_v_self->_bytes) + __pyx_v_self->_bytes_read);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":246 */
  PyGILState_Release(__pyx_v_gil_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":247 */
  __pyx_v_self->_bytes_read = (__pyx_v_self->_bytes_read + __pyx_v_c_size);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":248 */
  memcpy(__pyx_v_c_buffer,__pyx_v_c_start,__pyx_v_c_size);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":249 */
  __pyx_r = __pyx_v_c_size;
  goto __pyx_L0;
}
goto __pyx_L4;
__pyx_L3:;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":250 */
/*except:*/ {
  __Pyx_AddTraceback("etree.copyToBuffer");
  __pyx_4 = __Pyx_GetExcValue(); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 250; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":251 */
  ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":252 */
  PyGILState_Release(__pyx_v_gil_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":253 */
  __pyx_r = (-1);
  goto __pyx_L0;
  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("etree._FileParserContext.copyToBuffer");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree__readFilelikeParser(void (*__pyx_v_ctxt),char (*__pyx_v_c_buffer),int __pyx_v_c_size) {
int __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":256 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_vtabstruct_5etree__FileParserContext *)((struct __pyx_obj_5etree__FileParserContext *)__pyx_1)->__pyx_vtab)->copyToBuffer(((struct __pyx_obj_5etree__FileParserContext *)__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:;
return __pyx_r;
}

static xmlParserInput (*__pyx_f_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_5etree__ResolverContext *__pyx_v_context;
struct __pyx_obj_5etree__InputDocument *__pyx_v_doc_ref;
struct __pyx_obj_5etree__FileParserContext *__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;
__pyx_v_context = ((struct __pyx_obj_5etree__ResolverContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_file_context = ((struct __pyx_obj_5etree__FileParserContext *)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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":269 */
(__pyx_v_error[0]) = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":270 */
__pyx_1 = (PyObject *)__pyx_v_c_context->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__ResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":271 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":272 */
  __pyx_2 = (__pyx_v_c_url == NULL);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":273 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = Py_None;
    goto __pyx_L4;
  }
  __pyx_2 = (__pyx_v_c_context->myDoc == NULL);
  if (!__pyx_2) {
    __pyx_2 = (__pyx_v_c_context->myDoc->URL == NULL);
  }
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":276 */
    __pyx_1 = PyString_FromString(__pyx_v_c_url); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 276; goto __pyx_L2;}
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":279 */
    __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_url); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 279; goto __pyx_L2;}
    Py_DECREF(__pyx_v_url);
    __pyx_v_url = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":280 */
  __pyx_2 = (__pyx_v_c_pubid == NULL);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":281 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_pubid);
    __pyx_v_pubid = Py_None;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":283 */
    __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_pubid); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 283; goto __pyx_L2;}
    Py_DECREF(__pyx_v_pubid);
    __pyx_v_pubid = __pyx_1;
    __pyx_1 = 0;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":285 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context->_resolvers), __pyx_n_resolve); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; goto __pyx_L2;}
  __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; 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 (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; goto __pyx_L2;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 285; goto __pyx_L2;}
  Py_DECREF(((PyObject *)__pyx_v_doc_ref));
  __pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":286 */
  __pyx_2 = __pyx_v_doc_ref == Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":287 */
    __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":288 */
/*except:*/ {
  __Pyx_AddTraceback("etree._parser_resolve_from_python");
  __pyx_1 = __Pyx_GetExcValue(); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 288; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":289 */
  ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->__pyx_base._store_raised(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":290 */
  (__pyx_v_error[0]) = 1;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":291 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":293 */
__pyx_v_c_input = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":294 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_data);
__pyx_v_data = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":295 */
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_STRING);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":296 */
  Py_INCREF(__pyx_v_doc_ref->_data_bytes);
  Py_DECREF(__pyx_v_data);
  __pyx_v_data = __pyx_v_doc_ref->_data_bytes;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":297 */
  __pyx_v_c_input = xmlNewStringInputStream(__pyx_v_c_context,_cstr(__pyx_v_data));
  goto __pyx_L7;
}
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_FILENAME);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":300 */
  __pyx_v_c_input = xmlNewInputFromFile(__pyx_v_c_context,_cstr(__pyx_v_doc_ref->_data_bytes));
  goto __pyx_L7;
}
__pyx_2 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_FILE);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":303 */
  __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; goto __pyx_L1;}
  Py_INCREF(__pyx_v_doc_ref->_file);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_doc_ref->_file);
  Py_INCREF(((PyObject *)__pyx_v_context));
  PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_context));
  Py_INCREF(__pyx_v_url);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_url);
  __pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__FileParserContext), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__FileParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 303; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_file_context));
  __pyx_v_file_context = ((struct __pyx_obj_5etree__FileParserContext *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":304 */
  __pyx_v_c_input = ((struct __pyx_vtabstruct_5etree__FileParserContext *)__pyx_v_file_context->__pyx_vtab)->_createParserInput(__pyx_v_file_context,__pyx_v_c_context);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":305 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":307 */
__pyx_2 = __pyx_v_data != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":308 */
  ((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_context->_storage->__pyx_vtab)->add(__pyx_v_context->_storage,__pyx_v_data);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":309 */
__pyx_r = __pyx_v_c_input;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("etree._parser_resolve_from_python");
__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);
return __pyx_r;
}

static xmlParserInput (*__pyx_f_5etree__local_resolver(char (*__pyx_v_c_url),char (*__pyx_v_c_pubid),xmlParserCtxt (*__pyx_v_c_context))) {
xmlParserInput (*__pyx_v_c_input);
PyGILState_STATE __pyx_v_gil_state;
int __pyx_v_error;
xmlParserInput (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":318 */
__pyx_1 = (__pyx_v_c_context->_private == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":319 */
  __pyx_1 = (__pyx_v_5etree___DEFAULT_ENTITY_LOADER == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":320 */
    __pyx_r = NULL;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":321 */
  __pyx_r = __pyx_v_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":323 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":324 */
__pyx_v_c_input = __pyx_f_5etree__parser_resolve_from_python(__pyx_v_c_url,__pyx_v_c_pubid,__pyx_v_c_context,(&__pyx_v_error));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":325 */
PyGILState_Release(__pyx_v_gil_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":327 */
__pyx_1 = (__pyx_v_c_input != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":328 */
  __pyx_r = __pyx_v_c_input;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":329 */
__pyx_1 = __pyx_v_error;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":330 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":331 */
__pyx_1 = (__pyx_v_5etree___DEFAULT_ENTITY_LOADER == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":332 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":333 */
__pyx_r = __pyx_v_5etree___DEFAULT_ENTITY_LOADER(__pyx_v_c_url,__pyx_v_c_pubid,__pyx_v_c_context);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k333p;
static PyObject *__pyx_k334p;

static char (__pyx_k332[]) = "dummy";
static char (__pyx_k333[]) = "This class cannot be instantiated";
static char (__pyx_k334[]) = "Failed to create parser context";

static int __pyx_f_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_11_BaseParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_context_class = 0;
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"context_class",0};
__pyx_v_context_class = __pyx_k115;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_context_class)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_context_class);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":356 */
__pyx_1 = isinstance(__pyx_v_self,((PyObject*)__pyx_ptype_5etree_HTMLParser));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":357 */
  ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_type = __pyx_e_5etree_LXML_HTML_PARSER;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":358 */
  __pyx_v_pctxt = htmlCreateMemoryParserCtxt(__pyx_k332,5);
  goto __pyx_L2;
}
__pyx_1 = isinstance(__pyx_v_self,((PyObject*)__pyx_ptype_5etree_XMLParser));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":360 */
  ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_type = __pyx_e_5etree_LXML_XML_PARSER;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":361 */
  __pyx_v_pctxt = xmlNewParserCtxt();
  goto __pyx_L2;
}
__pyx_1 = isinstance(__pyx_v_self,((PyObject*)__pyx_ptype_5etree_iterparse));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":363 */
  ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_type = __pyx_e_5etree_LXML_ITERPARSE_PARSER;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":364 */
  __pyx_v_pctxt = xmlNewParserCtxt();
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":366 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k333p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 366; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":367 */
((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_ctxt = __pyx_v_pctxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":368 */
__pyx_1 = (__pyx_v_pctxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":369 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 369; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k334p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 369; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":370 */
__pyx_1 = (__pyx_v_pctxt->sax != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":372 */
  __pyx_v_pctxt->sax->cdataBlock = NULL;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":373 */
__pyx_1 = (!ENABLE_THREADING);
if (!__pyx_1) {
  __pyx_1 = (((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_type == __pyx_e_5etree_LXML_ITERPARSE_PARSER);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":376 */
  ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_lock = NULL;
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":378 */
  ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_lock = PyThread_allocate_lock();
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":379 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ErrorLog), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ErrorLog)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 379; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_error_log));
((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":380 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ResolverRegistry), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 380; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ResolverRegistry)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 380; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->resolvers));
((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":381 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 381; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->resolvers));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->resolvers));
__pyx_3 = PyObject_CallObject(__pyx_v_context_class, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 381; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__ResolverContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 381; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_context));
((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_context = ((struct __pyx_obj_5etree__ResolverContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":382 */
__pyx_v_pctxt->_private = ((PyObject (*))((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_context);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._BaseParser.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_context_class);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":385 */
__pyx_1 = (((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_ctxt != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":386 */
  xmlFreeParserCtxt(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_ctxt);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":387 */
__pyx_1 = (((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_lock != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":388 */
  PyThread_free_lock(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_parser_lock);
  goto __pyx_L3;
}
__pyx_L3:;

Py_DECREF(__pyx_v_self);
}

static void __pyx_f_5etree_11_BaseParser__cleanup(struct __pyx_obj_5etree__BaseParser *__pyx_v_self) {
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":392 */
__pyx_v_pctxt = __pyx_v_self->_parser_ctxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":393 */
__pyx_1 = (__pyx_v_pctxt != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":394 */
  __pyx_1 = (__pyx_v_pctxt->spaceTab != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":395 */
    xmlClearParserCtxt(__pyx_v_pctxt);
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k335p;

static char (__pyx_k335[]) = "parser locking failed";

static int __pyx_f_5etree_11_BaseParser__lockParser(struct __pyx_obj_5etree__BaseParser *__pyx_v_self) {
PyThreadState (*__pyx_v_state);
int __pyx_v_result;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":400 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {
  __pyx_1 = (__pyx_v_self->_parser_lock != NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":401 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":402 */
  __pyx_v_result = PyThread_acquire_lock(__pyx_v_self->_parser_lock,WAIT_LOCK);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":403 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":404 */
  __pyx_1 = (__pyx_v_result == 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":405 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 405; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k335p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 405; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":406 */
__pyx_r = 0;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._BaseParser._lockParser");
__pyx_r = 1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_11_BaseParser__unlockParser(struct __pyx_obj_5etree__BaseParser *__pyx_v_self) {
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":409 */
__pyx_1 = ENABLE_THREADING;
if (__pyx_1) {
  __pyx_1 = (__pyx_v_self->_parser_lock != NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":410 */
  PyThread_release_lock(__pyx_v_self->_parser_lock);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":414 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_error_log), __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 414; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 414; 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("etree._BaseParser.error_log.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_11_BaseParser___dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_11_BaseParser___dummy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":417 */

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

static PyObject *__pyx_f_5etree_11_BaseParser_setElementClassLookup(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_11_BaseParser_setElementClassLookup[] = "Set a lookup scheme for element classes generated from this parser.\n\n        Reset it by passing None or nothing.\n        ";
static PyObject *__pyx_f_5etree_11_BaseParser_setElementClassLookup(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_k116;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_lookup)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_lookup);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_lookup), __pyx_ptype_5etree_ElementClassLookup, 1, "lookup")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 419; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":424 */
Py_INCREF(((PyObject *)__pyx_v_lookup));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->_class_lookup));
((struct __pyx_obj_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("etree._BaseParser.setElementClassLookup");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_lookup);
return __pyx_r;
}

static PyObject *__pyx_n___class__;

static struct __pyx_obj_5etree__BaseParser *__pyx_f_5etree_11_BaseParser__copy(struct __pyx_obj_5etree__BaseParser *__pyx_v_self) {
struct __pyx_obj_5etree__BaseParser *__pyx_v_parser;
struct __pyx_obj_5etree__BaseParser *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":429 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n___class__); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 429; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 429; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 429; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_parser));
__pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":430 */
__pyx_v_parser->_parse_options = __pyx_v_self->_parse_options;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":431 */
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":432 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ResolverRegistry *)__pyx_v_self->resolvers->__pyx_vtab)->_copy(__pyx_v_self->resolvers)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 432; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_parser->resolvers));
__pyx_v_parser->resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":433 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_parser->resolvers));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_parser->resolvers));
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ResolverContext), __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__ResolverContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 433; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_parser->_context));
__pyx_v_parser->_context = ((struct __pyx_obj_5etree__ResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":434 */
__pyx_v_parser->_parser_ctxt->_private = ((PyObject (*))__pyx_v_parser->_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":435 */
Py_INCREF(((PyObject *)__pyx_v_parser));
__pyx_r = __pyx_v_parser;
goto __pyx_L0;

__pyx_r = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._BaseParser._copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_11_BaseParser_copy[] = "Create a new parser with the same configuration.";
static PyObject *__pyx_f_5etree_11_BaseParser_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":439 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__BaseParser *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)->__pyx_vtab)->_copy(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self))); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 439; 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("etree._BaseParser.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_11_BaseParser_makeelement(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_11_BaseParser_makeelement[] = "Creates a new element associated with this parser.\n        ";
static PyObject *__pyx_f_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_k117;
__pyx_v_nsmap = __pyx_k118;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 3, 0, &__pyx_v__extra) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__tag);
Py_INCREF(__pyx_v_attrib);
Py_INCREF(__pyx_v_nsmap);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":444 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__makeElement(__pyx_v__tag,NULL,((struct LxmlDocument *)Py_None),((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self),Py_None,Py_None,__pyx_v_attrib,__pyx_v_nsmap,__pyx_v__extra)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 444; 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("etree._BaseParser.makeelement");
__pyx_r = 0;
__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;
}

static xmlDoc (*__pyx_f_5etree_11_BaseParser__parseUnicodeDoc(struct __pyx_obj_5etree__BaseParser *__pyx_v_self,PyObject *__pyx_v_utext,char (*__pyx_v_c_filename))) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_v_recover;
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);
xmlDoc (*__pyx_4);
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_utext);
__pyx_v_text_utf = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":457 */
__pyx_v_py_buffer_len = PyUnicode_GET_DATA_SIZE(__pyx_v_utext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":458 */
__pyx_1 = (__pyx_v_py_buffer_len > INT_MAX);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":459 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_utext); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 459; goto __pyx_L1;}
  Py_DECREF(__pyx_v_text_utf);
  __pyx_v_text_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":460 */
  __pyx_v_py_buffer_len = PyString_GET_SIZE(__pyx_v_text_utf);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":461 */
  __pyx_3 = ((struct __pyx_vtabstruct_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 (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 461; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":462 */
__pyx_v_buffer_len = __pyx_v_py_buffer_len;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":464 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_lockParser(__pyx_v_self); if (__pyx_1 == 1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 464; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":465 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":466 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":467 */
  __pyx_v_pctxt = __pyx_v_self->_parser_ctxt;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":468 */
  ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":470 */
  __pyx_v_c_text = PyUnicode_AS_DATA(__pyx_v_utext);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":471 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":472 */
  __pyx_1 = (__pyx_v_self->_parser_type == __pyx_e_5etree_LXML_HTML_PARSER);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":473 */
    __pyx_v_result = htmlCtxtReadMemory(__pyx_v_pctxt,__pyx_v_c_text,__pyx_v_buffer_len,__pyx_v_c_filename,__pyx_v_5etree__UNICODE_ENCODING,__pyx_v_self->_parse_options);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":477 */
    __pyx_v_result = xmlCtxtReadMemory(__pyx_v_pctxt,__pyx_v_c_text,__pyx_v_buffer_len,__pyx_v_c_filename,__pyx_v_5etree__UNICODE_ENCODING,__pyx_v_self->_parse_options);
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":480 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":482 */
  __pyx_v_recover = (__pyx_v_self->_parse_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":483 */
  __pyx_4 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_result,Py_None,__pyx_v_recover); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 483; goto __pyx_L4;}
  __pyx_r = __pyx_4;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  __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_2, &__pyx_5, &__pyx_6);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":485 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":486 */
  ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_self->_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":487 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":488 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_unlockParser(__pyx_v_self);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_5, __pyx_6);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_5 = 0;
      __pyx_6 = 0;
      goto __pyx_L1;
    }
  }
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("etree._BaseParser._parseUnicodeDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_text_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_utext);
return __pyx_r;
}

static PyObject *__pyx_k336p;

static char (__pyx_k336[]) = "string is too long to parse it with libxml2";

static xmlDoc (*__pyx_f_5etree_11_BaseParser__parseDoc(struct __pyx_obj_5etree__BaseParser *__pyx_v_self,char (*__pyx_v_c_text),Py_ssize_t __pyx_v_c_len,char (*__pyx_v_c_filename))) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_v_recover;
xmlDoc (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc (*__pyx_3);
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":498 */
__pyx_1 = (__pyx_v_c_len > INT_MAX);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":499 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ParserError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 499; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k336p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 499; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":500 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_lockParser(__pyx_v_self); if (__pyx_1 == 1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 500; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":501 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":502 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":503 */
  __pyx_v_pctxt = __pyx_v_self->_parser_ctxt;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":504 */
  ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":506 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":507 */
  __pyx_1 = (__pyx_v_self->_parser_type == __pyx_e_5etree_LXML_HTML_PARSER);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":508 */
    __pyx_v_result = htmlCtxtReadMemory(__pyx_v_pctxt,__pyx_v_c_text,__pyx_v_c_len,__pyx_v_c_filename,NULL,__pyx_v_self->_parse_options);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":511 */
    __pyx_v_result = xmlCtxtReadMemory(__pyx_v_pctxt,__pyx_v_c_text,__pyx_v_c_len,__pyx_v_c_filename,NULL,__pyx_v_self->_parse_options);
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":513 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":515 */
  __pyx_v_recover = (__pyx_v_self->_parse_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":516 */
  __pyx_3 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_result,Py_None,__pyx_v_recover); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 516; goto __pyx_L4;}
  __pyx_r = __pyx_3;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  __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_2, &__pyx_4, &__pyx_5);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":518 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":519 */
  ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_self->_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":520 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":521 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_unlockParser(__pyx_v_self);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_4, __pyx_5);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_4 = 0;
      __pyx_5 = 0;
      goto __pyx_L1;
    }
  }
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._BaseParser._parseDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree_11_BaseParser__parseDocFromFile(struct __pyx_obj_5etree__BaseParser *__pyx_v_self,char (*__pyx_v_c_filename))) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_v_recover;
xmlDoc (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc (*__pyx_3);
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":528 */
__pyx_v_result = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":529 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_lockParser(__pyx_v_self); if (__pyx_1 == 1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 529; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":530 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":531 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":532 */
  __pyx_v_pctxt = __pyx_v_self->_parser_ctxt;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":533 */
  ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":535 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":536 */
  __pyx_1 = (__pyx_v_self->_parser_type == __pyx_e_5etree_LXML_HTML_PARSER);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":537 */
    __pyx_v_result = htmlCtxtReadFile(__pyx_v_pctxt,__pyx_v_c_filename,NULL,__pyx_v_self->_parse_options);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":540 */
    __pyx_v_result = xmlCtxtReadFile(__pyx_v_pctxt,__pyx_v_c_filename,NULL,__pyx_v_self->_parse_options);
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":542 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":544 */
  __pyx_v_recover = (__pyx_v_self->_parse_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":545 */
  __pyx_2 = PyString_FromString(__pyx_v_c_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 545; goto __pyx_L3;}
  __pyx_3 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_result,__pyx_2,__pyx_v_recover); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 545; goto __pyx_L3;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_r = __pyx_3;
  goto __pyx_L2;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L2: __pyx_why = 3; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_2, &__pyx_4, &__pyx_5);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":547 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":548 */
  ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_self->_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":549 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":550 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_unlockParser(__pyx_v_self);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_4, __pyx_5);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_4 = 0;
      __pyx_5 = 0;
      goto __pyx_L1;
    }
  }
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._BaseParser._parseDocFromFile");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree_11_BaseParser__parseDocFromFilelike(struct __pyx_obj_5etree__BaseParser *__pyx_v_self,PyObject *__pyx_v_filelike,PyObject *__pyx_v_filename)) {
struct __pyx_obj_5etree__FileParserContext *__pyx_v_file_context;
xmlDoc (*__pyx_v_result);
xmlParserCtxt (*__pyx_v_pctxt);
int __pyx_v_recover;
xmlDoc (*__pyx_r);
int __pyx_1;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
xmlDoc (*__pyx_5);
PyObject *__pyx_6 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_filelike);
Py_INCREF(__pyx_v_filename);
__pyx_v_file_context = ((struct __pyx_obj_5etree__FileParserContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":558 */
__pyx_1 = PyObject_IsTrue(__pyx_v_filename); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 558; goto __pyx_L1;}
__pyx_2 = (!__pyx_1);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":559 */
  Py_INCREF(Py_None);
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = Py_None;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":560 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_lockParser(__pyx_v_self); if (__pyx_1 == 1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 560; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":561 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_self->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":562 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":563 */
  __pyx_v_pctxt = __pyx_v_self->_parser_ctxt;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":564 */
  ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":565 */
  __pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 565; goto __pyx_L4;}
  Py_INCREF(__pyx_v_filelike);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_filelike);
  Py_INCREF(((PyObject *)__pyx_v_self->_context));
  PyTuple_SET_ITEM(__pyx_3, 1, ((PyObject *)__pyx_v_self->_context));
  Py_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_filename);
  __pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__FileParserContext), __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 565; goto __pyx_L4;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__FileParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 565; goto __pyx_L4;}
  Py_DECREF(((PyObject *)__pyx_v_file_context));
  __pyx_v_file_context = ((struct __pyx_obj_5etree__FileParserContext *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":566 */
  __pyx_v_result = ((struct __pyx_vtabstruct_5etree__FileParserContext *)__pyx_v_file_context->__pyx_vtab)->_readDoc(__pyx_v_file_context,__pyx_v_pctxt,__pyx_v_self->_parse_options,__pyx_v_self->_parser_type);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":569 */
  __pyx_v_recover = (__pyx_v_self->_parse_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":570 */
  __pyx_5 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_result,__pyx_v_filename,__pyx_v_recover); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 570; goto __pyx_L4;}
  __pyx_r = __pyx_5;
  goto __pyx_L3;
}
/*finally:*/ {
  int __pyx_why;
  __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_4); __pyx_4 = 0;
    PyErr_Fetch(&__pyx_3, &__pyx_4, &__pyx_6);
    __pyx_2 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":572 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_cleanup(__pyx_v_self);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":573 */
  ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base.clear(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_self->_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":574 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_self->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_self->_error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":575 */
  ((struct __pyx_vtabstruct_5etree__BaseParser *)__pyx_v_self->__pyx_vtab)->_unlockParser(__pyx_v_self);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_3, __pyx_4, __pyx_6);
      __pyx_lineno = __pyx_2;
      __pyx_3 = 0;
      __pyx_4 = 0;
      __pyx_6 = 0;
      goto __pyx_L1;
    }
  }
}

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("etree._BaseParser._parseDocFromFilelike");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_file_context);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_filelike);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

static PyObject *__pyx_n_IOError;

static PyObject *__pyx_k337p;
static PyObject *__pyx_k338p;
static PyObject *__pyx_k339p;

static char (__pyx_k337[]) = "Error reading file '%s': %s";
static char (__pyx_k338[]) = "Error reading file '%s'";
static char (__pyx_k339[]) = "line %d: %s";

static int __pyx_f_5etree__raiseParseError(xmlParserCtxt (*__pyx_v_ctxt),PyObject *__pyx_v_filename) {
PyObject *__pyx_v_message;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_filename);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":578 */
__pyx_1 = __pyx_v_filename != Py_None;
if (__pyx_1) {
  __pyx_1 = (__pyx_v_ctxt->lastError.domain == XML_FROM_IO);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":580 */
  __pyx_1 = (__pyx_v_ctxt->lastError.message != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":581 */
    __pyx_2 = PyString_FromString(__pyx_v_ctxt->lastError.message); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 582; goto __pyx_L1;}
    __pyx_3 = PyObject_GetAttr(__pyx_2, __pyx_n_strip); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 582; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 582; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 582; 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_k337p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 581; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":584 */
    __pyx_3 = PyNumber_Remainder(__pyx_k338p, __pyx_v_filename); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 584; goto __pyx_L1;}
    Py_DECREF(__pyx_v_message);
    __pyx_v_message = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":585 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_v_message, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 585; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_ctxt->lastError.message != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":587 */
  __pyx_3 = PyString_FromString(__pyx_v_ctxt->lastError.message); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 587; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_strip); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 587; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 587; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":588 */
  __pyx_1 = (__pyx_v_ctxt->lastError.line >= 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":589 */
    __pyx_2 = PyInt_FromLong(__pyx_v_ctxt->lastError.line); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 589; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 589; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
    Py_INCREF(__pyx_v_message);
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_message);
    __pyx_2 = 0;
    __pyx_2 = PyNumber_Remainder(__pyx_k339p, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 589; 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_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":590 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 590; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_v_message, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 590; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":592 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSyntaxError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 592; goto __pyx_L1;}
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._raiseParseError");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__handleParseResult(xmlParserCtxt (*__pyx_v_ctxt),xmlDoc (*__pyx_v_result),PyObject *__pyx_v_filename,int __pyx_v_recover)) {
struct __pyx_obj_5etree__ResolverContext *__pyx_v_context;
xmlDoc (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_filename);
__pyx_v_context = ((struct __pyx_obj_5etree__ResolverContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":597 */
__pyx_1 = (__pyx_v_ctxt->myDoc != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":598 */
  __pyx_1 = (__pyx_v_ctxt->myDoc != __pyx_v_result);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":599 */
    xmlFreeDoc(__pyx_v_ctxt->myDoc);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":600 */
  __pyx_v_ctxt->myDoc = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":602 */
__pyx_1 = (__pyx_v_result != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":603 */
  __pyx_1 = __pyx_v_ctxt->wellFormed;
  if (!__pyx_1) {
    __pyx_1 = __pyx_v_recover;
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":604 */
    ((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_result);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":607 */
    xmlFreeDoc(__pyx_v_result);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":608 */
    __pyx_v_result = NULL;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":610 */
__pyx_1 = (__pyx_v_ctxt->_private != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":611 */
  __pyx_2 = (PyObject *)__pyx_v_ctxt->_private;
  Py_INCREF(__pyx_2);
  Py_DECREF(((PyObject *)__pyx_v_context));
  __pyx_v_context = ((struct __pyx_obj_5etree__ResolverContext *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":612 */
  __pyx_1 = ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->__pyx_base._has_raised(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_context));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":613 */
    __pyx_1 = (__pyx_v_result != NULL);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":614 */
      xmlFreeDoc(__pyx_v_result);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":615 */
      __pyx_v_result = NULL;
      goto __pyx_L8;
    }
    __pyx_L8:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":616 */
    __pyx_2 = ((struct __pyx_vtabstruct_5etree__ResolverContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->__pyx_base._raise_if_stored(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_context)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 616; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":618 */
__pyx_1 = (__pyx_v_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":619 */
  __pyx_1 = __pyx_f_5etree__raiseParseError(__pyx_v_ctxt,__pyx_v_filename); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 619; goto __pyx_L1;}
  goto __pyx_L9;
}
__pyx_1 = (__pyx_v_result->URL == NULL);
if (__pyx_1) {
  __pyx_1 = __pyx_v_filename != Py_None;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":621 */
  __pyx_v_result->URL = xmlStrdup(_cstr(__pyx_v_filename));
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":622 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._handleParseResult");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF(__pyx_v_filename);
return __pyx_r;
}

static int __pyx_f_5etree_9XMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_v_parse_options;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
static char *__pyx_argnames[] = {"attribute_defaults","dtd_validation","load_dtd","no_network","ns_clean","recover","remove_blank_text","compact",0};
__pyx_v_attribute_defaults = __pyx_k119;
__pyx_v_dtd_validation = __pyx_k120;
__pyx_v_load_dtd = __pyx_k121;
__pyx_v_no_network = __pyx_k122;
__pyx_v_ns_clean = __pyx_k123;
__pyx_v_recover = __pyx_k124;
__pyx_v_remove_blank_text = __pyx_k125;
__pyx_v_compact = __pyx_k126;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOOOOOO", __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)) 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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":667 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseParser), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 667; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 667; 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 (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 667; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":669 */
__pyx_v_parse_options = __pyx_v_5etree__XML_DEFAULT_PARSE_OPTIONS;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":670 */
__pyx_4 = PyObject_IsTrue(__pyx_v_load_dtd); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 670; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":671 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":672 */
__pyx_4 = PyObject_IsTrue(__pyx_v_dtd_validation); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 672; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":673 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":675 */
__pyx_4 = PyObject_IsTrue(__pyx_v_attribute_defaults); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 675; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":676 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDATTR) | XML_PARSE_DTDLOAD);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":678 */
__pyx_4 = PyObject_IsTrue(__pyx_v_no_network); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 678; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":679 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NONET);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":680 */
__pyx_4 = PyObject_IsTrue(__pyx_v_ns_clean); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 680; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":681 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NSCLEAN);
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":682 */
__pyx_4 = PyObject_IsTrue(__pyx_v_recover); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 682; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":683 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_RECOVER);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":684 */
__pyx_4 = PyObject_IsTrue(__pyx_v_remove_blank_text); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 684; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":685 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":686 */
__pyx_4 = PyObject_IsTrue(__pyx_v_compact); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 686; goto __pyx_L1;}
__pyx_5 = (!__pyx_4);
if (__pyx_5) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":687 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ XML_PARSE_COMPACT);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":689 */
((struct __pyx_obj_5etree_XMLParser *)__pyx_v_self)->__pyx_base._parse_options = __pyx_v_parse_options;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("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);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__internalParseDoc(char (*__pyx_v_c_text),int __pyx_v_options,struct __pyx_obj_5etree__ResolverContext *__pyx_v_context)) {
xmlParserCtxt (*__pyx_v_pctxt);
xmlDoc (*__pyx_v_c_doc);
int __pyx_v_recover;
xmlDoc (*__pyx_r);
int __pyx_1;
xmlDoc (*__pyx_2);
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":697 */
__pyx_v_pctxt = xmlNewParserCtxt();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":698 */
__pyx_1 = (__pyx_v_pctxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":699 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":700 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":701 */
__pyx_v_pctxt->_private = ((PyObject (*))__pyx_v_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":702 */
__pyx_v_c_doc = xmlCtxtReadDoc(__pyx_v_pctxt,__pyx_v_c_text,NULL,NULL,__pyx_v_options);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":704 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":705 */
  __pyx_v_recover = (__pyx_v_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":706 */
  __pyx_2 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_c_doc,Py_None,__pyx_v_recover); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 706; goto __pyx_L4;}
  __pyx_v_c_doc = __pyx_2;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    PyErr_Fetch(&__pyx_3, &__pyx_4, &__pyx_5);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":708 */
  xmlFreeParserCtxt(__pyx_v_pctxt);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_3, __pyx_4, __pyx_5);
      __pyx_lineno = __pyx_1;
      __pyx_3 = 0;
      __pyx_4 = 0;
      __pyx_5 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":709 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._internalParseDoc");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__internalParseDocFromFile(char (*__pyx_v_c_filename),int __pyx_v_options,struct __pyx_obj_5etree__ResolverContext *__pyx_v_context)) {
xmlParserCtxt (*__pyx_v_pctxt);
xmlDoc (*__pyx_v_c_doc);
int __pyx_v_recover;
PyObject *__pyx_v_filename;
xmlDoc (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
xmlDoc (*__pyx_3);
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_context);
__pyx_v_filename = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":717 */
__pyx_v_pctxt = xmlNewParserCtxt();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":718 */
__pyx_1 = (__pyx_v_pctxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":719 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":720 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_pctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":721 */
__pyx_v_pctxt->_private = ((PyObject (*))__pyx_v_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":722 */
__pyx_v_c_doc = xmlCtxtReadFile(__pyx_v_pctxt,__pyx_v_c_filename,NULL,__pyx_v_options);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":724 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":725 */
  __pyx_v_recover = (__pyx_v_options & XML_PARSE_RECOVER);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":726 */
  __pyx_1 = (__pyx_v_c_filename == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":727 */
    Py_INCREF(Py_None);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = Py_None;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":729 */
    __pyx_2 = PyString_FromString(__pyx_v_c_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 729; goto __pyx_L4;}
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":730 */
  __pyx_3 = __pyx_f_5etree__handleParseResult(__pyx_v_pctxt,__pyx_v_c_doc,__pyx_v_filename,__pyx_v_recover); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 730; goto __pyx_L4;}
  __pyx_v_c_doc = __pyx_3;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_2, &__pyx_4, &__pyx_5);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":732 */
  xmlFreeParserCtxt(__pyx_v_pctxt);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_4, __pyx_5);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_4 = 0;
      __pyx_5 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":733 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._internalParseDocFromFile");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_filename);
Py_DECREF((PyObject *)__pyx_v_context);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_setDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_setDefaultParser[] = "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_f_5etree_setDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5etree__BaseParser *__pyx_v_parser = 0;
PyObject *__pyx_r;
int __pyx_1;
static char *__pyx_argnames[] = {"parser",0};
__pyx_v_parser = __pyx_k127;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_parser);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 1, "parser")) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 741; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":751 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":752 */
  Py_INCREF(((PyObject *)__pyx_v_5etree___DEFAULT_XML_PARSER));
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_v_5etree___DEFAULT_XML_PARSER);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":753 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->setDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_parser);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.setDefaultParser");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_getDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_getDefaultParser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":756 */
__pyx_1 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 756; 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("etree.getDefaultParser");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_f_5etree_set_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_set_default_parser[] = "Deprecated, please use setDefaultParser instead.";
static PyObject *__pyx_f_5etree_set_default_parser(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};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_parser);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":760 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_setDefaultParser); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 760; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 760; 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 (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 760; 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("etree.set_default_parser");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_get_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_get_default_parser[] = "Deprecated, please use getDefaultParser instead.";
static PyObject *__pyx_f_5etree_get_default_parser(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":764 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_getDefaultParser); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 764; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 764; 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("etree.get_default_parser");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static int __pyx_f_5etree_10HTMLParser___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_v_parse_options;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
int __pyx_5;
static char *__pyx_argnames[] = {"recover","no_network","remove_blank_text","compact",0};
__pyx_v_recover = __pyx_k128;
__pyx_v_no_network = __pyx_k129;
__pyx_v_remove_blank_text = __pyx_k130;
__pyx_v_compact = __pyx_k131;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|OOOO", __pyx_argnames, &__pyx_v_recover, &__pyx_v_no_network, &__pyx_v_remove_blank_text, &__pyx_v_compact)) 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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":793 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseParser), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 793; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 793; 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 (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 793; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":795 */
__pyx_v_parse_options = __pyx_v_5etree__HTML_DEFAULT_PARSE_OPTIONS;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":796 */
__pyx_4 = PyObject_IsTrue(__pyx_v_recover); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 796; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":797 */
  __pyx_v_parse_options = (__pyx_v_parse_options | HTML_PARSE_RECOVER);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":798 */
__pyx_4 = PyObject_IsTrue(__pyx_v_no_network); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 798; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":799 */
  __pyx_v_parse_options = (__pyx_v_parse_options | HTML_PARSE_NONET);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":800 */
__pyx_4 = PyObject_IsTrue(__pyx_v_remove_blank_text); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 800; goto __pyx_L1;}
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":801 */
  __pyx_v_parse_options = (__pyx_v_parse_options | HTML_PARSE_NOBLANKS);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":802 */
__pyx_4 = PyObject_IsTrue(__pyx_v_compact); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 802; goto __pyx_L1;}
__pyx_5 = (!__pyx_4);
if (__pyx_5) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":803 */
  __pyx_v_parse_options = (__pyx_v_parse_options ^ HTML_PARSE_COMPACT);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":805 */
((struct __pyx_obj_5etree_HTMLParser *)__pyx_v_self)->__pyx_base._parse_options = __pyx_v_parse_options;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("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);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__parseDoc(PyObject *__pyx_v_text,PyObject *__pyx_v_filename,struct __pyx_obj_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;
xmlDoc (*__pyx_4);
xmlDoc (*__pyx_5);
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":818 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":819 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 819; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":820 */
__pyx_1 = PyObject_IsTrue(__pyx_v_filename); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 820; goto __pyx_L1;}
__pyx_3 = (!__pyx_1);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":821 */
  __pyx_v_c_filename = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":823 */
  __pyx_2 = __pyx_f_5etree__encodeFilenameUTF8(__pyx_v_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 823; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename_utf);
  __pyx_v_filename_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":824 */
  __pyx_v_c_filename = _cstr(__pyx_v_filename_utf);
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":825 */
__pyx_1 = PyUnicode_Check(__pyx_v_text);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":826 */
  __pyx_4 = ((struct __pyx_vtabstruct_5etree__BaseParser *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseUnicodeDoc(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser),__pyx_v_text,__pyx_v_c_filename); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 826; goto __pyx_L1;}
  __pyx_r = __pyx_4;
  goto __pyx_L0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":828 */
  __pyx_v_c_text = _cstr(__pyx_v_text);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":829 */
  __pyx_v_c_len = PyString_GET_SIZE(__pyx_v_text);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":830 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__BaseParser *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDoc(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser),__pyx_v_c_text,__pyx_v_c_len,__pyx_v_c_filename); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 830; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  goto __pyx_L0;
}
__pyx_L4:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static xmlDoc (*__pyx_f_5etree__parseDocFromFile(PyObject *__pyx_v_filename8,struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":833 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":834 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 834; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":835 */
__pyx_3 = ((struct __pyx_vtabstruct_5etree__BaseParser *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFile(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser),_cstr(__pyx_v_filename8)); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 835; goto __pyx_L1;}
__pyx_r = __pyx_3;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._parseDocFromFile");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_filename8);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__parseDocFromFilelike(PyObject *__pyx_v_source,PyObject *__pyx_v_filename,struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":839 */
__pyx_1 = __pyx_v_parser == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":840 */
  __pyx_2 = ((PyObject *)((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->getDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 840; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_parser));
  __pyx_v_parser = ((struct __pyx_obj_5etree__BaseParser *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":841 */
__pyx_3 = ((struct __pyx_vtabstruct_5etree__BaseParser *)((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser)->__pyx_vtab)->_parseDocFromFilelike(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser),__pyx_v_source,__pyx_v_filename); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 841; goto __pyx_L1;}
__pyx_r = __pyx_3;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static char (__pyx_k340[]) = "1.0";

static xmlDoc (*__pyx_f_5etree__newDoc(void)) {
xmlDoc (*__pyx_v_result);
xmlDoc (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":845 */
__pyx_v_result = xmlNewDoc(__pyx_k340);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":846 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":847 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__copyDoc(xmlDoc (*__pyx_v_c_doc),int __pyx_v_recursive)) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlDoc (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":852 */
__pyx_1 = __pyx_v_recursive;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":853 */
  __pyx_v_state = PyEval_SaveThread();
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":854 */
__pyx_v_result = xmlCopyDoc(__pyx_v_c_doc,__pyx_v_recursive);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":855 */
__pyx_f_5etree__bugFixURL(__pyx_v_c_doc,__pyx_v_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":856 */
__pyx_1 = __pyx_v_recursive;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":857 */
  PyEval_RestoreThread(__pyx_v_state);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":858 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":859 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__copyDocRoot(xmlDoc (*__pyx_v_c_doc),xmlNode (*__pyx_v_c_new_root))) {
PyThreadState (*__pyx_v_state);
xmlDoc (*__pyx_v_result);
xmlNode (*__pyx_v_c_node);
xmlDoc (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":866 */
__pyx_v_result = xmlCopyDoc(__pyx_v_c_doc,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":867 */
__pyx_f_5etree__bugFixURL(__pyx_v_c_doc,__pyx_v_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":868 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initDocDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_result);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":869 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":870 */
__pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_new_root,__pyx_v_result,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":871 */
xmlDocSetRootElement(__pyx_v_result,__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":872 */
__pyx_f_5etree__copyTail(__pyx_v_c_new_root->next,__pyx_v_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":873 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":874 */
__pyx_r = __pyx_v_result;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlNode (*__pyx_f_5etree__copyNodeToDoc(xmlNode (*__pyx_v_c_node),xmlDoc (*__pyx_v_c_doc))) {
xmlNode (*__pyx_v_c_root);
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":879 */
__pyx_v_c_root = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_c_doc,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":880 */
__pyx_f_5etree__copyTail(__pyx_v_c_node->next,__pyx_v_c_root);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":881 */
__pyx_r = __pyx_v_c_root;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__bugFixURL(xmlDoc (*__pyx_v_c_source_doc),xmlDoc (*__pyx_v_c_target_doc)) {
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":886 */
__pyx_1 = (__pyx_v_c_source_doc->URL != NULL);
if (__pyx_1) {
  __pyx_1 = (__pyx_v_5etree__LIBXML_VERSION_INT < 20618);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":887 */
  __pyx_1 = (__pyx_v_c_target_doc->URL != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":888 */
    xmlFree(__pyx_v_c_target_doc->URL);
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":889 */
  __pyx_v_c_target_doc->URL = xmlStrdup(__pyx_v_c_source_doc->URL);
  goto __pyx_L2;
}
__pyx_L2:;

}

static PyObject *__pyx_n_getvalue;
static PyObject *__pyx_n_tell;


static struct LxmlDocument *__pyx_f_5etree__parseDocument(PyObject *__pyx_v_source,struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":898 */
__pyx_1 = __pyx_f_5etree__getFilenameForFile(__pyx_v_source); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 898; goto __pyx_L1;}
Py_DECREF(__pyx_v_filename);
__pyx_v_filename = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":899 */
__pyx_2 = hasattr(__pyx_v_source,__pyx_n_getvalue);
if (__pyx_2) {
  __pyx_2 = hasattr(__pyx_v_source,__pyx_n_tell);
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":901 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_source, __pyx_n_tell); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 901; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 901; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 901; goto __pyx_L1;}
  if (PyObject_Cmp(__pyx_3, __pyx_1, &__pyx_2) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 901; goto __pyx_L1;}
  __pyx_2 = __pyx_2 == 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":902 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_source, __pyx_n_getvalue); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 903; goto __pyx_L1;}
    __pyx_1 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 903; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = __pyx_f_5etree__encodeFilenameUTF8(__pyx_v_filename); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 903; goto __pyx_L1;}
    __pyx_4 = ((PyObject *)__pyx_f_5etree__parseMemoryDocument(__pyx_1,__pyx_3,__pyx_v_parser)); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 902; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":906 */
__pyx_2 = hasattr(__pyx_v_source,__pyx_n_read);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":907 */
  __pyx_1 = __pyx_f_5etree__encodeFilenameUTF8(__pyx_v_filename); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 908; goto __pyx_L1;}
  __pyx_3 = ((PyObject *)__pyx_f_5etree__parseFilelikeDocument(__pyx_v_source,__pyx_1,__pyx_v_parser)); if (!__pyx_3) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 907; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":911 */
__pyx_2 = __pyx_v_filename == Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":912 */
  __pyx_4 = __pyx_f_5etree__encodeFilename(__pyx_v_source); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 912; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":914 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__parseDocumentFromURL(__pyx_v_filename,__pyx_v_parser)); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 914; 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("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;
}

static struct LxmlDocument *__pyx_f_5etree__parseDocumentFromURL(PyObject *__pyx_v_url,struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":918 */
__pyx_1 = __pyx_f_5etree__parseDocFromFile(__pyx_v_url,__pyx_v_parser); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 918; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":919 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 919; 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("etree._parseDocumentFromURL");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_url);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_k344p;
static PyObject *__pyx_k345p;

static char (__pyx_k344[]) = "Unicode strings with encoding declaration are not supported.";
static char (__pyx_k345[]) = "can only parse strings";

static struct LxmlDocument *__pyx_f_5etree__parseMemoryDocument(PyObject *__pyx_v_text,PyObject *__pyx_v_url,struct __pyx_obj_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_text);
Py_INCREF(__pyx_v_url);
Py_INCREF(__pyx_v_parser);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":923 */
__pyx_1 = PyUnicode_Check(__pyx_v_text);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":924 */
  __pyx_1 = __pyx_f_5etree__hasEncodingDeclaration(__pyx_v_text);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":925 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 925; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k344p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[7]; __pyx_lineno = 925; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":928 */
  __pyx_1 = (__pyx_v_5etree__UNICODE_ENCODING == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":929 */
    __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_text); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 929; goto __pyx_L1;}
    Py_DECREF(__pyx_v_text);
    __pyx_v_text = __pyx_2;
    __pyx_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L2;
}
__pyx_1 = (!PyString_Check(__pyx_v_text));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":931 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 931; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k345p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[7]; __pyx_lineno = 931; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":932 */
__pyx_1 = PyUnicode_Check(__pyx_v_url);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":933 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_url); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 933; goto __pyx_L1;}
  Py_DECREF(__pyx_v_url);
  __pyx_v_url = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":934 */
__pyx_3 = __pyx_f_5etree__parseDoc(__pyx_v_text,__pyx_v_url,__pyx_v_parser); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 934; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":935 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 935; 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("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;
}

static struct LxmlDocument *__pyx_f_5etree__parseFilelikeDocument(PyObject *__pyx_v_source,PyObject *__pyx_v_url,struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":939 */
__pyx_1 = PyUnicode_Check(__pyx_v_url);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":940 */
  __pyx_2 = PyUnicode_AsUTF8String(__pyx_v_url); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 940; goto __pyx_L1;}
  Py_DECREF(__pyx_v_url);
  __pyx_v_url = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":941 */
__pyx_3 = __pyx_f_5etree__parseDocFromFilelike(__pyx_v_source,__pyx_v_url,__pyx_v_parser); if (__pyx_3 == NULL) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 941; goto __pyx_L1;}
__pyx_v_c_doc = __pyx_3;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":942 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_doc,__pyx_v_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 942; 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("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;
}

static PyObject *__pyx_n_LookupError;

static PyObject *__pyx_k347p;

static char (__pyx_k346[]) = "unknown encoding: '%s'";
static char (__pyx_k347[]) = "Failed to create output buffer";

static PyObject *__pyx_f_5etree__tostring(struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_encoding,int __pyx_v_write_xml_declaration,int __pyx_v_pretty_print) {
PyThreadState (*__pyx_v_state);
xmlOutputBuffer (*__pyx_v_c_buffer);
xmlBuffer (*__pyx_v_c_result_buffer);
xmlCharEncodingHandler (*__pyx_v_enchandler);
char (*__pyx_v_c_enc);
PyObject *__pyx_v_result;
PyObject *__pyx_r;
int __pyx_1;
char (*__pyx_2);
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_encoding);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":12 */
__pyx_1 = __pyx_v_element == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":13 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":14 */
__pyx_1 = __pyx_v_encoding == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":15 */
  __pyx_v_c_enc = NULL;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":17 */
  __pyx_2 = PyString_AsString(__pyx_v_encoding); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 17; goto __pyx_L1;}
  __pyx_v_c_enc = __pyx_2;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":20 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":21 */
__pyx_1 = (__pyx_v_enchandler == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":22 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_LookupError); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_4 = PyString_FromFormat(__pyx_k346,__pyx_v_c_enc); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_4, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 22; goto __pyx_L1;}
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":24 */
__pyx_v_c_buffer = xmlAllocOutputBuffer(__pyx_v_enchandler);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":25 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":26 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":27 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 27; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_k347p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 27; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":29 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":30 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":31 */
  __pyx_f_5etree__writeNodeToBuffer(__pyx_v_c_buffer,__pyx_v_element->_c_node,__pyx_v_c_enc,__pyx_v_write_xml_declaration,__pyx_v_pretty_print);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":33 */
  xmlOutputBufferFlush(__pyx_v_c_buffer);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":34 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":35 */
  __pyx_1 = (__pyx_v_c_buffer->conv != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":36 */
    __pyx_v_c_result_buffer = __pyx_v_c_buffer->conv;
    goto __pyx_L9;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":38 */
    __pyx_v_c_result_buffer = __pyx_v_c_buffer->buffer;
  }
  __pyx_L9:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":39 */
  __pyx_4 = PyString_FromStringAndSize(xmlBufferContent(__pyx_v_c_result_buffer),xmlBufferLength(__pyx_v_c_result_buffer)); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 39; goto __pyx_L7;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_4;
  __pyx_4 = 0;
}
/*finally:*/ {
  int __pyx_why;
  __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_3, &__pyx_4, &__pyx_5);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":43 */
  xmlOutputBufferClose(__pyx_v_c_buffer);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_3, __pyx_4, __pyx_5);
      __pyx_lineno = __pyx_1;
      __pyx_3 = 0;
      __pyx_4 = 0;
      __pyx_5 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":44 */
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);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._tostring");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

static PyObject *__pyx_k348p;

static char (__pyx_k348[]) = "Failed to create output buffer";
static char (__pyx_k349[]) = "strict";

static PyObject *__pyx_f_5etree__tounicode(struct LxmlElement *__pyx_v_element,int __pyx_v_pretty_print) {
PyThreadState (*__pyx_v_state);
xmlOutputBuffer (*__pyx_v_c_buffer);
xmlBuffer (*__pyx_v_c_result_buffer);
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_element);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":51 */
__pyx_1 = __pyx_v_element == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":52 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":53 */
__pyx_v_c_buffer = xmlAllocOutputBuffer(NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":54 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":55 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k348p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 55; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":56 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":57 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":58 */
  __pyx_f_5etree__writeNodeToBuffer(__pyx_v_c_buffer,__pyx_v_element->_c_node,NULL,0,__pyx_v_pretty_print);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":59 */
  xmlOutputBufferFlush(__pyx_v_c_buffer);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":60 */
  PyEval_RestoreThread(__pyx_v_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":61 */
  __pyx_1 = (__pyx_v_c_buffer->conv != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":62 */
    __pyx_v_c_result_buffer = __pyx_v_c_buffer->conv;
    goto __pyx_L7;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":64 */
    __pyx_v_c_result_buffer = __pyx_v_c_buffer->buffer;
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":65 */
  __pyx_2 = PyUnicode_DecodeUTF8(xmlBufferContent(__pyx_v_c_result_buffer),xmlBufferLength(__pyx_v_c_result_buffer),__pyx_k349); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 65; goto __pyx_L5;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L6;
  __pyx_L5: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_2, &__pyx_3, &__pyx_4);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":70 */
  xmlOutputBufferClose(__pyx_v_c_buffer);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_3, __pyx_4);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_3 = 0;
      __pyx_4 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":71 */
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("etree._tounicode");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

static void __pyx_f_5etree__writeNodeToBuffer(xmlOutputBuffer (*__pyx_v_c_buffer),xmlNode (*__pyx_v_c_node),char (*__pyx_v_encoding),int __pyx_v_write_xml_declaration,int __pyx_v_pretty_print) {
xmlDoc (*__pyx_v_c_doc);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":77 */
__pyx_v_c_doc = __pyx_v_c_node->doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":78 */
__pyx_1 = __pyx_v_write_xml_declaration;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":79 */
  __pyx_f_5etree__writeDeclarationToBuffer(__pyx_v_c_buffer,__pyx_v_c_doc->version,__pyx_v_encoding);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":81 */
xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_doc,__pyx_v_c_node,0,__pyx_v_pretty_print,__pyx_v_encoding);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":82 */
__pyx_f_5etree__writeTail(__pyx_v_c_buffer,__pyx_v_c_node,__pyx_v_encoding,__pyx_v_pretty_print);

}

static char (__pyx_k350[]) = "1.0";
static char (__pyx_k351[]) = "<?xml version='";
static char (__pyx_k352[]) = "' encoding='";
static char (__pyx_k353[]) = "'?>\n";

static void __pyx_f_5etree__writeDeclarationToBuffer(xmlOutputBuffer (*__pyx_v_c_buffer),char (*__pyx_v_version),char (*__pyx_v_encoding)) {
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":86 */
__pyx_1 = (__pyx_v_version == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":87 */
  __pyx_v_version = __pyx_k350;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":88 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k351);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":89 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_version);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":90 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k352);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":91 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_v_encoding);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":92 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k353);

}

static void __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":97 */
__pyx_v_c_node = __pyx_v_c_node->next;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":98 */
while (1) {
  __pyx_1 = (__pyx_v_c_node != NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":99 */
  xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_node,0,__pyx_v_pretty_print,__pyx_v_encoding);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":101 */
  __pyx_v_c_node = __pyx_v_c_node->next;
}

}

static int __pyx_f_5etree_15_FilelikeWriter___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k132;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":110 */
Py_INCREF(__pyx_v_filelike);
Py_DECREF(((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_filelike);
((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_filelike = __pyx_v_filelike;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":111 */
__pyx_1 = __pyx_v_exc_context == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":112 */
  __pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ExceptionContext), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
  ((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_5etree__ExceptionContext *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":114 */
  if (!__Pyx_TypeTest(__pyx_v_exc_context, __pyx_ptype_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 114; goto __pyx_L1;}
  Py_INCREF(__pyx_v_exc_context);
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context));
  ((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->_exc_context = ((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_exc_context);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":115 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ErrorLog), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ErrorLog)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 115; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->error_log));
((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_v_self)->error_log = ((struct __pyx_obj_5etree__ErrorLog *)__pyx_2);
__pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k354p;

static char (__pyx_k354[]) = "Could not create I/O writer context.";

static xmlOutputBuffer (*__pyx_f_5etree_15_FilelikeWriter__createOutputBuffer(struct __pyx_obj_5etree__FilelikeWriter *__pyx_v_self,xmlCharEncodingHandler (*__pyx_v_enchandler))) {
xmlOutputBuffer (*__pyx_v_c_buffer);
xmlOutputBuffer (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":120 */
__pyx_v_c_buffer = xmlOutputBufferCreateIO(__pyx_f_5etree__writeFilelikeWriter,__pyx_f_5etree__closeFilelikeWriter,((PyObject (*))__pyx_v_self),__pyx_v_enchandler);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":123 */
__pyx_1 = (__pyx_v_c_buffer == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":124 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k354p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 124; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":125 */
__pyx_r = __pyx_v_c_buffer;
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._FilelikeWriter._createOutputBuffer");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_write;

static PyObject *__pyx_k355p;

static char (__pyx_k355[]) = "File is already closed";

static int __pyx_f_5etree_15_FilelikeWriter_write(struct __pyx_obj_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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":128 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":129 */
  __pyx_1 = __pyx_v_self->_filelike == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":130 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 130; goto __pyx_L2;}
    __Pyx_Raise(__pyx_2, __pyx_k355p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[8]; __pyx_lineno = 130; goto __pyx_L2;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":131 */
  __pyx_2 = PyString_FromStringAndSize(__pyx_v_c_buffer,__pyx_v_size); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 131; goto __pyx_L2;}
  Py_DECREF(__pyx_v_py_buffer);
  __pyx_v_py_buffer = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":132 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self->_filelike, __pyx_n_write); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 132; goto __pyx_L2;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 132; 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 (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 132; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":133 */
  __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":134 */
/*except:*/ {
  __Pyx_AddTraceback("etree.write");
  __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 134; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":135 */
  ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_self->_exc_context->__pyx_vtab)->_store_raised(__pyx_v_self->_exc_context);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":136 */
  __pyx_r = (-1);
  goto __pyx_L0;
  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("etree._FilelikeWriter.write");
__pyx_L0:;
Py_DECREF(__pyx_v_py_buffer);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static int __pyx_f_5etree_15_FilelikeWriter_close(struct __pyx_obj_5etree__FilelikeWriter *__pyx_v_self) {
int __pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":140 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_self->_filelike);
__pyx_v_self->_filelike = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":141 */
__pyx_r = 0;
goto __pyx_L0;

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

static int __pyx_f_5etree__writeFilelikeWriter(void (*__pyx_v_ctxt),char (*__pyx_v_c_buffer),int __pyx_v_len) {
int __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":144 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_vtabstruct_5etree__FilelikeWriter *)((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_1)->__pyx_vtab)->write(((struct __pyx_obj_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;
}

static int __pyx_f_5etree__closeFilelikeWriter(void (*__pyx_v_ctxt)) {
int __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":147 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_vtabstruct_5etree__FilelikeWriter *)((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_1)->__pyx_vtab)->close(((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_1));
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k358p;

static char (__pyx_k356[]) = "unknown encoding: '%s'";
static char (__pyx_k358[]) = "File or filename expected, got '%s'";

static PyObject *__pyx_f_5etree__tofilelike(PyObject *__pyx_v_f,struct LxmlElement *__pyx_v_element,PyObject *__pyx_v_encoding,int __pyx_v_write_xml_declaration,int __pyx_v_pretty_print) {
PyThreadState (*__pyx_v_state);
struct __pyx_obj_5etree__FilelikeWriter *__pyx_v_writer;
xmlOutputBuffer (*__pyx_v_c_buffer);
xmlCharEncodingHandler (*__pyx_v_enchandler);
char (*__pyx_v_c_enc);
PyObject *__pyx_v_filename8;
PyObject *__pyx_r;
int __pyx_1;
char (*__pyx_2);
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
xmlOutputBuffer (*__pyx_5);
PyObject *__pyx_6 = 0;
PyObject *__pyx_7 = 0;
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_encoding);
__pyx_v_writer = ((struct __pyx_obj_5etree__FilelikeWriter *)Py_None); Py_INCREF(Py_None);
__pyx_v_filename8 = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":156 */
__pyx_1 = __pyx_v_encoding == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":157 */
  __pyx_v_c_enc = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":159 */
  __pyx_2 = PyString_AsString(__pyx_v_encoding); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 159; goto __pyx_L1;}
  __pyx_v_c_enc = __pyx_2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":160 */
__pyx_v_enchandler = xmlFindCharEncodingHandler(__pyx_v_c_enc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":161 */
__pyx_1 = (__pyx_v_enchandler == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":162 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_LookupError); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; goto __pyx_L1;}
  __pyx_4 = PyString_FromFormat(__pyx_k356,__pyx_v_c_enc); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_4, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 162; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":165 */
__pyx_1 = _isString(__pyx_v_f);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":166 */
  __pyx_3 = __pyx_f_5etree__encodeFilename(__pyx_v_f); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 166; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename8);
  __pyx_v_filename8 = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":167 */
  __pyx_v_c_buffer = xmlOutputBufferCreateFilename(_cstr(__pyx_v_filename8),__pyx_v_enchandler,0);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":169 */
  __pyx_1 = (__pyx_v_c_buffer == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":170 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_IOError); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 170; goto __pyx_L1;}
    __pyx_3 = PyErr_SetFromErrno(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 170; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":171 */
  __pyx_v_state = PyEval_SaveThread();
  goto __pyx_L4;
}
__pyx_1 = hasattr(__pyx_v_f,__pyx_n_write);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":173 */
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_f);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__FilelikeWriter), __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__FilelikeWriter)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_writer));
  __pyx_v_writer = ((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":174 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer,__pyx_v_enchandler); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 174; goto __pyx_L1;}
  __pyx_v_c_buffer = __pyx_5;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":176 */
  xmlCharEncCloseFunc(__pyx_v_enchandler);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":177 */
  __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_4) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
  __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
  Py_INCREF(__pyx_v_f);
  PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_f);
  __pyx_7 = PyObject_CallObject(__pyx_3, __pyx_6); if (!__pyx_7) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k358p, __pyx_7); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
  Py_DECREF(__pyx_7); __pyx_7 = 0;
  __Pyx_Raise(__pyx_4, __pyx_3, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 177; goto __pyx_L1;}
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":179 */
__pyx_f_5etree__writeNodeToBuffer(__pyx_v_c_buffer,__pyx_v_element->_c_node,__pyx_v_c_enc,__pyx_v_write_xml_declaration,__pyx_v_pretty_print);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":181 */
xmlOutputBufferClose(__pyx_v_c_buffer);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":182 */
xmlCharEncCloseFunc(__pyx_v_enchandler);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":183 */
__pyx_1 = __pyx_v_writer == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":184 */
  PyEval_RestoreThread(__pyx_v_state);
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":186 */
  __pyx_6 = ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 186; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
}
__pyx_L6:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_6);
Py_XDECREF(__pyx_7);
__Pyx_AddTraceback("etree._tofilelike");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_writer);
Py_DECREF(__pyx_v_filename8);
Py_DECREF(__pyx_v_f);
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_encoding);
return __pyx_r;
}

static PyObject *__pyx_n_message;

static PyObject *__pyx_k360p;
static PyObject *__pyx_k361p;

static char (__pyx_k360[]) = "File or filename expected, got '%s'";
static char (__pyx_k361[]) = "C14N failed";

static PyObject *__pyx_f_5etree__tofilelikeC14N(PyObject *__pyx_v_f,struct LxmlElement *__pyx_v_element) {
PyThreadState (*__pyx_v_state);
struct __pyx_obj_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;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
xmlOutputBuffer (*__pyx_4);
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
int __pyx_7;
Py_INCREF(__pyx_v_f);
Py_INCREF(__pyx_v_element);
__pyx_v_writer = ((struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":197 */
__pyx_v_c_base_doc = __pyx_v_element->_c_node->doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":198 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_c_base_doc,__pyx_v_element->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":199 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":200 */
  __pyx_1 = _isString(__pyx_v_f);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":201 */
    __pyx_2 = __pyx_f_5etree__encodeFilename(__pyx_v_f); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 201; goto __pyx_L3;}
    Py_DECREF(__pyx_v_filename8);
    __pyx_v_filename8 = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":202 */
    __pyx_v_c_filename = _cstr(__pyx_v_filename8);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":203 */
    __pyx_v_state = PyEval_SaveThread();

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":204 */
    __pyx_v_bytes = xmlC14NDocSave(__pyx_v_c_doc,NULL,0,NULL,1,__pyx_v_c_filename,0);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":205 */
    PyEval_RestoreThread(__pyx_v_state);
    goto __pyx_L5;
  }
  __pyx_1 = hasattr(__pyx_v_f,__pyx_n_write);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":207 */
    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; goto __pyx_L3;}
    Py_INCREF(__pyx_v_f);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_f);
    __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__FilelikeWriter), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; goto __pyx_L3;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__FilelikeWriter)) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 207; goto __pyx_L3;}
    Py_DECREF(((PyObject *)__pyx_v_writer));
    __pyx_v_writer = ((struct __pyx_obj_5etree__FilelikeWriter *)__pyx_3);
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":208 */
    __pyx_4 = ((struct __pyx_vtabstruct_5etree__FilelikeWriter *)__pyx_v_writer->__pyx_vtab)->_createOutputBuffer(__pyx_v_writer,NULL); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 208; goto __pyx_L3;}
    __pyx_v_c_buffer = __pyx_4;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":209 */
    ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(__pyx_v_writer->error_log);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":210 */
    __pyx_v_bytes = xmlC14NDocSaveTo(__pyx_v_c_doc,NULL,0,NULL,1,__pyx_v_c_buffer);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":211 */
    ((struct __pyx_vtabstruct_5etree__ErrorLog *)__pyx_v_writer->error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(__pyx_v_writer->error_log);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":212 */
    xmlOutputBufferClose(__pyx_v_c_buffer);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":214 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 214; goto __pyx_L3;}
    __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 214; goto __pyx_L3;}
    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 214; goto __pyx_L3;}
    Py_INCREF(__pyx_v_f);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_f);
    __pyx_6 = PyObject_CallObject(__pyx_3, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 214; goto __pyx_L3;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    __pyx_3 = PyNumber_Remainder(__pyx_k360p, __pyx_6); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 214; goto __pyx_L3;}
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __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[8]; __pyx_lineno = 214; goto __pyx_L3;}
  }
  __pyx_L5:;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_5); __pyx_5 = 0;
    Py_XDECREF(__pyx_6); __pyx_6 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_5, &__pyx_6, &__pyx_2);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":216 */
  __pyx_f_5etree__destroyFakeDoc(__pyx_v_c_base_doc,__pyx_v_c_doc);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_5, __pyx_6, __pyx_2);
      __pyx_lineno = __pyx_1;
      __pyx_5 = 0;
      __pyx_6 = 0;
      __pyx_2 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":218 */
__pyx_7 = __pyx_v_writer != Py_None;
if (__pyx_7) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":219 */
  __pyx_3 = ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_writer->_exc_context->__pyx_vtab)->_raise_if_stored(__pyx_v_writer->_exc_context); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 219; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":221 */
__pyx_7 = (__pyx_v_bytes < 0);
if (__pyx_7) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":222 */
  Py_INCREF(__pyx_k361p);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_k361p;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":223 */
  __pyx_7 = __pyx_v_writer != Py_None;
  if (__pyx_7) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":224 */
    Py_INCREF(((PyObject *)__pyx_v_writer->error_log));
    Py_DECREF(__pyx_v_errors);
    __pyx_v_errors = ((PyObject *)__pyx_v_writer->error_log);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":225 */
    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
    __pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
    Py_INCREF(__pyx_v_errors);
    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_errors);
    __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_6); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_6); __pyx_6 = 0;
    __pyx_7 = PyObject_IsTrue(__pyx_2); if (__pyx_7 < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 225; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_7) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":226 */
      __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 226; goto __pyx_L1;}
      __pyx_5 = PyObject_GetItem(__pyx_v_errors, __pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 226; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      __pyx_6 = PyObject_GetAttr(__pyx_5, __pyx_n_message); if (!__pyx_6) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 226; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_6;
      __pyx_6 = 0;
      goto __pyx_L9;
    }
    __pyx_L9:;
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":227 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_C14NError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_v_message, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 227; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_L7:;

__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("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;
}

static PyObject *__pyx_k362p;

static char (__pyx_k362[]) = "Not a file";
static char (__pyx_k363[]) = "\n";

static PyObject *__pyx_f_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;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_f);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":233 */
__pyx_1 = (!PyFile_Check(__pyx_v_f));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":234 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 234; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k362p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[8]; __pyx_lineno = 234; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":235 */
__pyx_v_c_buffer = xmlOutputBufferCreateFile(PyFile_AsFile(__pyx_v_f),NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":236 */
xmlNodeDumpOutput(__pyx_v_c_buffer,__pyx_v_c_node->doc,__pyx_v_c_node,0,__pyx_v_pretty_print,NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":237 */
__pyx_f_5etree__writeTail(__pyx_v_c_buffer,__pyx_v_c_node,NULL,0);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":238 */
xmlOutputBufferWriteString(__pyx_v_c_buffer,__pyx_k363);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":239 */
xmlOutputBufferFlush(__pyx_v_c_buffer);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._dumpToFile");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_f);
return __pyx_r;
}

static PyObject *__pyx_n_start;

static PyObject *__pyx_k366p;
static PyObject *__pyx_k367p;

static char (__pyx_k366[]) = "start-ns";
static char (__pyx_k367[]) = "end-ns";

static int __pyx_f_5etree__buildIterparseEventFilter(PyObject *__pyx_v_events) {
int __pyx_v_event_filter;
int __pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_events);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":14 */
__pyx_v_event_filter = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":15 */
__pyx_1 = PySequence_Contains(__pyx_v_events, __pyx_n_start); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 15; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":16 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_5etree_ITERPARSE_FILTER_START);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":17 */
__pyx_1 = PySequence_Contains(__pyx_v_events, __pyx_n_end); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 17; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":18 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_5etree_ITERPARSE_FILTER_END);
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":19 */
__pyx_1 = PySequence_Contains(__pyx_v_events, __pyx_k366p); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 19; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":20 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_5etree_ITERPARSE_FILTER_START_NS);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":21 */
__pyx_1 = PySequence_Contains(__pyx_v_events, __pyx_k367p); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 21; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":22 */
  __pyx_v_event_filter = (__pyx_v_event_filter | __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":23 */
__pyx_r = __pyx_v_event_filter;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("etree._buildIterparseEventFilter");
__pyx_L0:;
Py_DECREF(__pyx_v_events);
return __pyx_r;
}

static int __pyx_f_5etree__countNsDefs(xmlNode (*__pyx_v_c_node)) {
xmlNs (*__pyx_v_c_ns);
int __pyx_v_count;
int __pyx_r;
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":28 */
__pyx_v_count = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":29 */
__pyx_v_c_ns = __pyx_v_c_node->nsDef;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":30 */
while (1) {
  __pyx_1 = (__pyx_v_c_ns != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":31 */
  __pyx_v_count = (__pyx_v_count + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":32 */
  __pyx_v_c_ns = __pyx_v_c_ns->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":33 */
__pyx_r = __pyx_v_count;
goto __pyx_L0;

__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k368p;
static PyObject *__pyx_k369p;

static char (__pyx_k368[]) = "";
static char (__pyx_k369[]) = "start-ns";

static int __pyx_f_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;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":38 */
__pyx_v_count = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":39 */
__pyx_v_c_ns = __pyx_v_c_node->nsDef;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":40 */
while (1) {
  __pyx_1 = (__pyx_v_c_ns != NULL);
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":41 */
  __pyx_1 = (__pyx_v_c_ns->prefix == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":42 */
    Py_INCREF(__pyx_k368p);
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_k368p;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":44 */
    __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_c_ns->prefix); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 44; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":45 */
  __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_c_ns->href); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 45; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":46 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 46; goto __pyx_L1;}
  Py_INCREF(__pyx_k369p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k369p);
  Py_INCREF(__pyx_v_ns_tuple);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_ns_tuple);
  __pyx_1 = PyList_Append(__pyx_v_event_list,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 46; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":47 */
  __pyx_v_count = (__pyx_v_count + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":48 */
  __pyx_v_c_ns = __pyx_v_c_ns->next;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":49 */
__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("etree._appendStartNsEvents");
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_ns_tuple);
Py_DECREF(__pyx_v_event_list);
return __pyx_r;
}

static PyObject *__pyx_n_pop;

static int __pyx_f_5etree_25_IterparseResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_25_IterparseResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_args = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, 0) < 0) return -1;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
  Py_XDECREF(__pyx_args);
  Py_XDECREF(__pyx_kwds);
  Py_XDECREF(__pyx_v_args);
  return -1;
}
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":68 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ResolverContext), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 68; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
__pyx_3 = PySequence_Tuple(__pyx_v_args); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_4 = PyNumber_Add(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 68; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 68; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":69 */
__pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 69; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_ns_stack);
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_ns_stack = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":70 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_ns_stack, __pyx_n_pop); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 70; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_pop_ns);
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_pop_ns = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":71 */
__pyx_4 = PyList_New(0); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 71; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_node_stack);
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_node_stack = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":72 */
__pyx_2 = PyObject_GetAttr(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_node_stack, __pyx_n_pop); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_pop_node);
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_pop_node = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":73 */
__pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 73; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_events);
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_events = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":74 */
((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_v_self)->_event_index = 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("etree._IterparseResolverContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_XDECREF(__pyx_v_args);
Py_DECREF((PyObject *)__pyx_v_self);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static void __pyx_f_5etree_25_IterparseResolverContext__wrapCallbacks(struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_self,xmlSAXHandler (*__pyx_v_sax)) {
int __pyx_1;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":78 */
__pyx_v_self->_origSaxStart = __pyx_v_sax->startElementNs;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":80 */
__pyx_1 = (__pyx_v_self->_event_filter == 0);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_self->_event_filter & ((__pyx_e_5etree_ITERPARSE_FILTER_START | __pyx_e_5etree_ITERPARSE_FILTER_START_NS) | __pyx_e_5etree_ITERPARSE_FILTER_END_NS));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":84 */
  __pyx_v_sax->startElementNs = __pyx_f_5etree__saxStart;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":86 */
__pyx_v_self->_origSaxEnd = __pyx_v_sax->endElementNs;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":88 */
__pyx_1 = (__pyx_v_self->_event_filter == 0);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_self->_event_filter & (__pyx_e_5etree_ITERPARSE_FILTER_END | __pyx_e_5etree_ITERPARSE_FILTER_END_NS));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":91 */
  __pyx_v_sax->endElementNs = __pyx_f_5etree__saxEnd;
  goto __pyx_L3;
}
__pyx_L3:;

Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_k370p;
static PyObject *__pyx_k371p;
static PyObject *__pyx_k372p;

static char (__pyx_k370[]) = "*";
static char (__pyx_k371[]) = "*";
static char (__pyx_k372[]) = "*";

static void __pyx_f_5etree_25_IterparseResolverContext__setEventFilter(struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_self,PyObject *__pyx_v_events,PyObject *__pyx_v_tag) {
PyObject *__pyx_v_href;
PyObject *__pyx_v_name;
int __pyx_1;
PyObject *__pyx_2 = 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":94 */
__pyx_v_self->_event_filter = __pyx_f_5etree__buildIterparseEventFilter(__pyx_v_events);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":95 */
__pyx_1 = __pyx_v_tag == Py_None;
if (!__pyx_1) {
  if (PyObject_Cmp(__pyx_v_tag, __pyx_k370p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 95; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":96 */
  __pyx_v_self->_tag_href = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":97 */
  __pyx_v_self->_tag_name = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":99 */
  __pyx_2 = __pyx_f_5etree__getNsTag(__pyx_v_tag); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 99; goto __pyx_L1;}
  Py_DECREF(__pyx_v_self->_tag_tuple);
  __pyx_v_self->_tag_tuple = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":100 */
  __pyx_2 = PyObject_GetIter(__pyx_v_self->_tag_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_v_href);
  __pyx_v_href = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":101 */
  __pyx_1 = __pyx_v_href == Py_None;
  if (!__pyx_1) {
    if (PyObject_Cmp(__pyx_v_href, __pyx_k371p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 101; goto __pyx_L1;}
    __pyx_1 = __pyx_1 == 0;
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":102 */
    __pyx_v_self->_tag_href = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":104 */
    __pyx_v_self->_tag_href = _cstr(__pyx_v_href);
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":105 */
  __pyx_1 = __pyx_v_name == Py_None;
  if (!__pyx_1) {
    if (PyObject_Cmp(__pyx_v_name, __pyx_k372p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 105; goto __pyx_L1;}
    __pyx_1 = __pyx_1 == 0;
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":106 */
    __pyx_v_self->_tag_name = NULL;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":108 */
    __pyx_v_self->_tag_name = _cstr(__pyx_v_name);
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":109 */
  __pyx_1 = (__pyx_v_self->_tag_href == NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_self->_tag_name == NULL);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":110 */
    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_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("etree._IterparseResolverContext._setEventFilter");
__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);
}


static void __pyx_f_5etree_25_IterparseResolverContext_startNode(struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_self,xmlNode (*__pyx_v_c_node)) {
struct LxmlElement *__pyx_v_node;
int __pyx_v_ns_count;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":116 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_START_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":117 */
  __pyx_v_ns_count = __pyx_f_5etree__appendStartNsEvents(__pyx_v_c_node,__pyx_v_self->_events);
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":119 */
  __pyx_v_ns_count = __pyx_f_5etree__countNsDefs(__pyx_v_c_node);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":120 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":121 */
  __pyx_2 = PyInt_FromLong(__pyx_v_ns_count); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 121; goto __pyx_L1;}
  __pyx_1 = PyList_Append(__pyx_v_self->_ns_stack,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 121; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":122 */
__pyx_1 = __pyx_v_self->_doc == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":123 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 123; goto __pyx_L1;}
  __pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_node->doc,((struct __pyx_obj_5etree__BaseParser *)Py_None))); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 123; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_self->_doc));
  __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":124 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 124; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 124; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_self->_root));
  __pyx_v_self->_root = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":125 */
__pyx_1 = __pyx_v_self->_tag_tuple == Py_None;
if (!__pyx_1) {
  __pyx_1 = __pyx_f_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":127 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_self->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 127; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":128 */
  __pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":129 */
    __pyx_1 = PyList_Append(__pyx_v_self->_node_stack,((PyObject *)__pyx_v_node)); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 129; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":130 */
  __pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_START);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":131 */
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 131; goto __pyx_L1;}
    Py_INCREF(__pyx_n_start);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_start);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_node));
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 131; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L5;
}
__pyx_L5:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._IterparseResolverContext.startNode");
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_k375p;

static char (__pyx_k375[]) = "end-ns";

static void __pyx_f_5etree_25_IterparseResolverContext_endNode(struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_self,xmlNode (*__pyx_v_c_node)) {
struct LxmlElement *__pyx_v_node;
int __pyx_v_ns_count;
PyObject *__pyx_v_event;
PyObject *__pyx_v_i;
int __pyx_1;
PyObject *__pyx_2 = 0;
long __pyx_3;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_node = ((struct LxmlElement *)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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":137 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":138 */
  __pyx_1 = __pyx_v_self->_tag_tuple == Py_None;
  if (!__pyx_1) {
    __pyx_1 = __pyx_f_5etree__tagMatches(__pyx_v_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":140 */
    __pyx_1 = (__pyx_v_self->_event_filter & ((__pyx_e_5etree_ITERPARSE_FILTER_START | __pyx_e_5etree_ITERPARSE_FILTER_START_NS) | __pyx_e_5etree_ITERPARSE_FILTER_END_NS));
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":143 */
      __pyx_2 = PyObject_CallObject(__pyx_v_self->_pop_node, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 143; goto __pyx_L1;}
      if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 143; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_2);
      __pyx_2 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":144 */
      #ifndef PYREX_WITHOUT_ASSERTIONS
      if (!(__pyx_v_node->_c_node == __pyx_v_c_node)) {
        PyErr_SetNone(PyExc_AssertionError);
        {__pyx_filename = __pyx_f[9]; __pyx_lineno = 144; goto __pyx_L1;}
      }
      #endif
      goto __pyx_L4;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":146 */
      __pyx_1 = __pyx_v_self->_doc == Py_None;
      if (__pyx_1) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":147 */
        if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 147; goto __pyx_L1;}
        __pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_node->doc,((struct __pyx_obj_5etree__BaseParser *)Py_None))); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 147; goto __pyx_L1;}
        Py_DECREF(((PyObject *)__pyx_v_self->_doc));
        __pyx_v_self->_doc = ((struct LxmlDocument *)__pyx_2);
        __pyx_2 = 0;

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":148 */
        __pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_self->_doc->__pyx_vtab)->getroot(__pyx_v_self->_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 148; goto __pyx_L1;}
        if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 148; goto __pyx_L1;}
        Py_DECREF(((PyObject *)__pyx_v_self->_root));
        __pyx_v_self->_root = ((struct LxmlElement *)__pyx_2);
        __pyx_2 = 0;
        goto __pyx_L5;
      }
      __pyx_L5:;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":149 */
      __pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_self->_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 149; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_2);
      __pyx_2 = 0;
    }
    __pyx_L4:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":150 */
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 150; goto __pyx_L1;}
    Py_INCREF(__pyx_n_end);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_end);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_node));
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 150; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":152 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":153 */
  __pyx_2 = PyObject_CallObject(__pyx_v_self->_pop_ns, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 153; goto __pyx_L1;}
  __pyx_1 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 153; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_ns_count = __pyx_1;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":154 */
  __pyx_1 = (__pyx_v_ns_count > 0);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":155 */
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 155; goto __pyx_L1;}
    Py_INCREF(__pyx_k375p);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k375p);
    Py_INCREF(Py_None);
    PyTuple_SET_ITEM(__pyx_2, 1, Py_None);
    Py_DECREF(__pyx_v_event);
    __pyx_v_event = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":156 */
    for (__pyx_3 = 0; __pyx_3 < __pyx_v_ns_count; ++__pyx_3) {
      __pyx_2 = PyInt_FromLong(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 156; goto __pyx_L1;}
      Py_DECREF(__pyx_v_i);
      __pyx_v_i = __pyx_2;
      __pyx_2 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":157 */
      __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_v_event); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 157; goto __pyx_L1;}
    }
    goto __pyx_L7;
  }
  __pyx_L7:;
  goto __pyx_L6;
}
__pyx_L6:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._IterparseResolverContext.endNode");
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_event);
Py_DECREF(__pyx_v_i);
Py_DECREF((PyObject *)__pyx_v_self);
}

static void __pyx_f_5etree__pushSaxStartEvent(xmlParserCtxt (*__pyx_v_c_ctxt),xmlNode (*__pyx_v_c_node)) {
struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":162 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":163 */
((struct __pyx_vtabstruct_5etree__IterparseResolverContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->startNode(__pyx_v_context,__pyx_v_c_node);

Py_DECREF((PyObject *)__pyx_v_context);
}

static void __pyx_f_5etree__pushSaxEndEvent(xmlParserCtxt (*__pyx_v_c_ctxt),xmlNode (*__pyx_v_c_node)) {
struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":167 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":168 */
((struct __pyx_vtabstruct_5etree__IterparseResolverContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->endNode(__pyx_v_context,__pyx_v_c_node);

Py_DECREF((PyObject *)__pyx_v_context);
}

static startElementNsSAX2Func __pyx_f_5etree__getOrigStart(xmlParserCtxt (*__pyx_v_c_ctxt)) {
startElementNsSAX2Func __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":171 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_1)->_origSaxStart;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static endElementNsSAX2Func __pyx_f_5etree__getOrigEnd(xmlParserCtxt (*__pyx_v_c_ctxt)) {
endElementNsSAX2Func __pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":174 */
__pyx_1 = (PyObject *)__pyx_v_c_ctxt->_private;
Py_INCREF(__pyx_1);
__pyx_r = ((struct __pyx_obj_5etree__IterparseResolverContext *)__pyx_1)->_origSaxEnd;
Py_DECREF(__pyx_1); __pyx_1 = 0;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree__saxStart(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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":182 */
__pyx_v_c_ctxt = ((xmlParserCtxt (*))__pyx_v_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":183 */
__pyx_v_origStart = __pyx_f_5etree__getOrigStart(__pyx_v_c_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":184 */
__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":186 */
__pyx_f_5etree__pushSaxStartEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

}

static void __pyx_f_5etree__saxEnd(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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":192 */
__pyx_v_c_ctxt = ((xmlParserCtxt (*))__pyx_v_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":193 */
__pyx_f_5etree__pushSaxEndEvent(__pyx_v_c_ctxt,__pyx_v_c_ctxt->node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":194 */
__pyx_v_origEnd = __pyx_f_5etree__getOrigEnd(__pyx_v_c_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":195 */
__pyx_v_origEnd(__pyx_v_ctxt,__pyx_v_localname,__pyx_v_prefix,__pyx_v_URI);

}

static PyObject *__pyx_n_open;
static PyObject *__pyx_n_rb;


static int __pyx_f_5etree_9iterparse___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_context;
char (*__pyx_v_c_filename);
int __pyx_v_parse_options;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
char (*__pyx_5);
static char *__pyx_argnames[] = {"source","events","tag","attribute_defaults","dtd_validation","load_dtd","no_network","remove_blank_text",0};
__pyx_v_events = __pyx_k134;
__pyx_v_tag = __pyx_k135;
__pyx_v_attribute_defaults = __pyx_k136;
__pyx_v_dtd_validation = __pyx_k137;
__pyx_v_load_dtd = __pyx_k138;
__pyx_v_no_network = __pyx_k139;
__pyx_v_remove_blank_text = __pyx_k140;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOOOOOO", __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)) 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);
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":236 */
__pyx_1 = (!hasattr(__pyx_v_source,__pyx_n_read));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":237 */
  __pyx_2 = __pyx_f_5etree__encodeFilename(__pyx_v_source); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 237; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename);
  ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":238 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_open); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 238; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_INCREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename);
  PyTuple_SET_ITEM(__pyx_3, 0, ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename);
  Py_INCREF(__pyx_n_rb);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_n_rb);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":240 */
  __pyx_2 = __pyx_f_5etree__getFilenameForFile(__pyx_v_source); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 240; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename);
  ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":241 */
  __pyx_1 = ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename != Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":242 */
    __pyx_3 = __pyx_f_5etree__encodeFilename(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 242; goto __pyx_L1;}
    Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename);
    ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":243 */
__pyx_1 = ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":244 */
  __pyx_5 = PyString_AsString(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 244; goto __pyx_L1;}
  __pyx_v_c_filename = __pyx_5;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":246 */
  __pyx_v_c_filename = NULL;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":248 */
Py_INCREF(__pyx_v_source);
Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source);
((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source = __pyx_v_source;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":249 */
__pyx_4 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseParser), __pyx_n___init__); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 249; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 249; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject*)__pyx_ptype_5etree__IterparseResolverContext));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject*)__pyx_ptype_5etree__IterparseResolverContext));
__pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 249; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":251 */
__pyx_v_parse_options = __pyx_v_5etree__XML_DEFAULT_PARSE_OPTIONS;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":252 */
__pyx_1 = PyObject_IsTrue(__pyx_v_load_dtd); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 252; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":253 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_DTDLOAD);
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":254 */
__pyx_1 = PyObject_IsTrue(__pyx_v_dtd_validation); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 254; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":255 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDVALID) | XML_PARSE_DTDLOAD);
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":257 */
__pyx_1 = PyObject_IsTrue(__pyx_v_attribute_defaults); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 257; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":258 */
  __pyx_v_parse_options = ((__pyx_v_parse_options | XML_PARSE_DTDATTR) | XML_PARSE_DTDLOAD);
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":260 */
__pyx_1 = PyObject_IsTrue(__pyx_v_no_network); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 260; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":261 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NONET);
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":262 */
__pyx_1 = PyObject_IsTrue(__pyx_v_remove_blank_text); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 262; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":263 */
  __pyx_v_parse_options = (__pyx_v_parse_options | XML_PARSE_NOBLANKS);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":264 */
((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parse_options = __pyx_v_parse_options;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":266 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__IterparseResolverContext *)((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._context)));
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":267 */
((struct __pyx_vtabstruct_5etree__IterparseResolverContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_setEventFilter(__pyx_v_context,__pyx_v_events,__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":268 */
((struct __pyx_vtabstruct_5etree__IterparseResolverContext *)__pyx_v_context->__pyx_base.__pyx_base.__pyx_vtab)->_wrapCallbacks(__pyx_v_context,((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt->sax);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":269 */
xmlCtxtUseOptions(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt,__pyx_v_parse_options);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":270 */
xmlCtxtResetPush(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt,NULL,0,__pyx_v_c_filename,NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":271 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_iterparse *)((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._lockParser(((struct __pyx_obj_5etree__BaseParser *)__pyx_v_self)); if (__pyx_1 == 1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 271; goto __pyx_L1;}

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree.iterparse.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_context);
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);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":274 */
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;
}

static PyObject *__pyx_k378p;

static char (__pyx_k378[]) = "reading file objects must return plain strings";

static PyObject *__pyx_f_5etree_9iterparse___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_9iterparse___next__(PyObject *__pyx_v_self) {
struct __pyx_obj_5etree__IterparseResolverContext *__pyx_v_context;
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;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":280 */
__pyx_1 = ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":281 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 281; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":282 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__IterparseResolverContext *)((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._context)));
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__IterparseResolverContext *)((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":283 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) > __pyx_v_context->_event_index);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":284 */
  __pyx_2 = PyList_GET_ITEM(__pyx_v_context->_events,__pyx_v_context->_event_index); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 284; goto __pyx_L1;}
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":285 */
  Py_INCREF(__pyx_v_item);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":286 */
  __pyx_v_context->_event_index = (__pyx_v_context->_event_index + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":287 */
  Py_INCREF(__pyx_v_item);
  __pyx_r = __pyx_v_item;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":289 */
if (PySequence_DelSlice(__pyx_v_context->_events, 0, PY_SSIZE_T_MAX) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 289; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":290 */
__pyx_v_error = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":291 */
while (1) {
  __pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) == 0);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_error == 0);
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":292 */
  __pyx_2 = PyObject_GetAttr(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source, __pyx_n_read); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 292; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 292; goto __pyx_L1;}
  Py_INCREF(__pyx_v_5etree___ITERPARSE_CHUNK_SIZE);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_5etree___ITERPARSE_CHUNK_SIZE);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 292; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":293 */
  __pyx_1 = (!PyString_Check(__pyx_v_data));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":295 */
    Py_INCREF(Py_None);
    Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source);
    ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":296 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 296; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k378p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[9]; __pyx_lineno = 296; goto __pyx_L1;}
    goto __pyx_L6;
  }
  __pyx_1 = PyObject_IsTrue(__pyx_v_data); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 297; goto __pyx_L1;}
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":298 */
    __pyx_v_error = xmlParseChunk(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt,_cstr(__pyx_v_data),PyString_GET_SIZE(__pyx_v_data),0);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":302 */
    __pyx_v_error = xmlParseChunk(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt,NULL,0,1);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":303 */
    Py_INCREF(Py_None);
    Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source);
    ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":304 */
    goto __pyx_L5;
  }
  __pyx_L6:;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":305 */
__pyx_1 = (__pyx_v_error != 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":306 */
  Py_INCREF(Py_None);
  Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source);
  ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_source = Py_None;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":307 */
  __pyx_1 = __pyx_f_5etree__raiseParseError(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->__pyx_base._parser_ctxt,((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->_filename); if (__pyx_1 == 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 307; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":308 */
__pyx_1 = (PyList_GET_SIZE(__pyx_v_context->_events) == 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":309 */
  Py_INCREF(((PyObject *)__pyx_v_context->_root));
  Py_DECREF(((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->root);
  ((struct __pyx_obj_5etree_iterparse *)__pyx_v_self)->root = ((PyObject *)__pyx_v_context->_root);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":310 */
  __Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
  {__pyx_filename = __pyx_f[9]; __pyx_lineno = 310; goto __pyx_L1;}
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":312 */
__pyx_v_context->_event_index = 1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":313 */
__pyx_3 = PyList_GET_ITEM(__pyx_v_context->_events,0); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 313; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":314 */
Py_INCREF(__pyx_v_element);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":315 */
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("etree.iterparse.__next__");
__pyx_r = 0;
__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;
}

static int __pyx_f_5etree_8iterwalk___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
static char *__pyx_argnames[] = {"element_or_tree","events","tag",0};
__pyx_v_events = __pyx_k142;
__pyx_v_tag = __pyx_k143;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":335 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_element_or_tree)); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 335; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root));
__pyx_v_root = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":336 */
((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_event_filter = __pyx_f_5etree__buildIterparseEventFilter(__pyx_v_events);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":337 */
((struct __pyx_vtabstruct_5etree_iterwalk *)((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_setTagFilter(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self),__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":338 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 338; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack);
((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":339 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack, __pyx_n_pop); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 339; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_node);
((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_node = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":340 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 340; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_events);
((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_events = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":341 */
__pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_events, __pyx_n_pop); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 341; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_event);
((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_event = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":343 */
__pyx_2 = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_event_filter != 0);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":344 */
  ((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":345 */
  __pyx_v_ns_count = ((struct __pyx_vtabstruct_5etree_iterwalk *)((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_start_node(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self),__pyx_v_root);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":346 */
  __pyx_1 = PyInt_FromLong(__pyx_v_ns_count); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 346; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 346; 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_2 = PyList_Append(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack,__pyx_3); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 346; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":348 */
  ((struct __pyx_obj_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("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;
}

static PyObject *__pyx_k379p;
static PyObject *__pyx_k380p;
static PyObject *__pyx_k381p;

static char (__pyx_k379[]) = "*";
static char (__pyx_k380[]) = "*";
static char (__pyx_k381[]) = "*";

static void __pyx_f_5etree_8iterwalk__setTagFilter(struct __pyx_obj_5etree_iterwalk *__pyx_v_self,PyObject *__pyx_v_tag) {
PyObject *__pyx_v_href;
PyObject *__pyx_v_name;
int __pyx_1;
PyObject *__pyx_2 = 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":351 */
__pyx_1 = __pyx_v_tag == Py_None;
if (!__pyx_1) {
  if (PyObject_Cmp(__pyx_v_tag, __pyx_k379p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 351; goto __pyx_L1;}
  __pyx_1 = __pyx_1 == 0;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":352 */
  __pyx_v_self->_tag_href = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":353 */
  __pyx_v_self->_tag_name = NULL;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":355 */
  __pyx_2 = __pyx_f_5etree__getNsTag(__pyx_v_tag); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 355; goto __pyx_L1;}
  Py_DECREF(__pyx_v_self->_tag_tuple);
  __pyx_v_self->_tag_tuple = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":356 */
  __pyx_2 = PyObject_GetIter(__pyx_v_self->_tag_tuple); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 356; goto __pyx_L1;}
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_DECREF(__pyx_v_href);
  __pyx_v_href = __pyx_3;
  __pyx_3 = 0;
  __pyx_3 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_3;
  __pyx_3 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 356; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":357 */
  __pyx_1 = __pyx_v_href == Py_None;
  if (!__pyx_1) {
    if (PyObject_Cmp(__pyx_v_href, __pyx_k380p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 357; goto __pyx_L1;}
    __pyx_1 = __pyx_1 == 0;
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":358 */
    __pyx_v_self->_tag_href = NULL;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":360 */
    __pyx_v_self->_tag_href = _cstr(__pyx_v_href);
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":361 */
  __pyx_1 = __pyx_v_name == Py_None;
  if (!__pyx_1) {
    if (PyObject_Cmp(__pyx_v_name, __pyx_k381p, &__pyx_1) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 361; goto __pyx_L1;}
    __pyx_1 = __pyx_1 == 0;
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":362 */
    __pyx_v_self->_tag_name = NULL;
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":364 */
    __pyx_v_self->_tag_name = _cstr(__pyx_v_name);
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":365 */
  __pyx_1 = (__pyx_v_self->_tag_href == NULL);
  if (__pyx_1) {
    __pyx_1 = (__pyx_v_self->_tag_name == NULL);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":366 */
    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_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("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);
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":369 */
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;
}

static PyObject *__pyx_n_getnext;

static PyObject *__pyx_f_5etree_8iterwalk___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_8iterwalk___next__(PyObject *__pyx_v_self) {
struct LxmlElement *__pyx_v_node;
struct LxmlElement *__pyx_v_next_node;
int __pyx_v_ns_count;
PyObject *__pyx_v_node_tuple;
PyObject *__pyx_r;
Py_ssize_t __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
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);
__pyx_v_node_tuple = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":375 */
__pyx_1 = PyList_GET_SIZE(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_events);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":376 */
  __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 376; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 376; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_event, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 376; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":377 */
__pyx_v_ns_count = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":379 */
while (1) {
  __pyx_4 = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index >= 0);
  if (!__pyx_4) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":380 */
  __pyx_3 = PyList_GET_ITEM(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack,((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 380; goto __pyx_L1;}
  Py_DECREF(__pyx_v_node_tuple);
  __pyx_v_node_tuple = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":381 */
  Py_INCREF(__pyx_v_node_tuple);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":382 */
  __pyx_2 = PyTuple_GET_ITEM(__pyx_v_node_tuple,0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 382; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 382; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_node));
  __pyx_v_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":383 */
  Py_INCREF(((PyObject *)__pyx_v_node));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":384 */
  __pyx_4 = PyObject_IsTrue(((PyObject *)__pyx_v_node)); if (__pyx_4 < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 384; goto __pyx_L1;}
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":386 */
    __pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 386; goto __pyx_L1;}
    __pyx_2 = PyObject_GetItem(((PyObject *)__pyx_v_node), __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 386; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 386; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_next_node));
    __pyx_v_next_node = ((struct LxmlElement *)__pyx_2);
    __pyx_2 = 0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":389 */
    if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 389; goto __pyx_L1;}
    Py_INCREF(Py_None);
    Py_DECREF(((PyObject *)__pyx_v_next_node));
    __pyx_v_next_node = ((struct LxmlElement *)Py_None);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":390 */
    while (1) {
      __pyx_4 = __pyx_v_next_node == Py_None;
      if (!__pyx_4) break;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":392 */
      ((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index - 1);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":393 */
      __pyx_3 = ((PyObject *)((struct __pyx_vtabstruct_5etree_iterwalk *)((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_end_node(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self))); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 393; goto __pyx_L1;}
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_3);
      __pyx_3 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":394 */
      __pyx_4 = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index < 0);
      if (__pyx_4) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":395 */
        goto __pyx_L7;
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":396 */
      __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_node), __pyx_n_getnext); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; goto __pyx_L1;}
      __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; goto __pyx_L1;}
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 396; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":397 */
  __pyx_4 = __pyx_v_next_node != Py_None;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":398 */
    __pyx_4 = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_event_filter & (__pyx_e_5etree_ITERPARSE_FILTER_START | __pyx_e_5etree_ITERPARSE_FILTER_START_NS));
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":400 */
      __pyx_v_ns_count = ((struct __pyx_vtabstruct_5etree_iterwalk *)((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->__pyx_vtab)->_start_node(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self),__pyx_v_next_node);
      goto __pyx_L10;
    }
    __pyx_4 = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":402 */
      __pyx_v_ns_count = __pyx_f_5etree__countNsDefs(__pyx_v_next_node->_c_node);
      goto __pyx_L10;
    }
    __pyx_L10:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":403 */
    __pyx_2 = PyInt_FromLong(__pyx_v_ns_count); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 403; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 403; goto __pyx_L1;}
    Py_INCREF(((PyObject *)__pyx_v_next_node));
    PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)__pyx_v_next_node));
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
    __pyx_2 = 0;
    __pyx_4 = PyList_Append(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_node_stack,__pyx_3); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 403; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":404 */
    ((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index = (((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_index + 1);
    goto __pyx_L9;
  }
  __pyx_L9:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":405 */
  __pyx_1 = PyList_GET_SIZE(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_events);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":406 */
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 406; goto __pyx_L1;}
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 406; goto __pyx_L1;}
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
    __pyx_2 = 0;
    __pyx_2 = PyObject_CallObject(((struct __pyx_obj_5etree_iterwalk *)__pyx_v_self)->_pop_event, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 406; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":407 */
__Pyx_Raise(__pyx_v_5etree_StopIteration, 0, 0);
{__pyx_filename = __pyx_f[9]; __pyx_lineno = 407; 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("etree.iterwalk.__next__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_next_node);
Py_DECREF(__pyx_v_node_tuple);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}


static int __pyx_f_5etree_8iterwalk__start_node(struct __pyx_obj_5etree_iterwalk *__pyx_v_self,struct LxmlElement *__pyx_v_node) {
int __pyx_v_ns_count;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":411 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_START_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":412 */
  __pyx_v_ns_count = __pyx_f_5etree__appendStartNsEvents(__pyx_v_node->_c_node,__pyx_v_self->_events);
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":414 */
  __pyx_v_ns_count = __pyx_f_5etree__countNsDefs(__pyx_v_node->_c_node);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":416 */
  __pyx_v_ns_count = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":417 */
__pyx_1 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_START);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":418 */
  __pyx_1 = __pyx_v_self->_tag_tuple == Py_None;
  if (!__pyx_1) {
    __pyx_1 = __pyx_f_5etree__tagMatches(__pyx_v_node->_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":420 */
    __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 420; goto __pyx_L1;}
    Py_INCREF(__pyx_n_start);
    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_start);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_node));
    __pyx_1 = PyList_Append(__pyx_v_self->_events,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 420; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":421 */
__pyx_r = __pyx_v_ns_count;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree.iterwalk._start_node");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_node);
return __pyx_r;
}

static PyObject *__pyx_k384p;

static char (__pyx_k384[]) = "end-ns";

static struct LxmlElement *__pyx_f_5etree_8iterwalk__end_node(struct __pyx_obj_5etree_iterwalk *__pyx_v_self) {
struct LxmlElement *__pyx_v_node;
PyObject *__pyx_v_ns_count;
PyObject *__pyx_v_event;
PyObject *__pyx_v_i;
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
long __pyx_4;
long __pyx_5;
Py_INCREF(__pyx_v_self);
__pyx_v_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_ns_count = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":425 */
__pyx_1 = PyObject_CallObject(__pyx_v_self->_pop_node, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_node));
__pyx_v_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_count);
__pyx_v_ns_count = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 425; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":426 */
__pyx_3 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":427 */
  __pyx_3 = __pyx_v_self->_tag_tuple == Py_None;
  if (!__pyx_3) {
    __pyx_3 = __pyx_f_5etree__tagMatches(__pyx_v_node->_c_node,__pyx_v_self->_tag_href,__pyx_v_self->_tag_name);
  }
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":429 */
    __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 429; goto __pyx_L1;}
    Py_INCREF(__pyx_n_end);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_end);
    Py_INCREF(((PyObject *)__pyx_v_node));
    PyTuple_SET_ITEM(__pyx_1, 1, ((PyObject *)__pyx_v_node));
    __pyx_3 = PyList_Append(__pyx_v_self->_events,__pyx_1); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 429; goto __pyx_L1;}
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":430 */
__pyx_3 = (__pyx_v_self->_event_filter & __pyx_e_5etree_ITERPARSE_FILTER_END_NS);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":431 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 431; goto __pyx_L1;}
  Py_INCREF(__pyx_k384p);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k384p);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_2, 1, Py_None);
  Py_DECREF(__pyx_v_event);
  __pyx_v_event = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":432 */
  __pyx_5 = PyInt_AsLong(__pyx_v_ns_count); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 432; goto __pyx_L1;}
  for (__pyx_4 = 0; __pyx_4 < __pyx_5; ++__pyx_4) {
    __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 432; goto __pyx_L1;}
    Py_DECREF(__pyx_v_i);
    __pyx_v_i = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":433 */
    __pyx_3 = PyList_Append(__pyx_v_self->_events,__pyx_v_event); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 433; goto __pyx_L1;}
  }
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":434 */
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);
__Pyx_AddTraceback("etree.iterwalk._end_node");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_node);
Py_DECREF(__pyx_v_ns_count);
Py_DECREF(__pyx_v_event);
Py_DECREF(__pyx_v_i);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k385p;

static char (__pyx_k385[]) = "//*[string(@id)]";

static PyObject *__pyx_f_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_XMLID(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
PyObject *__pyx_v_root;
PyObject *__pyx_v_dic;
PyObject *__pyx_v_elem;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
int __pyx_5;
static char *__pyx_argnames[] = {"text",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_text)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":8 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XML); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; 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 (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":10 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_v_dic);
__pyx_v_dic = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":11 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_root);
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_xpath); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_INCREF(__pyx_k385p);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k385p);
__pyx_1 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 11; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_elem);
  __pyx_v_elem = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":12 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_elem, __pyx_n_get); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 12; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_INCREF(__pyx_n_id);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_n_id);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_5 = PyDict_SetItem(__pyx_v_dic,__pyx_4,__pyx_v_elem); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 12; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":13 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 13; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_root);
Py_INCREF(__pyx_v_dic);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_dic);
__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("etree.XMLID");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_XMLDTDID(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_text = 0;
struct LxmlElement *__pyx_v_root;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"text",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_text)) return 0;
Py_INCREF(__pyx_v_text);
__pyx_v_root = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":26 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XML); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; 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 (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 26; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root));
__pyx_v_root = ((struct LxmlElement *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":28 */
__pyx_4 = (__pyx_v_root->_doc->_c_doc->ids == NULL);
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":29 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 29; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 29; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":31 */
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; 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_5etree__IDDict), __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 31; 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("etree.XMLDTDID");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_parseid(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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_k144;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_source, &__pyx_v_parser)) return 0;
Py_INCREF(__pyx_v_source);
Py_INCREF(__pyx_v_parser);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":42 */
if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 42; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__parseDocument(__pyx_v_source,((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser))); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 42; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":43 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->getroot(__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_2);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_doc));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_doc));
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__IDDict), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 43; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_3);
__pyx_2 = 0;
__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);
__Pyx_AddTraceback("etree.parseid");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_source);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static PyObject *__pyx_k387p;

static char (__pyx_k387[]) = "No ID dictionary available.";

static int __pyx_f_5etree_7_IDDict___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":57 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_etree)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 57; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":58 */
__pyx_2 = (__pyx_v_doc->_c_doc->ids == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":59 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k387p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[10]; __pyx_lineno = 59; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":60 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc));
((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc = __pyx_v_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":61 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":62 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items);
((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items = Py_None;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_n_IDDict;

static PyObject *__pyx_f_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict_copy(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":65 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_IDDict); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 65; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 65; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 65; 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("etree._IDDict.copy");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k388p;
static PyObject *__pyx_k389p;

static char (__pyx_k388[]) = "Key not found.";
static char (__pyx_k389[]) = "ID attribute not found.";

static PyObject *__pyx_f_5etree_7_IDDict___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":71 */
__pyx_v_c_ids = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":72 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_id_name); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 72; goto __pyx_L1;}
Py_DECREF(__pyx_v_id_utf);
__pyx_v_id_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":73 */
__pyx_v_c_id = ((xmlID (*))xmlHashLookup(__pyx_v_c_ids,_cstr(__pyx_v_id_utf)));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":74 */
__pyx_2 = (__pyx_v_c_id == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":75 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k388p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[10]; __pyx_lineno = 75; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":76 */
__pyx_v_c_attr = __pyx_v_c_id->attr;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":77 */
__pyx_2 = (__pyx_v_c_attr == NULL);
if (!__pyx_2) {
  __pyx_2 = (__pyx_v_c_attr->parent == NULL);
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":78 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_KeyError); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 78; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k389p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[10]; __pyx_lineno = 78; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":79 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc,__pyx_v_c_attr->parent)); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 79; 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("etree._IDDict.__getitem__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_id_utf);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_id_name = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"id_name",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_id_name)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":82 */
__pyx_1 = PyObject_GetItem(__pyx_v_self, __pyx_v_id_name); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 82; 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("etree._IDDict.get");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

static int __pyx_f_5etree_7_IDDict___contains__(PyObject *__pyx_v_self, PyObject *__pyx_v_id_name); /*proto*/
static int __pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":86 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_id_name); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 86; goto __pyx_L1;}
Py_DECREF(__pyx_v_id_utf);
__pyx_v_id_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":87 */
__pyx_v_c_id = ((xmlID (*))xmlHashLookup(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_doc->_c_doc->ids,_cstr(__pyx_v_id_utf)));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":89 */
__pyx_r = (__pyx_v_c_id != NULL);
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_f_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict_has_key(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_id_name = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"id_name",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_id_name)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_id_name);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":92 */
__pyx_1 = PySequence_Contains(__pyx_v_self, __pyx_v_id_name); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 92; goto __pyx_L1;}
__pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 92; 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("etree._IDDict.has_key");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_id_name);
return __pyx_r;
}

static PyObject *__pyx_n_cmp;

static int __pyx_f_5etree_7_IDDict___cmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other); /*proto*/
static int __pyx_f_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;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_other);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":95 */
__pyx_1 = __pyx_v_other == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":96 */
  __pyx_r = 1;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":98 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_cmp); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_self);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
  Py_INCREF(__pyx_v_other);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_other);
  __pyx_5 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 98; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_r = __pyx_1;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._IDDict.__cmp__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict___richcmp__(PyObject *__pyx_v_self, PyObject *__pyx_v_other, int __pyx_v_op); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_other);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":102 */
__pyx_1 = __pyx_v_other == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":103 */
  __pyx_1 = (__pyx_v_op == 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_op == 1);
    if (!__pyx_1) {
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 103; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":104 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_cmp); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_self);
__pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_5);
Py_INCREF(__pyx_v_other);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_other);
__pyx_5 = 0;
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = PyInt_AsLong(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 104; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_v_c_cmp = __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":105 */
__pyx_1 = (__pyx_v_c_cmp == 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":106 */
  __pyx_1 = (__pyx_v_op == 1);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_op == 2);
    if (!__pyx_1) {
      __pyx_1 = (__pyx_v_op == 5);
    }
  }
  __pyx_5 = PyInt_FromLong(__pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 106; goto __pyx_L1;}
  __pyx_r = __pyx_5;
  __pyx_5 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_1 = (__pyx_v_c_cmp < 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":108 */
  __pyx_1 = (__pyx_v_op == 0);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_op == 1);
    if (!__pyx_1) {
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 108; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":110 */
  __pyx_1 = (__pyx_v_op == 4);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_op == 5);
    if (!__pyx_1) {
      __pyx_1 = (__pyx_v_op == 3);
    }
  }
  __pyx_3 = PyInt_FromLong(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 110; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 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);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._IDDict.__richcmp__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_other);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict___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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":113 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_dict); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; 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 (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = repr(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 113; 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);
__Pyx_AddTraceback("etree._IDDict.__repr__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":116 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":117 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 117; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":118 */
__pyx_2 = PySequence_GetSlice(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys, 0, PY_SSIZE_T_MAX); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 118; 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("etree._IDDict.keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict___iter__(PyObject *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":121 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":122 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 122; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":123 */
__pyx_2 = iter(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 123; 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("etree._IDDict.__iter__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict_iterkeys(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_r;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":126 */
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;
}

static Py_ssize_t __pyx_f_5etree_7_IDDict___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_f_5etree_7_IDDict___len__(PyObject *__pyx_v_self) {
Py_ssize_t __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_ssize_t __pyx_5;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":129 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":130 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_keys(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 130; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":131 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
Py_INCREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
PyTuple_SET_ITEM(__pyx_3, 0, ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_keys);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_5 = PyInt_AsSsize_t(__pyx_4); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 131; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
__pyx_r = __pyx_5;
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("etree._IDDict.__len__");
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":134 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":135 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 135; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":136 */
__pyx_2 = PySequence_GetSlice(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items, 0, PY_SSIZE_T_MAX); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 136; 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("etree._IDDict.items");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":139 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":140 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 140; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":141 */
__pyx_2 = iter(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 141; 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("etree._IDDict.iteritems");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_7_IDDict_values(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_values;
PyObject *__pyx_v_item;
PyObject *__pyx_v_value;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":144 */
__pyx_1 = ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":145 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__IDDict *)((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->__pyx_vtab)->_build_items(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 145; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items);
  ((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":146 */
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_v_values);
__pyx_v_values = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":147 */
__pyx_2 = PyObject_GetIter(((struct __pyx_obj_5etree__IDDict *)__pyx_v_self)->_items); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 147; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 147; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_item);
  __pyx_v_item = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":148 */
  __pyx_3 = PyTuple_GET_ITEM(__pyx_v_item,1); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":149 */
  Py_INCREF(__pyx_v_value);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":150 */
  __pyx_1 = PyList_Append(__pyx_v_values,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 150; goto __pyx_L1;}
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":151 */
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_3);
__Pyx_AddTraceback("etree._IDDict.values");
__pyx_r = 0;
__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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":154 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_values); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = iter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 154; 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("etree._IDDict.itervalues");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict__build_keys(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":157 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 157; goto __pyx_L1;}
Py_DECREF(__pyx_v_keys);
__pyx_v_keys = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":158 */
xmlHashScan(((xmlHashTable (*))__pyx_v_self->_doc->_c_doc->ids),__pyx_f_5etree__collectIdHashKeys,((PyObject (*))__pyx_v_keys));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":160 */
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("etree._IDDict._build_keys");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_keys);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_7_IDDict__build_items(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":163 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_v_items);
__pyx_v_items = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":164 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 164; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":165 */
xmlHashScan(((xmlHashTable (*))__pyx_v_self->_doc->_c_doc->ids),__pyx_f_5etree__collectIdHashItemList,((PyObject (*))__pyx_v_context));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":167 */
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("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;
}

static void __pyx_f_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;
__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":172 */
__pyx_v_c_id = ((xmlID (*))__pyx_v_payload);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":173 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":174 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":175 */
__pyx_2 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_2);
__pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_v_dic);
__pyx_v_dic = __pyx_2;
__pyx_2 = 0;
__pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_v_doc);
__pyx_v_doc = __pyx_2;
__pyx_2 = 0;
if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":176 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 176; goto __pyx_L1;}
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_id->attr->parent)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":177 */
__pyx_3 = __pyx_f_5etree_funicode(__pyx_v_name); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 177; goto __pyx_L1;}
__pyx_1 = PyDict_SetItem(__pyx_v_dic,__pyx_3,__pyx_v_element); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 177; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("etree._collectIdHashItemDict");
__pyx_L0:;
Py_DECREF(__pyx_v_dic);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
}

static void __pyx_f_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;
__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":182 */
__pyx_v_c_id = ((xmlID (*))__pyx_v_payload);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":183 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":184 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":185 */
__pyx_2 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_2);
__pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 185; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 185; goto __pyx_L1;}
Py_DECREF(__pyx_v_lst);
__pyx_v_lst = __pyx_2;
__pyx_2 = 0;
__pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 185; goto __pyx_L1;}
Py_DECREF(__pyx_v_doc);
__pyx_v_doc = __pyx_2;
__pyx_2 = 0;
if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 185; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":186 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 186; goto __pyx_L1;}
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_id->attr->parent)); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 186; goto __pyx_L1;}
Py_DECREF(__pyx_v_element);
__pyx_v_element = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":187 */
__pyx_3 = __pyx_f_5etree_funicode(__pyx_v_name); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 187; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 187; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
Py_INCREF(__pyx_v_element);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_element);
__pyx_3 = 0;
__pyx_1 = PyList_Append(__pyx_v_lst,__pyx_2); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 187; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("etree._collectIdHashItemList");
__pyx_L0:;
Py_DECREF(__pyx_v_lst);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_element);
}

static void __pyx_f_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;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":191 */
__pyx_v_c_id = ((xmlID (*))__pyx_v_payload);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":192 */
__pyx_1 = (__pyx_v_c_id == NULL);
if (!__pyx_1) {
  __pyx_1 = (__pyx_v_c_id->attr == NULL);
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c_id->attr->parent == NULL);
  }
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":193 */
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":194 */
__pyx_2 = (PyObject *)__pyx_v_collect_list;
Py_INCREF(__pyx_2);
__pyx_3 = __pyx_f_5etree_funicode(__pyx_v_name); if (!__pyx_3) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; goto __pyx_L1;}
__pyx_1 = PyList_Append(__pyx_2,__pyx_3); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 194; 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("etree._collectIdHashKeys");
__pyx_L0:;
}

static PyObject *__pyx_k390p;

static char (__pyx_k390[]) = "extensions must have non empty names";

static int __pyx_f_5etree_12_BaseContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_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;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
__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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":29 */
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":30 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 30; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_utf_refs);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_utf_refs = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":31 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 31; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_function_cache);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_function_cache = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":32 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 32; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_function_cache_ns);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_function_cache_ns = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":33 */
Py_INCREF(Py_None);
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_called_function);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_called_function = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":35 */
__pyx_2 = __pyx_v_extensions != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":37 */
  __pyx_2 = PyDict_Check(__pyx_v_extensions);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":38 */
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 38; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":40 */
  __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 40; goto __pyx_L1;}
  Py_DECREF(__pyx_v_new_extensions);
  __pyx_v_new_extensions = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":41 */
  __pyx_1 = PyObject_GetIter(__pyx_v_extensions); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 41; goto __pyx_L1;}
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 41; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_extension);
    __pyx_v_extension = __pyx_3;
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":42 */
    __pyx_3 = PyObject_GetAttr(__pyx_v_extension, __pyx_n_items); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
    __pyx_4 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = PyObject_GetIter(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    for (;;) {
      __pyx_4 = PyIter_Next(__pyx_3);
      if (!__pyx_4) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
        break;
      }
      __pyx_5 = PyObject_GetIter(__pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      __pyx_6 = PyObject_GetIter(__pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_v_ns_uri);
      __pyx_v_ns_uri = __pyx_4;
      __pyx_4 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_4;
      __pyx_4 = 0;
      if (__Pyx_EndUnpack(__pyx_6) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
      __pyx_4 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_v_function);
      __pyx_v_function = __pyx_4;
      __pyx_4 = 0;
      if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 42; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":43 */
      __pyx_2 = __pyx_v_name == Py_None;
      if (__pyx_2) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":44 */
        __pyx_6 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 44; goto __pyx_L1;}
        __Pyx_Raise(__pyx_6, __pyx_k390p, 0);
        Py_DECREF(__pyx_6); __pyx_6 = 0;
        {__pyx_filename = __pyx_f[11]; __pyx_lineno = 44; goto __pyx_L1;}
        goto __pyx_L8;
      }
      __pyx_L8:;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":46 */
      __pyx_4 = ((struct __pyx_vtabstruct_5etree__BaseContext *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_ns_uri); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 46; goto __pyx_L1;}
      Py_DECREF(__pyx_v_ns_utf);
      __pyx_v_ns_utf = __pyx_4;
      __pyx_4 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":47 */
      __pyx_5 = ((struct __pyx_vtabstruct_5etree__BaseContext *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_name); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 47; goto __pyx_L1;}
      Py_DECREF(__pyx_v_name_utf);
      __pyx_v_name_utf = __pyx_5;
      __pyx_5 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":48 */
      __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 49; goto __pyx_L1;}
      Py_INCREF(__pyx_v_ns_utf);
      PyTuple_SET_ITEM(__pyx_6, 0, __pyx_v_ns_utf);
      Py_INCREF(__pyx_v_name_utf);
      PyTuple_SET_ITEM(__pyx_6, 1, __pyx_v_name_utf);
      __pyx_2 = PyDict_SetItem(__pyx_v_new_extensions,__pyx_6,__pyx_v_function); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 48; goto __pyx_L1;}
      Py_DECREF(__pyx_6); __pyx_6 = 0;
    }
    Py_DECREF(__pyx_3); __pyx_3 = 0;
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":50 */
  __pyx_4 = __pyx_v_new_extensions;
  Py_INCREF(__pyx_4);
  __pyx_2 = PyObject_IsTrue(__pyx_4); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 50; goto __pyx_L1;}
  if (!__pyx_2) {
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __pyx_4 = Py_None;
    Py_INCREF(__pyx_4);
  }
  Py_DECREF(__pyx_v_extensions);
  __pyx_v_extensions = __pyx_4;
  __pyx_4 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":52 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 52; goto __pyx_L1;}
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_doc));
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_doc = ((struct LxmlDocument *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":53 */
__pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ExceptionContext), 0); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_5etree__ExceptionContext)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 53; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_exc));
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_exc = ((struct __pyx_obj_5etree__ExceptionContext *)__pyx_5);
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":54 */
Py_INCREF(__pyx_v_extensions);
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_extensions);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_extensions = __pyx_v_extensions;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":55 */
Py_INCREF(__pyx_v_namespaces);
Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces);
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces = __pyx_v_namespaces;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":56 */
__pyx_6 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__TempStore), 0); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 56; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_6, __pyx_ptype_5etree__TempStore)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 56; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_temp_refs));
((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_temp_refs = ((struct __pyx_obj_5etree__TempStore *)__pyx_6);
__pyx_6 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("etree._BaseContext.__init__");
__pyx_r = -1;
__pyx_L0:;
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_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext__copy(struct __pyx_obj_5etree__BaseContext *__pyx_v_self) {
struct __pyx_obj_5etree__BaseContext *__pyx_v_context;
PyObject *__pyx_v_namespaces;
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_context = ((struct __pyx_obj_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":60 */
__pyx_1 = __pyx_v_self->_namespaces != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":61 */
  __pyx_2 = PyDict_Copy(__pyx_v_self->_namespaces); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 61; goto __pyx_L1;}
  Py_DECREF(__pyx_v_namespaces);
  __pyx_v_namespaces = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":62 */
__pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n___class__); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 62; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 62; 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);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 62; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__BaseContext)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 62; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)__pyx_4);
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":63 */
__pyx_1 = __pyx_v_self->_extensions != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":64 */
  __pyx_2 = PyDict_Copy(__pyx_v_self->_extensions); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 64; goto __pyx_L1;}
  Py_DECREF(__pyx_v_context->_extensions);
  __pyx_v_context->_extensions = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":65 */
Py_INCREF(((PyObject *)__pyx_v_context));
__pyx_r = ((PyObject *)__pyx_v_context);
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("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;
}

static PyObject *__pyx_f_5etree_12_BaseContext__to_utf(struct __pyx_obj_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;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_s);
__pyx_v_utf = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":70 */
__pyx_1 = __pyx_v_s == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":71 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":72 */
__pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_utf_refs,__pyx_v_s);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":73 */
__pyx_1 = (__pyx_v_dict_result != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":74 */
  __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":75 */
__pyx_2 = __pyx_f_5etree__utf8(__pyx_v_s); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 75; goto __pyx_L1;}
Py_DECREF(__pyx_v_utf);
__pyx_v_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":76 */
__pyx_1 = PyDict_SetItem(__pyx_v_self->_utf_refs,__pyx_v_s,__pyx_v_utf); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 76; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":77 */
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("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;
}

static void __pyx_f_5etree_12_BaseContext__set_xpath_context(struct __pyx_obj_5etree__BaseContext *__pyx_v_self,xmlXPathContext (*__pyx_v_xpathCtxt)) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":80 */
__pyx_v_self->_xpathCtxt = __pyx_v_xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":81 */
__pyx_v_xpathCtxt->userData = ((void (*))__pyx_v_self);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_n_registerNamespaces;

static PyObject *__pyx_f_5etree_12_BaseContext__register_context(struct __pyx_obj_5etree__BaseContext *__pyx_v_self,struct LxmlDocument *__pyx_v_doc) {
PyObject *__pyx_v_namespaces;
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_doc);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":84 */
Py_INCREF(((PyObject *)__pyx_v_doc));
Py_DECREF(((PyObject *)__pyx_v_self->_doc));
__pyx_v_self->_doc = __pyx_v_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":85 */
((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_self->_exc->__pyx_vtab)->clear(__pyx_v_self->_exc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":86 */
PyDict_Clear(__pyx_v_self->_function_cache);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":87 */
PyDict_Clear(__pyx_v_self->_function_cache_ns);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":88 */
Py_INCREF(__pyx_v_self->_namespaces);
Py_DECREF(__pyx_v_namespaces);
__pyx_v_namespaces = __pyx_v_self->_namespaces;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":89 */
__pyx_1 = __pyx_v_namespaces != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":90 */
  __pyx_2 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_registerNamespaces); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 90; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_INCREF(__pyx_v_namespaces);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_namespaces);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 90; 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;
}
__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("etree._BaseContext._register_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext__unregister_context(struct __pyx_obj_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":93 */
xmlXPathRegisteredNsCleanup(__pyx_v_self->_xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":94 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseContext *)__pyx_v_self->__pyx_vtab)->_free_context(__pyx_v_self); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 94; 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("etree._BaseContext._unregister_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext__free_context(struct __pyx_obj_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
int __pyx_1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":97 */
PyDict_Clear(__pyx_v_self->_utf_refs);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":98 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 98; goto __pyx_L1;}
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)__pyx_v_self->_doc));
__pyx_v_self->_doc = ((struct LxmlDocument *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":99 */
__pyx_1 = (__pyx_v_self->_xpathCtxt != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":100 */
  __pyx_v_self->_xpathCtxt->userData = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":101 */
  __pyx_v_self->_xpathCtxt = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._BaseContext._free_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext_addNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_12_BaseContext_addNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 0;
PyObject *__pyx_v_uri = 0;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"prefix","uri",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_uri)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_prefix);
Py_INCREF(__pyx_v_uri);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":106 */
__pyx_1 = ((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":107 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 107; goto __pyx_L1;}
  Py_DECREF(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces);
  ((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":108 */
__pyx_1 = PyDict_SetItem(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_namespaces,__pyx_v_prefix,__pyx_v_uri); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 108; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._BaseContext.addNamespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
return __pyx_r;
}

static PyObject *__pyx_n_registerNamespace;

static PyObject *__pyx_f_5etree_12_BaseContext_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_12_BaseContext_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_uri;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"namespaces",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_namespaces)) return 0;
Py_INCREF(__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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":111 */
__pyx_1 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_v_prefix);
  __pyx_v_prefix = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_v_uri);
  __pyx_v_uri = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":112 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_registerNamespace); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_prefix);
  Py_INCREF(__pyx_v_uri);
  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_uri);
  __pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 112; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 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);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._BaseContext.registerNamespaces");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext_registerNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_12_BaseContext_registerNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_prefix = 0;
PyObject *__pyx_v_ns_uri = 0;
PyObject *__pyx_v_prefix_utf;
PyObject *__pyx_v_ns_uri_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
char (*__pyx_2);
char (*__pyx_3);
static char *__pyx_argnames[] = {"prefix","ns_uri",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_ns_uri)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":115 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseContext *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_prefix); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 115; goto __pyx_L1;}
Py_DECREF(__pyx_v_prefix_utf);
__pyx_v_prefix_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":116 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseContext *)((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->__pyx_vtab)->_to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_ns_uri); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 116; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_uri_utf);
__pyx_v_ns_uri_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":117 */
__pyx_2 = PyString_AsString(__pyx_v_prefix_utf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_3 = PyString_AsString(__pyx_v_ns_uri_utf); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 117; goto __pyx_L1;}
xmlXPathRegisterNs(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)->_xpathCtxt,__pyx_2,__pyx_3);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_f_5etree_12_BaseContext__find_cached_function(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":128 */
__pyx_1 = (__pyx_v_c_ns_uri == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":129 */
  __pyx_v_c_dict = ((PyObject (*))__pyx_v_self->_function_cache);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":131 */
  __pyx_v_c_dict = PyDict_GetItemString(__pyx_v_self->_function_cache_ns,__pyx_v_c_ns_uri);
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":134 */
__pyx_1 = (__pyx_v_c_dict != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":135 */
  __pyx_2 = (PyObject *)__pyx_v_c_dict;
  Py_INCREF(__pyx_2);
  __pyx_v_dict_result = PyDict_GetItemString(__pyx_2,__pyx_v_c_name);
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":136 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":137 */
    __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":138 */
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;
}

static int __pyx_f_5etree_12_BaseContext__prepare_function_call(struct __pyx_obj_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_v_d;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_v_function;
PyObject *__pyx_v_ns_uri_utf;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__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);
__pyx_v_ns_uri_utf = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":149 */
__pyx_1 = (__pyx_v_c_ns_uri == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":150 */
  Py_INCREF(__pyx_v_self->_function_cache);
  Py_DECREF(__pyx_v_d);
  __pyx_v_d = __pyx_v_self->_function_cache;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":151 */
  __pyx_v_c_dict = ((PyObject (*))__pyx_v_d);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":153 */
  __pyx_v_c_dict = PyDict_GetItemString(__pyx_v_self->_function_cache_ns,__pyx_v_c_ns_uri);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":155 */
  __pyx_1 = (__pyx_v_c_dict == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":156 */
    __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 156; goto __pyx_L1;}
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":157 */
    __pyx_1 = PyDict_SetItem(__pyx_v_self->_function_cache_ns,__pyx_v_ns_uri_utf,__pyx_v_d); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 157; goto __pyx_L1;}
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":159 */
    __pyx_2 = (PyObject *)__pyx_v_c_dict;
    Py_INCREF(__pyx_2);
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_2;
    __pyx_2 = 0;
  }
  __pyx_L3:;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":161 */
__pyx_2 = PyString_FromString(__pyx_v_c_name); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 161; goto __pyx_L1;}
Py_DECREF(__pyx_v_name_utf);
__pyx_v_name_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":162 */
__pyx_1 = (__pyx_v_c_dict != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":163 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_d,__pyx_v_name_utf);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":164 */
  __pyx_1 = (__pyx_v_dict_result != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":165 */
    __pyx_2 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_2);
    Py_DECREF(__pyx_v_function);
    __pyx_v_function = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":166 */
    Py_INCREF(__pyx_v_function);
    Py_DECREF(__pyx_v_self->_called_function);
    __pyx_v_self->_called_function = __pyx_v_function;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":167 */
    __pyx_1 = __pyx_v_function != Py_None;
    __pyx_r = __pyx_1;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":170 */
__pyx_1 = (__pyx_v_c_ns_uri != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":171 */
  __pyx_2 = PyString_FromString(__pyx_v_c_ns_uri); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 171; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_uri_utf);
  __pyx_v_ns_uri_utf = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":173 */
__pyx_1 = __pyx_v_self->_extensions != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":174 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 175; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_uri_utf);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_ns_uri_utf);
  Py_INCREF(__pyx_v_name_utf);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_name_utf);
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->_extensions,__pyx_2);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":177 */
  __pyx_v_dict_result = NULL;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":178 */
__pyx_1 = (__pyx_v_dict_result != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":179 */
  __pyx_2 = (PyObject *)__pyx_v_dict_result;
  Py_INCREF(__pyx_2);
  Py_DECREF(__pyx_v_function);
  __pyx_v_function = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L8;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":181 */
  __pyx_2 = __pyx_f_5etree__find_extension(__pyx_v_ns_uri_utf,__pyx_v_name_utf); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 181; goto __pyx_L1;}
  Py_DECREF(__pyx_v_function);
  __pyx_v_function = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":184 */
__pyx_1 = PyDict_SetItem(__pyx_v_d,__pyx_v_name_utf,__pyx_v_function); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 184; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":185 */
Py_INCREF(__pyx_v_function);
Py_DECREF(__pyx_v_self->_called_function);
__pyx_v_self->_called_function = __pyx_v_function;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":186 */
__pyx_1 = __pyx_v_function != Py_None;
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._BaseContext._prepare_function_call");
__pyx_L0:;
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_ns_uri_utf);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_BaseContext__release_temp_refs(struct __pyx_obj_5etree__BaseContext *__pyx_v_self) {
PyObject *__pyx_r;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":192 */
((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->clear(__pyx_v_self->_temp_refs);

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

static PyObject *__pyx_f_5etree_12_BaseContext__hold(struct __pyx_obj_5etree__BaseContext *__pyx_v_self,PyObject *__pyx_v_obj) {
struct LxmlElement *__pyx_v_element;
PyObject *__pyx_v_o;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_obj);
__pyx_v_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
__pyx_v_o = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":202 */
__pyx_1 = isinstance(__pyx_v_obj,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":203 */
  ((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs,__pyx_v_obj);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":204 */
  ((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs,((PyObject *)((struct LxmlElement *)__pyx_v_obj)->_doc));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":205 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = _isString(__pyx_v_obj);
if (!__pyx_1) {
  __pyx_1 = (!PySequence_Check(__pyx_v_obj));
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":207 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":208 */
__pyx_2 = PyObject_GetIter(__pyx_v_obj); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 208; goto __pyx_L1;}
for (;;) {
  __pyx_3 = PyIter_Next(__pyx_2);
  if (!__pyx_3) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 208; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_o);
  __pyx_v_o = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":209 */
  __pyx_1 = isinstance(__pyx_v_o,((PyObject*)__pyx_ptype_5etree__Element));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":210 */
    Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_o)));
    Py_DECREF(((PyObject *)__pyx_v_element));
    __pyx_v_element = ((struct LxmlElement *)__pyx_v_o);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":212 */
    ((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs,((PyObject *)__pyx_v_element));

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":214 */
    ((struct __pyx_vtabstruct_5etree__TempStore *)__pyx_v_self->_temp_refs->__pyx_vtab)->add(__pyx_v_self->_temp_refs,((PyObject *)__pyx_v_element->_doc));
    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);
__Pyx_AddTraceback("etree._BaseContext._hold");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_o);
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_obj);
return __pyx_r;
}

static PyObject *__pyx_n_dir;
static PyObject *__pyx_n_startswith;


static PyObject *__pyx_f_5etree_Extension(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
int __pyx_6;
static char *__pyx_argnames[] = {"module","function_mapping","ns",0};
__pyx_v_ns = __pyx_k148;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_module, &__pyx_v_function_mapping, &__pyx_v_ns)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":218 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 218; goto __pyx_L1;}
Py_DECREF(__pyx_v_functions);
__pyx_v_functions = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":219 */
__pyx_2 = PyDict_Check(__pyx_v_function_mapping);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":220 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_function_mapping, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
      break;
    }
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
    Py_DECREF(__pyx_v_function_name);
    __pyx_v_function_name = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
    Py_DECREF(__pyx_v_xpath_name);
    __pyx_v_xpath_name = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 220; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":221 */
    __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; goto __pyx_L1;}
    Py_INCREF(__pyx_v_ns);
    PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_ns);
    Py_INCREF(__pyx_v_xpath_name);
    PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_xpath_name);
    __pyx_4 = getattr(__pyx_v_module,__pyx_v_function_name); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 222; goto __pyx_L1;}
    __pyx_2 = PyDict_SetItem(__pyx_v_functions,__pyx_3,__pyx_4); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 221; 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_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":224 */
  __pyx_2 = __pyx_v_function_mapping == Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":225 */
    __pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 225; goto __pyx_L1;}
    Py_DECREF(__pyx_v_function_mapping);
    __pyx_v_function_mapping = __pyx_3;
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":226 */
    __pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_dir); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; goto __pyx_L1;}
    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; goto __pyx_L1;}
    Py_INCREF(__pyx_v_module);
    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_module);
    __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    for (;;) {
      __pyx_1 = PyIter_Next(__pyx_4);
      if (!__pyx_1) {
        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 226; goto __pyx_L1;}
        break;
      }
      Py_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_1;
      __pyx_1 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":227 */
      __pyx_3 = PyObject_GetAttr(__pyx_v_name, __pyx_n_startswith); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 227; goto __pyx_L1;}
      __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_INCREF(__pyx_n__);
      PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n__);
      __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_2 = PyObject_IsTrue(__pyx_5); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 227; goto __pyx_L1;}
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      __pyx_6 = (!__pyx_2);
      if (__pyx_6) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":228 */
        __pyx_2 = PyList_Append(__pyx_v_function_mapping,__pyx_v_name); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 228; goto __pyx_L1;}
        goto __pyx_L8;
      }
      __pyx_L8:;
    }
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":229 */
  __pyx_3 = PyObject_GetIter(__pyx_v_function_mapping); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 229; goto __pyx_L1;}
  for (;;) {
    __pyx_1 = PyIter_Next(__pyx_3);
    if (!__pyx_1) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 229; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_function_name);
    __pyx_v_function_name = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":230 */
    __pyx_5 = PyTuple_New(2); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; goto __pyx_L1;}
    Py_INCREF(__pyx_v_ns);
    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_v_ns);
    Py_INCREF(__pyx_v_function_name);
    PyTuple_SET_ITEM(__pyx_5, 1, __pyx_v_function_name);
    __pyx_4 = getattr(__pyx_v_module,__pyx_v_function_name); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 231; goto __pyx_L1;}
    __pyx_6 = PyDict_SetItem(__pyx_v_functions,__pyx_5,__pyx_4); if (__pyx_6 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 230; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
  }
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":232 */
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_3);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.Extension");
__pyx_r = 0;
__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);
return __pyx_r;
}

static xmlXPathFunction __pyx_f_5etree__function_check(void (*__pyx_v_ctxt),char (*__pyx_v_c_name),char (*__pyx_v_c_ns_uri)) {
struct __pyx_obj_5etree__BaseContext *__pyx_v_context;
xmlXPathFunction __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":242 */
__pyx_1 = (PyObject *)__pyx_v_ctxt;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":243 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_prepare_function_call(__pyx_v_context,__pyx_v_c_ns_uri,__pyx_v_c_name);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":244 */
  __pyx_r = __pyx_f_5etree__call_prepared_function;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":246 */
  __pyx_r = NULL;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_L0:;
Py_DECREF(__pyx_v_context);
return __pyx_r;
}

static PyObject *__pyx_k392p;
static PyObject *__pyx_k393p;

static char (__pyx_k392[]) = "This is not a node: %s";
static char (__pyx_k393[]) = "Unknown return type: %s";

static xmlXPathObject (*__pyx_f_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;
double __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
PyObject *__pyx_6 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":251 */
__pyx_1 = PyUnicode_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":252 */
  __pyx_2 = __pyx_f_5etree__utf8(__pyx_v_obj); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 252; goto __pyx_L1;}
  Py_DECREF(__pyx_v_obj);
  __pyx_v_obj = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":253 */
__pyx_1 = PyString_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":254 */
  __pyx_r = xmlXPathNewCString(_cstr(__pyx_v_obj));
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":255 */
__pyx_1 = PyBool_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":256 */
  __pyx_1 = PyInt_AsLong(__pyx_v_obj); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 256; goto __pyx_L1;}
  __pyx_r = xmlXPathNewBoolean(__pyx_1);
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":257 */
__pyx_1 = PyNumber_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":258 */
  __pyx_3 = PyFloat_AsDouble(__pyx_v_obj); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 258; goto __pyx_L1;}
  __pyx_r = xmlXPathNewFloat(__pyx_3);
  goto __pyx_L0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":259 */
__pyx_1 = __pyx_v_obj == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":260 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);
  goto __pyx_L6;
}
__pyx_1 = isinstance(__pyx_v_obj,((PyObject*)__pyx_ptype_5etree__Element));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":262 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(((struct LxmlElement *)__pyx_v_obj)->_c_node);
  goto __pyx_L6;
}
__pyx_1 = PySequence_Check(__pyx_v_obj);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":264 */
  __pyx_v_resultSet = xmlXPathNodeSetCreate(NULL);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":265 */
  __pyx_2 = PyObject_GetIter(__pyx_v_obj); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 265; goto __pyx_L1;}
  for (;;) {
    __pyx_4 = PyIter_Next(__pyx_2);
    if (!__pyx_4) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 265; goto __pyx_L1;}
      break;
    }
    Py_DECREF(__pyx_v_element);
    __pyx_v_element = __pyx_4;
    __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":266 */
    __pyx_1 = isinstance(__pyx_v_element,((PyObject*)__pyx_ptype_5etree__Element));
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":267 */
      Py_INCREF(((PyObject *)((struct LxmlElement *)__pyx_v_element)));
      Py_DECREF(((PyObject *)__pyx_v_node));
      __pyx_v_node = ((struct LxmlElement *)__pyx_v_element);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":268 */
      xmlXPathNodeSetAdd(__pyx_v_resultSet,__pyx_v_node->_c_node);
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":270 */
      xmlXPathFreeNodeSet(__pyx_v_resultSet);

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":271 */
      __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; goto __pyx_L1;}
      __pyx_5 = PyNumber_Remainder(__pyx_k392p, __pyx_v_element); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; goto __pyx_L1;}
      __Pyx_Raise(__pyx_4, __pyx_5, 0);
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      Py_DECREF(__pyx_5); __pyx_5 = 0;
      {__pyx_filename = __pyx_f[11]; __pyx_lineno = 271; goto __pyx_L1;}
    }
    __pyx_L9:;
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":273 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
  Py_INCREF(__pyx_v_obj);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_obj);
  __pyx_6 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = PyNumber_Remainder(__pyx_k393p, __pyx_6); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
  Py_DECREF(__pyx_6); __pyx_6 = 0;
  __Pyx_Raise(__pyx_4, __pyx_5, 0);
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 273; goto __pyx_L1;}
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":274 */
__pyx_r = xmlXPathWrapNodeSet(__pyx_v_resultSet);
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_4);
Py_XDECREF(__pyx_5);
Py_XDECREF(__pyx_6);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_n_NotImplementedError;

static PyObject *__pyx_k394p;
static PyObject *__pyx_k395p;

static char (__pyx_k394[]) = "Undefined xpath result";
static char (__pyx_k395[]) = "Unknown xpath result %s";

static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":278 */
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_UNDEFINED);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":279 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 279; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k394p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 279; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_NODESET);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":281 */
  __pyx_2 = __pyx_f_5etree__createNodeSetResult(__pyx_v_xpathObj,__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 281; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_BOOLEAN);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":283 */
  __pyx_2 = PyBool_FromLong(__pyx_v_xpathObj->boolval); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 283; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_NUMBER);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":285 */
  __pyx_2 = PyFloat_FromDouble(__pyx_v_xpathObj->floatval); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 285; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_STRING);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":287 */
  __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_xpathObj->stringval); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 287; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_POINT);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":289 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 289; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_RANGE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":291 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 291; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 291; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_LOCATIONSET);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":293 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 293; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 293; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_USERS);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":295 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 295; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 295; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_xpathObj->type == XPATH_XSLT_TREE);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":297 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[11]; __pyx_lineno = 297; goto __pyx_L1;}
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":299 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathResultError); if (!__pyx_2) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_3 = PyInt_FromLong(__pyx_v_xpathObj->type); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 299; goto __pyx_L1;}
  __pyx_4 = str(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 299; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k395p, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 299; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __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[11]; __pyx_lineno = 299; 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("etree._unwrapXPathObject");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_k396p;

static char (__pyx_k396[]) = "Not yet implemented result node type: %d";

static PyObject *__pyx_f_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;
PyObject *__pyx_5 = 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":305 */
__pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 305; goto __pyx_L1;}
Py_DECREF(__pyx_v_result);
__pyx_v_result = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":306 */
__pyx_2 = (__pyx_v_xpathObj->nodesetval == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":307 */
  Py_INCREF(__pyx_v_result);
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":308 */
__pyx_2 = __pyx_v_xpathObj->nodesetval->nodeNr;
for (__pyx_v_i = 0; __pyx_v_i < __pyx_2; ++__pyx_v_i) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":309 */
  __pyx_v_c_node = (__pyx_v_xpathObj->nodesetval->nodeTab[__pyx_v_i]);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":310 */
  __pyx_3 = _isElement(__pyx_v_c_node);
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":311 */
    __pyx_3 = (__pyx_v_c_node->doc != __pyx_v_doc->_c_doc);
    if (__pyx_3) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":316 */
      __pyx_v_c_node = xmlDocCopyNode(__pyx_v_c_node,__pyx_v_doc->_c_doc,1);
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":317 */
    __pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 317; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }
  __pyx_3 = (__pyx_v_c_node->type == XML_TEXT_NODE);
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":319 */
    __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_node->content); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 319; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L5;
  }
  __pyx_3 = (__pyx_v_c_node->type == XML_ATTRIBUTE_NODE);
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":321 */
    __pyx_v_s = xmlNodeGetContent(__pyx_v_c_node);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":322 */
    __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 322; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":323 */
    xmlFree(__pyx_v_s);
    goto __pyx_L5;
  }
  __pyx_3 = (__pyx_v_c_node->type == XML_NAMESPACE_DECL);
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":325 */
    __pyx_v_s = ((xmlNs (*))__pyx_v_c_node)->href;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":326 */
    __pyx_3 = (__pyx_v_s == NULL);
    if (__pyx_3) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":327 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_href);
      __pyx_v_href = Py_None;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":329 */
      __pyx_1 = PyString_FromString(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 329; goto __pyx_L1;}
      Py_DECREF(__pyx_v_href);
      __pyx_v_href = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L7:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":330 */
    __pyx_v_s = ((xmlNs (*))__pyx_v_c_node)->prefix;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":331 */
    __pyx_3 = (__pyx_v_s == NULL);
    if (__pyx_3) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":332 */
      Py_INCREF(Py_None);
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = Py_None;
      goto __pyx_L8;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":334 */
      __pyx_1 = PyString_FromString(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 334; goto __pyx_L1;}
      Py_DECREF(__pyx_v_prefix);
      __pyx_v_prefix = __pyx_1;
      __pyx_1 = 0;
    }
    __pyx_L8:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":335 */
    __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 335; 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;
  }
  __pyx_3 = (__pyx_v_c_node->type == XML_DOCUMENT_NODE);
  if (!__pyx_3) {
    __pyx_3 = (__pyx_v_c_node->type == XML_HTML_DOCUMENT_NODE);
    if (!__pyx_3) {
      __pyx_3 = (__pyx_v_c_node->type == XML_XINCLUDE_START);
      if (!__pyx_3) {
        __pyx_3 = (__pyx_v_c_node->type == XML_XINCLUDE_END);
      }
    }
  }
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":340 */
    goto __pyx_L3;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":342 */
    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_NotImplementedError); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 342; goto __pyx_L1;}
    __pyx_4 = PyInt_FromLong(__pyx_v_c_node->type); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 343; goto __pyx_L1;}
    __pyx_5 = PyNumber_Remainder(__pyx_k396p, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 343; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    __Pyx_Raise(__pyx_1, __pyx_5, 0);
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    Py_DECREF(__pyx_5); __pyx_5 = 0;
    {__pyx_filename = __pyx_f[11]; __pyx_lineno = 342; goto __pyx_L1;}
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":344 */
  __pyx_3 = PyList_Append(__pyx_v_result,__pyx_v_value); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 344; goto __pyx_L1;}
  __pyx_L3:;
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":345 */
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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("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;
}

static void __pyx_f_5etree__freeXPathObject(xmlXPathObject (*__pyx_v_xpathObj)) {
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":351 */
__pyx_1 = (__pyx_v_xpathObj->nodesetval != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":352 */
  xmlXPathFreeNodeSet(__pyx_v_xpathObj->nodesetval);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":353 */
  __pyx_v_xpathObj->nodesetval = NULL;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":354 */
xmlXPathFreeObject(__pyx_v_xpathObj);

}

static void __pyx_f_5etree__extension_function_call(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":365 */
Py_INCREF(((PyObject *)__pyx_v_context->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v_context->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":366 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":367 */
  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 367; goto __pyx_L2;}
  Py_DECREF(__pyx_v_args);
  __pyx_v_args = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":368 */
  for (__pyx_v_i = 0; __pyx_v_i < __pyx_v_nargs; ++__pyx_v_i) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":369 */
    __pyx_v_obj = valuePop(__pyx_v_ctxt);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":370 */
    __pyx_1 = __pyx_f_5etree__unwrapXPathObject(__pyx_v_obj,__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 370; goto __pyx_L2;}
    Py_DECREF(__pyx_v_o);
    __pyx_v_o = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":371 */
    __pyx_f_5etree__freeXPathObject(__pyx_v_obj);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":372 */
    __pyx_2 = PyList_Append(__pyx_v_args,__pyx_v_o); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 372; goto __pyx_L2;}
  }

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":373 */
  __pyx_2 = PyList_Reverse(__pyx_v_args); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 373; goto __pyx_L2;}

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":375 */
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; goto __pyx_L2;}
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_1, 0, Py_None);
  __pyx_3 = PySequence_Tuple(__pyx_v_args); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; goto __pyx_L2;}
  __pyx_4 = PyNumber_Add(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; 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 (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 375; goto __pyx_L2;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_res);
  __pyx_v_res = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":377 */
  __pyx_5 = __pyx_f_5etree__wrapXPathObject(__pyx_v_res); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 377; goto __pyx_L2;}
  __pyx_v_obj = __pyx_5;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":379 */
  __pyx_3 = ((struct __pyx_vtabstruct_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_hold(__pyx_v_context,__pyx_v_res); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 379; goto __pyx_L2;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":380 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":381 */
/*except:*/ {
  __Pyx_AddTraceback("etree._extension_function_call");
  __pyx_4 = __Pyx_GetExcValue(); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 381; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":382 */
  xmlXPathErr(__pyx_v_ctxt,XPATH_EXPR_ERROR);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":383 */
  ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_context->_exc->__pyx_vtab)->_store_raised(__pyx_v_context->_exc);
  goto __pyx_L3;
}
__pyx_L3:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_WriteUnraisable("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);
}

static void __pyx_f_5etree__xpath_function_call(xmlXPathParserContext (*__pyx_v_ctxt),int __pyx_v_nargs) {
PyGILState_STATE __pyx_v_gil_state;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":389 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":390 */
__pyx_f_5etree__call_python_xpath_function(__pyx_v_ctxt,__pyx_v_nargs);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":391 */
PyGILState_Release(__pyx_v_gil_state);

}

static PyObject *__pyx_n_XML_XPATH_UNKNOWN_FUNC_ERROR;

static PyObject *__pyx_k397p;
static PyObject *__pyx_k398p;

static char (__pyx_k397[]) = "{%s}%s";
static char (__pyx_k398[]) = "XPath function '%s' not found";

static void __pyx_f_5etree__call_python_xpath_function(xmlXPathParserContext (*__pyx_v_ctxt),int __pyx_v_nargs) {
xmlXPathContext (*__pyx_v_rctxt);
struct __pyx_obj_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;
__pyx_v_context = ((struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":397 */
__pyx_v_rctxt = __pyx_v_ctxt->context;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":398 */
__pyx_1 = (PyObject *)__pyx_v_rctxt->userData;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":399 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__BaseContext *)__pyx_v_context->__pyx_vtab)->_find_cached_function(__pyx_v_context,__pyx_v_rctxt->functionURI,__pyx_v_rctxt->function); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 399; goto __pyx_L1;}
Py_DECREF(__pyx_v_function);
__pyx_v_function = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":400 */
__pyx_2 = __pyx_v_function != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":401 */
  __pyx_f_5etree__extension_function_call(__pyx_v_context,__pyx_v_function,__pyx_v_ctxt,__pyx_v_nargs);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":403 */
  __pyx_2 = (__pyx_v_rctxt->functionURI != NULL);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":404 */
    __pyx_1 = PyString_FromString(__pyx_v_rctxt->functionURI); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; goto __pyx_L1;}
    __pyx_3 = PyString_FromString(__pyx_v_rctxt->function); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; 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_k397p, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 404; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":406 */
    __pyx_3 = PyString_FromString(__pyx_v_rctxt->function); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 406; goto __pyx_L1;}
    Py_DECREF(__pyx_v_fref);
    __pyx_v_fref = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":407 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_xpath); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_4, __pyx_n_XML_XPATH_UNKNOWN_FUNC_ERROR); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_2 = PyInt_AsLong(__pyx_1); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 407; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  xmlXPathErr(__pyx_v_ctxt,__pyx_2);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":408 */
  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XPathFunctionError); if (!__pyx_3) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; goto __pyx_L1;}
  __pyx_4 = PyNumber_Remainder(__pyx_k398p, __pyx_v_fref); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; goto __pyx_L1;}
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_4);
  __pyx_4 = 0;
  __pyx_4 = PyObject_CallObject(__pyx_3, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 408; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_exception);
  __pyx_v_exception = __pyx_4;
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":409 */
  ((struct __pyx_vtabstruct_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("etree._call_python_xpath_function");
__pyx_L0:;
Py_DECREF(__pyx_v_context);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_fref);
Py_DECREF(__pyx_v_exception);
}

static void __pyx_f_5etree__call_prepared_function(xmlXPathParserContext (*__pyx_v_ctxt),int __pyx_v_nargs) {
PyGILState_STATE __pyx_v_gil_state;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":415 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":416 */
__pyx_f_5etree__call_prepared_python_function(__pyx_v_ctxt,__pyx_v_nargs);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":417 */
PyGILState_Release(__pyx_v_gil_state);

}

static void __pyx_f_5etree__call_prepared_python_function(xmlXPathParserContext (*__pyx_v_ctxt),int __pyx_v_nargs) {
xmlXPathContext (*__pyx_v_rctxt);
struct __pyx_obj_5etree__BaseContext *__pyx_v_context;
PyObject *__pyx_1 = 0;
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":423 */
__pyx_v_rctxt = __pyx_v_ctxt->context;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":424 */
__pyx_1 = (PyObject *)__pyx_v_rctxt->userData;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__BaseContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":425 */
__pyx_f_5etree__extension_function_call(__pyx_v_context,__pyx_v_context->_called_function,__pyx_v_ctxt,__pyx_v_nargs);

Py_DECREF(__pyx_v_context);
}

static int __pyx_f_5etree_13_XPathContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_variables = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions","variables",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__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_variables);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":15 */
Py_INCREF(__pyx_v_variables);
Py_DECREF(((struct __pyx_obj_5etree__XPathContext *)__pyx_v_self)->_variables);
((struct __pyx_obj_5etree__XPathContext *)__pyx_v_self)->_variables = __pyx_v_variables;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":16 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseContext), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; 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);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 16; 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("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_variables);
return __pyx_r;
}

static PyObject *__pyx_n_registerVariables;

static PyObject *__pyx_f_5etree_13_XPathContext_register_context(struct __pyx_obj_5etree__XPathContext *__pyx_v_self,xmlXPathContext (*__pyx_v_xpathCtxt),struct LxmlDocument *__pyx_v_doc) {
PyObject *__pyx_v_ns_prefixes;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_doc);
__pyx_v_ns_prefixes = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":19 */
((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_xpath_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":20 */
__pyx_1 = __pyx_f_5etree__find_all_extension_prefixes(); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 20; goto __pyx_L1;}
Py_DECREF(__pyx_v_ns_prefixes);
__pyx_v_ns_prefixes = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":21 */
__pyx_2 = PyObject_IsTrue(__pyx_v_ns_prefixes); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 21; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":22 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_registerNamespaces); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 22; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 22; goto __pyx_L1;}
  Py_INCREF(__pyx_v_ns_prefixes);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_ns_prefixes);
  __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 22; 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_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":23 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._register_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 23; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":24 */
__pyx_2 = __pyx_v_self->_variables != Py_None;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":25 */
  __pyx_3 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_registerVariables); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 25; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 25; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self->_variables);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_self->_variables);
  __pyx_1 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 25; 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_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":26 */
xmlXPathRegisterFuncLookup(__pyx_v_self->__pyx_base._xpathCtxt,__pyx_f_5etree__function_check,((PyObject (*))__pyx_v_self));

__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("etree._XPathContext.register_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns_prefixes);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_13_XPathContext_unregister_context(struct __pyx_obj_5etree__XPathContext *__pyx_v_self) {
xmlXPathContext (*__pyx_v_xpathCtxt);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":31 */
__pyx_v_xpathCtxt = __pyx_v_self->__pyx_base._xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":32 */
__pyx_1 = (__pyx_v_xpathCtxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":33 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":34 */
xmlXPathRegisteredVariablesCleanup(__pyx_v_xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":35 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._unregister_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 35; 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);
__Pyx_AddTraceback("etree._XPathContext.unregister_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_13_XPathContext_registerVariables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_13_XPathContext_registerVariables(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_variable_dict = 0;
PyObject *__pyx_v_name;
PyObject *__pyx_v_value;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
xmlXPathObject (*__pyx_4);
static char *__pyx_argnames[] = {"variable_dict",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_variable_dict)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":38 */
__pyx_1 = PyObject_GetAttr(__pyx_v_variable_dict, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name);
  __pyx_v_name = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 38; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":39 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree__XPathContext *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_name); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 39; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":40 */
  __pyx_4 = __pyx_f_5etree__wrapXPathObject(__pyx_v_value); if (__pyx_4 == NULL) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 41; goto __pyx_L1;}
  xmlXPathRegisterVariable(((struct __pyx_obj_5etree__XPathContext *)__pyx_v_self)->__pyx_base._xpathCtxt,_cstr(__pyx_v_name_utf),__pyx_4);
}
Py_DECREF(__pyx_1); __pyx_1 = 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("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;
}

static PyObject *__pyx_f_5etree_13_XPathContext_registerVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_13_XPathContext_registerVariable(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_name = 0;
PyObject *__pyx_v_value = 0;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
xmlXPathObject (*__pyx_2);
static char *__pyx_argnames[] = {"name","value",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_name, &__pyx_v_value)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":44 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree__XPathContext *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._to_utf(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 44; goto __pyx_L1;}
Py_DECREF(__pyx_v_name_utf);
__pyx_v_name_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":45 */
__pyx_2 = __pyx_f_5etree__wrapXPathObject(__pyx_v_value); if (__pyx_2 == NULL) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 46; goto __pyx_L1;}
xmlXPathRegisterVariable(((struct __pyx_obj_5etree__XPathContext *)__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("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;
}

static void __pyx_f_5etree_13_XPathContext__registerVariable(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":49 */
__pyx_1 = __pyx_f_5etree__wrapXPathObject(__pyx_v_value); if (__pyx_1 == NULL) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 50; goto __pyx_L1;}
xmlXPathRegisterVariable(__pyx_v_self->__pyx_base._xpathCtxt,_cstr(__pyx_v_name_utf),__pyx_1);

goto __pyx_L0;
__pyx_L1:;
__Pyx_WriteUnraisable("etree._XPathContext._registerVariable");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_value);
}

static void __pyx_f_5etree__setupDict(xmlXPathContext (*__pyx_v_xpathCtxt)) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":53 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initXPathParserDict(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,__pyx_v_xpathCtxt);

}

static int __pyx_f_5etree_19_XPathEvaluatorBase___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_variables = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions","variables",0};
__pyx_v_variables = __pyx_k151;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO|O", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions, &__pyx_v_variables)) return -1;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
Py_INCREF(__pyx_v_variables);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":60 */
__pyx_1 = PyTuple_New(3); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 60; goto __pyx_L1;}
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_extensions);
Py_INCREF(__pyx_v_variables);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_v_variables);
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__XPathContext), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__XPathContext)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context));
((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self)->_context = ((struct __pyx_obj_5etree__XPathContext *)__pyx_2);
__pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._XPathEvaluatorBase.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
Py_DECREF(__pyx_v_variables);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":63 */
__pyx_1 = (((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":64 */
  xmlXPathFreeContext(((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self)->_xpathCtxt);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_5etree_19_XPathEvaluatorBase_evaluate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__eval_arg);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":75 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 75; goto __pyx_L1;}
Py_INCREF(__pyx_v__eval_arg);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__eval_arg);
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_v_self, __pyx_1, __pyx_v__variables); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 75; 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("etree._XPathEvaluatorBase.evaluate");
__pyx_r = 0;
__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;
}

static int __pyx_f_5etree_19_XPathEvaluatorBase__checkAbsolutePath(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":79 */
__pyx_1 = (__pyx_v_path == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":80 */
  __pyx_r = 0;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":81 */
__pyx_v_c = (__pyx_v_path[0]);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":82 */
while (1) {
  __pyx_1 = (__pyx_v_c == ' ');
  if (!__pyx_1) {
    __pyx_1 = (__pyx_v_c == '\t');
  }
  if (!__pyx_1) break;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":83 */
  __pyx_v_path = (__pyx_v_path + 1);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":84 */
  __pyx_v_c = (__pyx_v_path[0]);
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":85 */
__pyx_r = (__pyx_v_c == '/');
goto __pyx_L0;

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

static PyObject *__pyx_k399p;

static char (__pyx_k399[]) = "error in xpath expression";

static PyObject *__pyx_f_5etree_19_XPathEvaluatorBase__raise_parse_error(struct __pyx_obj_5etree__XPathEvaluatorBase *__pyx_v_self) {
PyObject *__pyx_v_message;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_self);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":88 */
__pyx_1 = (__pyx_v_self->_xpathCtxt != NULL);
if (__pyx_1) {
  __pyx_1 = (__pyx_v_self->_xpathCtxt->lastError.message != NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":90 */
  __pyx_2 = __pyx_f_5etree_funicode(__pyx_v_self->_xpathCtxt->lastError.message); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 90; goto __pyx_L1;}
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":92 */
  Py_INCREF(__pyx_k399p);
  Py_DECREF(__pyx_v_message);
  __pyx_v_message = __pyx_k399p;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":93 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathSyntaxError); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 93; goto __pyx_L1;}
__Pyx_Raise(__pyx_2, __pyx_v_message, 0);
Py_DECREF(__pyx_2); __pyx_2 = 0;
{__pyx_filename = __pyx_f[12]; __pyx_lineno = 93; goto __pyx_L1;}

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._XPathEvaluatorBase._raise_parse_error");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_19_XPathEvaluatorBase__handle_result(struct __pyx_obj_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;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_doc);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":96 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_has_raised(__pyx_v_self->_context->__pyx_base._exc);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":97 */
  __pyx_1 = (__pyx_v_xpathObj != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":98 */
    __pyx_f_5etree__freeXPathObject(__pyx_v_xpathObj);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":99 */
    __pyx_v_xpathObj = NULL;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":100 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self->_context)); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":101 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__ExceptionContext *)__pyx_v_self->_context->__pyx_base._exc->__pyx_vtab)->_raise_if_stored(__pyx_v_self->_context->__pyx_base._exc); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 101; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":103 */
__pyx_1 = (__pyx_v_xpathObj == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":104 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self->_context)); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 104; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":105 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree__XPathEvaluatorBase *)__pyx_v_self->__pyx_vtab)->_raise_parse_error(__pyx_v_self); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 105; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":107 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":108 */
  __pyx_2 = __pyx_f_5etree__unwrapXPathObject(__pyx_v_xpathObj,__pyx_v_doc); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 108; goto __pyx_L6;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_2;
  __pyx_2 = 0;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L7;
  __pyx_L6: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_2, &__pyx_3, &__pyx_4);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":110 */
  __pyx_f_5etree__freeXPathObject(__pyx_v_xpathObj);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":111 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_self->_context->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self->_context)); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 111; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_2, __pyx_3, __pyx_4);
      __pyx_lineno = __pyx_1;
      __pyx_2 = 0;
      __pyx_3 = 0;
      __pyx_4 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":113 */
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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("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;
}

static PyObject *__pyx_k400p;

static char (__pyx_k400[]) = "Unable to create new XPath context";

static int __pyx_f_5etree_21XPathElementEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
xmlXPathContext (*__pyx_v_xpathCtxt);
struct LxmlDocument *__pyx_v_doc;
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"element","namespaces","extensions",0};
__pyx_v_namespaces = __pyx_k152;
__pyx_v_extensions = __pyx_k153;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_element, &__pyx_v_namespaces, &__pyx_v_extensions)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_element);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
__pyx_v_doc = ((struct LxmlDocument *)Py_None); Py_INCREF(Py_None);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_element), __pyx_ptype_5etree__Element, 0, "element")) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 125; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":129 */
Py_INCREF(((PyObject *)__pyx_v_element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = __pyx_v_element->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":130 */
__pyx_v_xpathCtxt = xmlXPathNewContext(__pyx_v_doc->_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":131 */
((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._xpathCtxt = __pyx_v_xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":132 */
__pyx_1 = (__pyx_v_xpathCtxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":133 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XPathContextError); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 133; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k400p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[12]; __pyx_lineno = 133; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":134 */
__pyx_f_5etree__setupDict(__pyx_v_xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":135 */
Py_INCREF(((PyObject *)__pyx_v_element));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->_element));
((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->_element = __pyx_v_element;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":136 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__XPathEvaluatorBase), __pyx_n___init__); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 136; goto __pyx_L1;}
__pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 136; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_extensions);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 136; goto __pyx_L1;}
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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("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);
return __pyx_r;
}

static PyObject *__pyx_n_addNamespace;

static PyObject *__pyx_f_5etree_21XPathElementEvaluator_registerNamespace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_21XPathElementEvaluator_registerNamespace[] = "Register a namespace with the XPath context.\n        ";
static PyObject *__pyx_f_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;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"prefix","uri",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_prefix, &__pyx_v_uri)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_prefix);
Py_INCREF(__pyx_v_uri);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":141 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context), __pyx_n_addNamespace); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; goto __pyx_L1;}
Py_INCREF(__pyx_v_prefix);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_prefix);
Py_INCREF(__pyx_v_uri);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_uri);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 141; 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("etree.XPathElementEvaluator.registerNamespace");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_21XPathElementEvaluator_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_21XPathElementEvaluator_registerNamespaces[] = "Register a prefix -> uri dict.\n        ";
static PyObject *__pyx_f_5etree_21XPathElementEvaluator_registerNamespaces(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_add;
PyObject *__pyx_v_prefix;
PyObject *__pyx_v_uri;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"namespaces",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_namespaces)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
__pyx_v_add = Py_None; Py_INCREF(Py_None);
__pyx_v_prefix = Py_None; Py_INCREF(Py_None);
__pyx_v_uri = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":146 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context), __pyx_n_addNamespace); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 146; goto __pyx_L1;}
Py_DECREF(__pyx_v_add);
__pyx_v_add = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":147 */
__pyx_1 = PyObject_GetAttr(__pyx_v_namespaces, __pyx_n_items); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_v_prefix);
  __pyx_v_prefix = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_v_uri);
  __pyx_v_uri = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":148 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_INCREF(__pyx_v_prefix);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_prefix);
  Py_INCREF(__pyx_v_uri);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_uri);
  __pyx_3 = PyObject_CallObject(__pyx_v_add, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
}
Py_DECREF(__pyx_1); __pyx_1 = 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("etree.XPathElementEvaluator.registerNamespaces");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_add);
Py_DECREF(__pyx_v_prefix);
Py_DECREF(__pyx_v_uri);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_21XPathElementEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v__variables = 0;
xmlXPathContext (*__pyx_v_xpathCtxt);
xmlXPathObject (*__pyx_v_xpathObj);
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_path;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"_path",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables) < 0) return 0;
if (!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 0;
}
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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":163 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v__path); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 163; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":164 */
__pyx_v_xpathCtxt = ((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":165 */
__pyx_v_xpathCtxt->node = ((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":166 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->_element->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":168 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->register_context(((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context,__pyx_v_xpathCtxt,__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 168; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":169 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":170 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context), __pyx_n_registerVariables); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; goto __pyx_L3;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; goto __pyx_L3;}
  Py_INCREF(__pyx_v__variables);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__variables);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 170; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":171 */
  __pyx_v_xpathObj = xmlXPathEvalExpression(_cstr(__pyx_v_path),__pyx_v_xpathCtxt);
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_1, &__pyx_2, &__pyx_3);
    __pyx_4 = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":173 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context->__pyx_base.__pyx_vtab)->unregister_context(((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base._context); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 173; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_1, __pyx_2, __pyx_3);
      __pyx_lineno = __pyx_4;
      __pyx_1 = 0;
      __pyx_2 = 0;
      __pyx_3 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":175 */
__pyx_5 = ((struct __pyx_vtabstruct_5etree_XPathElementEvaluator *)((struct __pyx_obj_5etree_XPathElementEvaluator *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handle_result(((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self),__pyx_v_xpathObj,__pyx_v_doc); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 175; goto __pyx_L1;}
__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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.XPathElementEvaluator.__call__");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_path);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static int __pyx_f_5etree_22XPathDocumentEvaluator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"etree","namespaces","extensions",0};
__pyx_v_namespaces = __pyx_k154;
__pyx_v_extensions = __pyx_k155;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_etree, &__pyx_v_namespaces, &__pyx_v_extensions)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_etree);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_etree), __pyx_ptype_5etree__ElementTree, 0, "etree")) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 183; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":184 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_XPathElementEvaluator), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; goto __pyx_L1;}
__pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; 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));
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_extensions);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 184; 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("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);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_5etree_22XPathDocumentEvaluator___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v__path = 0;
PyObject *__pyx_v__variables = 0;
xmlXPathContext (*__pyx_v_xpathCtxt);
xmlXPathObject (*__pyx_v_xpathObj);
xmlDoc (*__pyx_v_c_doc);
struct LxmlDocument *__pyx_v_doc;
PyObject *__pyx_v_path;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"_path",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables) < 0) return 0;
if (!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 0;
}
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);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":197 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v__path); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 197; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":198 */
__pyx_v_xpathCtxt = ((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":199 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc));
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":201 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context->__pyx_base.__pyx_vtab)->register_context(((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context,__pyx_v_xpathCtxt,__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 201; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":202 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base._element->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":203 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":204 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context), __pyx_n_registerVariables); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; goto __pyx_L3;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; goto __pyx_L3;}
  Py_INCREF(__pyx_v__variables);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__variables);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 204; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":205 */
  __pyx_v_xpathCtxt->doc = __pyx_v_c_doc;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":206 */
  __pyx_v_xpathCtxt->node = xmlDocGetRootElement(__pyx_v_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":207 */
  __pyx_v_xpathObj = xmlXPathEvalExpression(_cstr(__pyx_v_path),__pyx_v_xpathCtxt);
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_1, &__pyx_2, &__pyx_3);
    __pyx_4 = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":209 */
  __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":210 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__XPathContext *)((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context->__pyx_base.__pyx_vtab)->unregister_context(((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base._context); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 210; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_1, __pyx_2, __pyx_3);
      __pyx_lineno = __pyx_4;
      __pyx_1 = 0;
      __pyx_2 = 0;
      __pyx_3 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":212 */
__pyx_5 = ((struct __pyx_vtabstruct_5etree_XPathDocumentEvaluator *)((struct __pyx_obj_5etree_XPathDocumentEvaluator *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._handle_result(((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self),__pyx_v_xpathObj,__pyx_v_doc); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 212; goto __pyx_L1;}
__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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.XPathDocumentEvaluator.__call__");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_doc);
Py_DECREF(__pyx_v_path);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__path);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_XPathEvaluator(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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    XPath evaluators must not be shared between threads.\n    ";
static PyObject *__pyx_f_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_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"etree_or_element","namespaces","extensions",0};
__pyx_v_namespaces = __pyx_k156;
__pyx_v_extensions = __pyx_k157;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_etree_or_element, &__pyx_v_namespaces, &__pyx_v_extensions)) return 0;
Py_INCREF(__pyx_v_etree_or_element);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":223 */
__pyx_1 = isinstance(__pyx_v_etree_or_element,((PyObject*)__pyx_ptype_5etree__ElementTree));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":224 */
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 224; goto __pyx_L1;}
  Py_INCREF(__pyx_v_etree_or_element);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_etree_or_element);
  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);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XPathDocumentEvaluator), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 224; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":226 */
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 226; goto __pyx_L1;}
  Py_INCREF(__pyx_v_etree_or_element);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_etree_or_element);
  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);
  __pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XPathElementEvaluator), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 226; 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("etree.XPathEvaluator");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_etree_or_element);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
return __pyx_r;
}

static int __pyx_f_5etree_5XPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
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",0};
__pyx_v_namespaces = __pyx_k158;
__pyx_v_extensions = __pyx_k159;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OO", __pyx_argnames, &__pyx_v_path, &__pyx_v_namespaces, &__pyx_v_extensions)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":241 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__XPathEvaluatorBase), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 241; goto __pyx_L1;}
__pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 241; 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);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 241; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":242 */
((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":243 */
Py_INCREF(__pyx_v_path);
Py_DECREF(((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->path);
((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->path = __pyx_v_path;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":244 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_path); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 244; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":245 */
((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt = xmlXPathNewContext(NULL);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":246 */
__pyx_f_5etree__setupDict(((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":247 */
((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath = xmlXPathCtxtCompile(((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt,_cstr(__pyx_v_path));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":248 */
__pyx_4 = (((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath == NULL);
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":249 */
  __pyx_2 = ((struct __pyx_vtabstruct_5etree_XPath *)((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._raise_parse_error(((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 249; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  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("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);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_5XPath___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyThreadState (*__pyx_v_state);
xmlXPathContext (*__pyx_v_xpathCtxt);
xmlXPathObject (*__pyx_v_xpathObj);
struct LxmlDocument *__pyx_v_document;
struct LxmlElement *__pyx_v_element;
struct __pyx_obj_5etree__XPathContext *__pyx_v_context;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
static char *__pyx_argnames[] = {"_etree_or_element",0};
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 1, 0, &__pyx_v__variables) < 0) return 0;
if (!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 0;
}
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_context = ((struct __pyx_obj_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":259 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v__etree_or_element)); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 259; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_document));
__pyx_v_document = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":260 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v__etree_or_element)); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 260; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_element));
__pyx_v_element = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":262 */
__pyx_v_xpathCtxt = ((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._xpathCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":263 */
__pyx_v_xpathCtxt->doc = __pyx_v_document->_c_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":264 */
__pyx_v_xpathCtxt->node = __pyx_v_element->_c_node;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":266 */
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._context));
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base._context;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":267 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->register_context(__pyx_v_context,__pyx_v_xpathCtxt,__pyx_v_document); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 267; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":268 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":269 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_context), __pyx_n_registerVariables); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 269; goto __pyx_L3;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 269; goto __pyx_L3;}
  Py_INCREF(__pyx_v__variables);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v__variables);
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 269; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":270 */
  __pyx_v_state = PyEval_SaveThread();

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":271 */
  __pyx_v_xpathObj = xmlXPathCompiledEval(((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath,__pyx_v_xpathCtxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":272 */
  PyEval_RestoreThread(__pyx_v_state);
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L4;
  __pyx_L3: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    PyErr_Fetch(&__pyx_1, &__pyx_2, &__pyx_3);
    __pyx_4 = __pyx_lineno;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":274 */
  __pyx_5 = ((struct __pyx_vtabstruct_5etree__XPathContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->unregister_context(__pyx_v_context); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 274; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_1, __pyx_2, __pyx_3);
      __pyx_lineno = __pyx_4;
      __pyx_1 = 0;
      __pyx_2 = 0;
      __pyx_3 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":275 */
__pyx_5 = ((struct __pyx_vtabstruct_5etree_XPath *)((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->__pyx_base.__pyx_vtab)->__pyx_base._handle_result(((struct __pyx_obj_5etree__XPathEvaluatorBase *)__pyx_v_self),__pyx_v_xpathObj,__pyx_v_document); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 275; goto __pyx_L1;}
__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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree.XPath.__call__");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v__variables);
Py_DECREF(__pyx_v_document);
Py_DECREF(__pyx_v_element);
Py_DECREF((PyObject *)__pyx_v_context);
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v__etree_or_element);
Py_XDECREF(__pyx_args);
Py_XDECREF(__pyx_kwds);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":278 */
__pyx_1 = (((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":279 */
  xmlXPathFreeCompExpr(((struct __pyx_obj_5etree_XPath *)__pyx_v_self)->_xpath);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF((PyObject *)__pyx_v_self);
}

static int __pyx_f_5etree_7ETXPath___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_namespaces;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"path","extensions",0};
__pyx_v_extensions = __pyx_k162;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_path, &__pyx_v_extensions)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_path);
Py_INCREF(__pyx_v_extensions);
__pyx_v_namespaces = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":291 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_ETXPath *)((struct __pyx_obj_5etree_ETXPath *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_vtab)->_nsextract_path(((struct __pyx_obj_5etree_ETXPath *)__pyx_v_self),__pyx_v_path); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_1;
__pyx_1 = 0;
__pyx_1 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
Py_DECREF(__pyx_v_namespaces);
__pyx_v_namespaces = __pyx_1;
__pyx_1 = 0;
if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 291; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":292 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree_XPath), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 292; goto __pyx_L1;}
__pyx_2 = PyTuple_New(4); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 292; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_path);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_2, 2, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_2, 3, __pyx_v_extensions);
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 292; 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("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);
return __pyx_r;
}

static PyObject *__pyx_k401p;
static PyObject *__pyx_k405p;

static char (__pyx_k401[]) = "";
static char (__pyx_k402[]) = "xpp%02d";
static char (__pyx_k403[]) = "UTF-8";
static char (__pyx_k404[]) = "strict";
static char (__pyx_k405[]) = ":";
static char (__pyx_k406[]) = "UTF-8";
static char (__pyx_k407[]) = "strict";

static PyObject *__pyx_f_5etree_7ETXPath__nsextract_path(struct __pyx_obj_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;
int __pyx_3;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":297 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_path); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 297; goto __pyx_L1;}
Py_DECREF(__pyx_v_path_utf);
__pyx_v_path_utf = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":298 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; goto __pyx_L1;}
Py_INCREF(__pyx_k401p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k401p);
Py_INCREF(__pyx_v_path_utf);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_path_utf);
__pyx_2 = PyObject_CallObject(__pyx_v_5etree__replace_strings, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 298; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":299 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 299; goto __pyx_L1;}
Py_DECREF(__pyx_v_namespaces);
__pyx_v_namespaces = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":300 */
__pyx_2 = PyList_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 300; goto __pyx_L1;}
Py_DECREF(__pyx_v_namespace_defs);
__pyx_v_namespace_defs = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":301 */
__pyx_v_i = 1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":302 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; 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_5etree__find_namespaces, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 302; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_namespace_def);
  __pyx_v_namespace_def = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":303 */
  __pyx_3 = PySequence_Contains(__pyx_v_namespace_defs, __pyx_v_namespace_def); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 303; goto __pyx_L1;}
  __pyx_3 = !__pyx_3;
  if (__pyx_3) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":304 */
    __pyx_2 = PyString_FromFormat(__pyx_k402,__pyx_v_i); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 304; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix);
    __pyx_v_prefix = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":305 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":306 */
    __pyx_3 = PyList_Append(__pyx_v_namespace_defs,__pyx_v_namespace_def); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 306; goto __pyx_L1;}

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":307 */
    __pyx_2 = PySequence_GetSlice(__pyx_v_namespace_def, 1, (-1)); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 307; goto __pyx_L1;}
    Py_DECREF(__pyx_v_namespace);
    __pyx_v_namespace = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":308 */
    __pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_namespace,__pyx_k403,__pyx_k404); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 308; goto __pyx_L1;}
    Py_DECREF(__pyx_v_namespace);
    __pyx_v_namespace = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":310 */
    __pyx_3 = PyDict_SetItem(__pyx_v_namespaces,__pyx_v_prefix,__pyx_v_namespace); if (__pyx_3 == (-1)) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 310; goto __pyx_L1;}

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":311 */
    __pyx_2 = PyNumber_Add(__pyx_v_prefix, __pyx_k405p); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 311; goto __pyx_L1;}
    Py_DECREF(__pyx_v_prefix_str);
    __pyx_v_prefix_str = __pyx_2;
    __pyx_2 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":313 */
    __pyx_2 = PyObject_GetAttr(__pyx_v_path_utf, __pyx_n_replace); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 313; goto __pyx_L1;}
    __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 313; goto __pyx_L1;}
    Py_INCREF(__pyx_v_namespace_def);
    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_namespace_def);
    Py_INCREF(__pyx_v_prefix_str);
    PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_prefix_str);
    __pyx_5 = PyObject_CallObject(__pyx_2, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 313; goto __pyx_L1;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_v_path_utf);
    __pyx_v_path_utf = __pyx_5;
    __pyx_5 = 0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":314 */
__pyx_2 = PyUnicode_FromEncodedObject(__pyx_v_path_utf,__pyx_k406,__pyx_k407); if (!__pyx_2) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 314; goto __pyx_L1;}
Py_DECREF(__pyx_v_path);
__pyx_v_path = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":315 */
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 315; goto __pyx_L1;}
Py_INCREF(__pyx_v_path);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_path);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_v_namespaces);
__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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("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;
}

static int __pyx_f_5etree_20_XSLTResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_20_XSLTResolverContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct __pyx_obj_5etree__BaseParser *__pyx_v_parser = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"parser",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_parser)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_parser);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_parser), __pyx_ptype_5etree__BaseParser, 0, "parser")) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 43; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":44 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__ResolverContext), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 44; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 44; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_self);
Py_INCREF(((PyObject *)__pyx_v_parser->resolvers));
PyTuple_SET_ITEM(__pyx_2, 1, ((PyObject *)__pyx_v_parser->resolvers));
__pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 44; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":45 */
Py_INCREF(((PyObject *)__pyx_v_parser));
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_v_self)->_parser));
((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_v_self)->_parser = __pyx_v_parser;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":46 */
((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_v_self)->_c_style_doc = NULL;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._XSLTResolverContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_parser);
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__xslt_resolve_stylesheet(char (*__pyx_v_c_uri),void (*__pyx_v_context))) {
xmlDoc (*__pyx_v_c_doc);
xmlDoc (*__pyx_r);
PyObject *__pyx_1 = 0;
int __pyx_2;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":50 */
__pyx_1 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_1);
__pyx_v_c_doc = ((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_1)->_c_style_doc;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":51 */
__pyx_2 = (__pyx_v_c_doc != NULL);
if (__pyx_2) {
  __pyx_2 = (__pyx_v_c_doc->URL != NULL);
}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":52 */
  __pyx_2 = (strcmp(__pyx_v_c_uri,__pyx_v_c_doc->URL) == 0);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":53 */
    __pyx_r = __pyx_f_5etree__copyDoc(__pyx_v_c_doc,1);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":54 */
__pyx_r = NULL;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static xmlDoc (*__pyx_f_5etree__xslt_resolve_from_python(char (*__pyx_v_c_uri),void (*__pyx_v_context),int __pyx_v_parse_options,int (*__pyx_v_error))) {
struct __pyx_obj_5etree__XSLTResolverContext *__pyx_v_resolver_context;
struct __pyx_obj_5etree__ResolverRegistry *__pyx_v_resolvers;
struct __pyx_obj_5etree__InputDocument *__pyx_v_doc_ref;
xmlDoc (*__pyx_v_c_doc);
PyObject *__pyx_v_uri;
PyObject *__pyx_v_data;
xmlDoc (*__pyx_r);
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
xmlDoc (*__pyx_5);
xmlDoc (*__pyx_6);
__pyx_v_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
__pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)Py_None); Py_INCREF(Py_None);
__pyx_v_uri = Py_None; Py_INCREF(Py_None);
__pyx_v_data = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":64 */
(__pyx_v_error[0]) = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":65 */
__pyx_1 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_1);
Py_DECREF(((PyObject *)__pyx_v_resolver_context));
__pyx_v_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":66 */
Py_INCREF(((PyObject *)__pyx_v_resolver_context->__pyx_base._resolvers));
Py_DECREF(((PyObject *)__pyx_v_resolvers));
__pyx_v_resolvers = __pyx_v_resolver_context->__pyx_base._resolvers;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":67 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":68 */
  __pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_uri); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 68; goto __pyx_L2;}
  Py_DECREF(__pyx_v_uri);
  __pyx_v_uri = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":69 */
  __pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_resolvers), __pyx_n_resolve); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 69; goto __pyx_L2;}
  __pyx_2 = PyTuple_New(3); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 69; goto __pyx_L2;}
  Py_INCREF(__pyx_v_uri);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_uri);
  Py_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_2, 1, Py_None);
  Py_INCREF(((PyObject *)__pyx_v_resolver_context));
  PyTuple_SET_ITEM(__pyx_2, 2, ((PyObject *)__pyx_v_resolver_context));
  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 69; goto __pyx_L2;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__InputDocument)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 69; goto __pyx_L2;}
  Py_DECREF(((PyObject *)__pyx_v_doc_ref));
  __pyx_v_doc_ref = ((struct __pyx_obj_5etree__InputDocument *)__pyx_3);
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":71 */
  __pyx_v_c_doc = NULL;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":72 */
  __pyx_4 = __pyx_v_doc_ref != Py_None;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":73 */
    __pyx_4 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_EMPTY);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":74 */
      __pyx_v_c_doc = __pyx_f_5etree__newDoc();
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":75 */
    __pyx_4 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_STRING);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":76 */
      __pyx_5 = __pyx_f_5etree__internalParseDoc(_cstr(__pyx_v_doc_ref->_data_bytes),__pyx_v_parse_options,((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_resolver_context)); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 76; goto __pyx_L2;}
      __pyx_v_c_doc = __pyx_5;
      goto __pyx_L6;
    }
    __pyx_4 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_FILE);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":80 */
      __pyx_1 = PyObject_GetAttr(__pyx_v_doc_ref->_file, __pyx_n_read); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 80; goto __pyx_L2;}
      __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 80; goto __pyx_L2;}
      Py_DECREF(__pyx_1); __pyx_1 = 0;
      Py_DECREF(__pyx_v_data);
      __pyx_v_data = __pyx_2;
      __pyx_2 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":81 */
      __pyx_5 = __pyx_f_5etree__internalParseDoc(_cstr(__pyx_v_data),__pyx_v_parse_options,((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_resolver_context)); if (__pyx_5 == NULL) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 81; goto __pyx_L2;}
      __pyx_v_c_doc = __pyx_5;
      goto __pyx_L6;
    }
    __pyx_4 = (__pyx_v_doc_ref->_type == __pyx_e_5etree_PARSER_DATA_FILENAME);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":85 */
      __pyx_6 = __pyx_f_5etree__internalParseDocFromFile(_cstr(__pyx_v_doc_ref->_data_bytes),__pyx_v_parse_options,((struct __pyx_obj_5etree__ResolverContext *)__pyx_v_resolver_context)); if (__pyx_6 == NULL) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 85; goto __pyx_L2;}
      __pyx_v_c_doc = __pyx_6;
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":88 */
    __pyx_4 = (__pyx_v_c_doc != NULL);
    if (__pyx_4) {
      __pyx_4 = (__pyx_v_c_doc->URL == NULL);
    }
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":89 */
      __pyx_v_c_doc->URL = xmlStrdup(__pyx_v_c_uri);
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":90 */
  __pyx_r = __pyx_v_c_doc;
  goto __pyx_L0;
}
goto __pyx_L3;
__pyx_L2:;
Py_XDECREF(__pyx_3); __pyx_3 = 0;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":91 */
/*except:*/ {
  __Pyx_AddTraceback("etree._xslt_resolve_from_python");
  __pyx_3 = __Pyx_GetExcValue(); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 91; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":92 */
  ((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)__pyx_v_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_raised(((struct __pyx_obj_5etree__ExceptionContext *)__pyx_v_resolver_context));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":93 */
  (__pyx_v_error[0]) = 1;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":94 */
  __pyx_r = NULL;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_WriteUnraisable("etree._xslt_resolve_from_python");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_resolver_context);
Py_DECREF(__pyx_v_resolvers);
Py_DECREF(__pyx_v_doc_ref);
Py_DECREF(__pyx_v_uri);
Py_DECREF(__pyx_v_data);
return __pyx_r;
}

static PyObject *__pyx_k408p;

static char (__pyx_k408[]) = "Cannot resolve URI %s";

static void __pyx_f_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;
__pyx_v_message = Py_None; Py_INCREF(Py_None);
__pyx_v_exception = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":98 */
__pyx_1 = __pyx_f_5etree_funicode(__pyx_v_c_uri); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 98; goto __pyx_L1;}
__pyx_2 = PyNumber_Remainder(__pyx_k408p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 98; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_message);
__pyx_v_message = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":99 */
__pyx_3 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":100 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTApplyError); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 100; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":102 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 102; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 102; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":103 */
__pyx_1 = (PyObject *)__pyx_v_context;
Py_INCREF(__pyx_1);
((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_1)->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._store_exception(((struct __pyx_obj_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("etree._xslt_store_resolver_exception");
__pyx_L0:;
Py_DECREF(__pyx_v_message);
Py_DECREF(__pyx_v_exception);
}

static xmlDoc (*__pyx_f_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;
PyGILState_STATE __pyx_v_gil_state;
xmlDoc (*__pyx_r);
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":116 */
__pyx_1 = (__pyx_v_c_type == XSLT_LOAD_DOCUMENT);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":118 */
  __pyx_v_c_pcontext = ((xsltTransformContext (*))__pyx_v_c_ctxt)->_private;
  goto __pyx_L2;
}
__pyx_1 = (__pyx_v_c_type == XSLT_LOAD_STYLESHEET);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":121 */
  __pyx_v_c_pcontext = ((xsltStylesheet (*))__pyx_v_c_ctxt)->doc->_private;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":123 */
  __pyx_v_c_pcontext = NULL;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":125 */
__pyx_1 = (__pyx_v_c_pcontext == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":127 */
  __pyx_r = __pyx_v_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":130 */
__pyx_v_gil_state = PyGILState_Ensure();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":131 */
__pyx_v_c_doc = __pyx_f_5etree__xslt_resolve_stylesheet(__pyx_v_c_uri,__pyx_v_c_pcontext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":132 */
__pyx_1 = (__pyx_v_c_doc != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":133 */
  PyGILState_Release(__pyx_v_gil_state);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":134 */
  __pyx_r = __pyx_v_c_doc;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":136 */
__pyx_v_c_doc = __pyx_f_5etree__xslt_resolve_from_python(__pyx_v_c_uri,__pyx_v_c_pcontext,__pyx_v_parse_options,(&__pyx_v_error));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":137 */
__pyx_1 = (__pyx_v_c_doc == NULL);
if (__pyx_1) {
  __pyx_1 = (!__pyx_v_error);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":138 */
  __pyx_v_c_doc = __pyx_v_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":140 */
  __pyx_1 = (__pyx_v_c_doc == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":141 */
    __pyx_f_5etree__xslt_store_resolver_exception(__pyx_v_c_uri,__pyx_v_c_pcontext,__pyx_v_c_type);
    goto __pyx_L6;
  }
  __pyx_L6:;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":143 */
PyGILState_Release(__pyx_v_gil_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":144 */
__pyx_r = __pyx_v_c_doc;
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

static PyObject *__pyx_k409p;

static char (__pyx_k409[]) = "Error preparing access control context";

static int __pyx_f_5etree_17XSLTAccessControl___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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_k168;
__pyx_v_write_file = __pyx_k169;
__pyx_v_create_dir = __pyx_k170;
__pyx_v_read_network = __pyx_k171;
__pyx_v_write_network = __pyx_k172;
if (!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)) 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":169 */
((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs = xsltNewSecurityPrefs();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":170 */
__pyx_1 = (((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":171 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 171; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k409p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 171; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":172 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self),XSLT_SECPREF_READ_FILE,__pyx_v_read_file); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 172; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":173 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self),XSLT_SECPREF_WRITE_FILE,__pyx_v_write_file); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 173; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":174 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self),XSLT_SECPREF_CREATE_DIRECTORY,__pyx_v_create_dir); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 174; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":175 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self),XSLT_SECPREF_READ_NETWORK,__pyx_v_read_network); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 175; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":176 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->__pyx_vtab)->_setAccess(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self),XSLT_SECPREF_WRITE_NETWORK,__pyx_v_write_network); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 176; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("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);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":179 */
__pyx_1 = (((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":180 */
  xsltFreeSecurityPrefs(((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_self)->_prefs);
  goto __pyx_L2;
}
__pyx_L2:;

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_5etree_17XSLTAccessControl__setAccess(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":184 */
__pyx_1 = PyObject_IsTrue(__pyx_v_allow); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 184; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":185 */
  __pyx_v_function = xsltSecurityAllow;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":187 */
  __pyx_v_function = xsltSecurityForbid;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":188 */
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("etree.XSLTAccessControl._setAccess");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_allow);
return __pyx_r;
}

static void __pyx_f_5etree_17XSLTAccessControl__register_in_context(struct __pyx_obj_5etree_XSLTAccessControl *__pyx_v_self,xsltTransformContext (*__pyx_v_ctxt)) {
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":191 */
xsltSetCtxtSecurityPrefs(__pyx_v_self->_prefs,__pyx_v_ctxt);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_k410p;

static char (__pyx_k410[]) = "extensions must not have empty namespaces";

static int __pyx_f_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_5etree_12_XSLTContext___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_namespaces = 0;
PyObject *__pyx_v_extensions = 0;
int __pyx_r;
PyObject *__pyx_1 = 0;
int __pyx_2;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"namespaces","extensions",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_namespaces, &__pyx_v_extensions)) return -1;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":199 */
((struct __pyx_obj_5etree__XSLTContext *)__pyx_v_self)->_xsltCtxt = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":200 */
__pyx_1 = __pyx_v_extensions;
Py_INCREF(__pyx_1);
__pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; goto __pyx_L1;}
if (__pyx_2) {
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_2 = PySequence_Contains(__pyx_v_extensions, Py_None); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; goto __pyx_L1;}
  __pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; goto __pyx_L1;}
}
__pyx_2 = PyObject_IsTrue(__pyx_1); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 200; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":201 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTExtensionError); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k410p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 201; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":202 */
__pyx_1 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__BaseContext), __pyx_n___init__); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; goto __pyx_L1;}
__pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
Py_INCREF(__pyx_v_namespaces);
PyTuple_SET_ITEM(__pyx_3, 1, __pyx_v_namespaces);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_3, 2, __pyx_v_extensions);
__pyx_4 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 202; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 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_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._XSLTContext.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_namespaces);
Py_DECREF(__pyx_v_extensions);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_XSLTContext_register_context(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":206 */
__pyx_v_self->_xsltCtxt = __pyx_v_xsltCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":207 */
((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._set_xpath_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_xsltCtxt->xpathCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":208 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._register_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self),__pyx_v_doc); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 208; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":209 */
__pyx_v_xsltCtxt->xpathCtxt->userData = ((void (*))__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":210 */
((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->_registerExtensionFunctions(__pyx_v_self);

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_AddTraceback("etree._XSLTContext.register_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_12_XSLTContext_free_context(struct __pyx_obj_5etree__XSLTContext *__pyx_v_self) {
xsltTransformContext (*__pyx_v_xsltCtxt);
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":214 */
__pyx_v_xsltCtxt = __pyx_v_self->_xsltCtxt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":215 */
__pyx_1 = (__pyx_v_xsltCtxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":216 */
  __pyx_r = Py_None; Py_INCREF(Py_None);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":217 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._free_context(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 217; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":218 */
__pyx_v_self->_xsltCtxt = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":219 */
xsltFreeTransformContext(__pyx_v_xsltCtxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":220 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base._release_temp_refs(((struct __pyx_obj_5etree__BaseContext *)__pyx_v_self)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 220; 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);
__Pyx_AddTraceback("etree._XSLTContext.free_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static void __pyx_f_5etree_12_XSLTContext__addLocalExtensionFunction(struct __pyx_obj_5etree__XSLTContext *__pyx_v_self,PyObject *__pyx_v_ns_utf,PyObject *__pyx_v_name_utf,PyObject *__pyx_v_function) {
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
Py_INCREF(__pyx_v_ns_utf);
Py_INCREF(__pyx_v_name_utf);
Py_INCREF(__pyx_v_function);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":223 */
__pyx_1 = __pyx_v_self->__pyx_base._extensions == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":224 */
  __pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 224; goto __pyx_L1;}
  Py_DECREF(__pyx_v_self->__pyx_base._extensions);
  __pyx_v_self->__pyx_base._extensions = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":225 */
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 225; 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);
__pyx_1 = PyDict_SetItem(__pyx_v_self->__pyx_base._extensions,__pyx_2,__pyx_v_function); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 225; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_WriteUnraisable("etree._XSLTContext._addLocalExtensionFunction");
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
}

static PyObject *__pyx_k411p;

static char (__pyx_k411[]) = "extensions must have non empty namespaces";

static void __pyx_f_5etree_12_XSLTContext__registerExtensionFunctions(struct __pyx_obj_5etree__XSLTContext *__pyx_v_self) {
PyObject (*__pyx_v_dict_result);
PyObject *__pyx_v_ns_utf;
PyObject *__pyx_v_functions;
PyObject *__pyx_v_d;
PyObject *__pyx_v_name_utf;
PyObject *__pyx_v_function;
PyObject *__pyx_v_last_ns;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
PyObject *__pyx_5 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_ns_utf = Py_None; Py_INCREF(Py_None);
__pyx_v_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);
__pyx_v_last_ns = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":229 */
__pyx_1 = __pyx_f_5etree__iter_extension_function_names(); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
__pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
for (;;) {
  __pyx_1 = PyIter_Next(__pyx_2);
  if (!__pyx_1) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_1;
  __pyx_1 = 0;
  __pyx_1 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_v_functions);
  __pyx_v_functions = __pyx_1;
  __pyx_1 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 229; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":230 */
  __pyx_4 = __pyx_v_ns_utf == Py_None;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":231 */
    goto __pyx_L2;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":232 */
  __pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->__pyx_base._function_cache_ns,__pyx_v_ns_utf);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":233 */
  __pyx_4 = (__pyx_v_dict_result == NULL);
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":234 */
    __pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 234; goto __pyx_L1;}
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_1;
    __pyx_1 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":235 */
    __pyx_4 = PyDict_SetItem(__pyx_v_self->__pyx_base._function_cache_ns,__pyx_v_ns_utf,__pyx_v_d); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 235; goto __pyx_L1;}
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":237 */
    __pyx_3 = (PyObject *)__pyx_v_dict_result;
    Py_INCREF(__pyx_3);
    Py_DECREF(__pyx_v_d);
    __pyx_v_d = __pyx_3;
    __pyx_3 = 0;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":238 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_functions, __pyx_n_iteritems); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetIter(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_1);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
      break;
    }
    __pyx_5 = PyObject_GetIter(__pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
    Py_DECREF(__pyx_v_name_utf);
    __pyx_v_name_utf = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
    Py_DECREF(__pyx_v_function);
    __pyx_v_function = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_5) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 238; goto __pyx_L1;}
    Py_DECREF(__pyx_5); __pyx_5 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":239 */
    __pyx_4 = PyDict_SetItem(__pyx_v_d,__pyx_v_name_utf,__pyx_v_function); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 239; goto __pyx_L1;}

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":240 */
    xsltRegisterExtFunction(__pyx_v_self->_xsltCtxt,_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),__pyx_f_5etree__xpath_function_call);
  }
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_L2:;
}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":243 */
__pyx_4 = __pyx_v_self->__pyx_base._extensions == Py_None;
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":244 */
  goto __pyx_L0;
  goto __pyx_L8;
}
__pyx_L8:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":245 */
Py_INCREF(Py_None);
Py_DECREF(__pyx_v_last_ns);
__pyx_v_last_ns = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":246 */
__pyx_3 = PyObject_GetAttr(__pyx_v_self->__pyx_base._extensions, __pyx_n_iteritems); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
__pyx_5 = PyObject_CallObject(__pyx_3, 0); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_1 = PyObject_GetIter(__pyx_5); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  __pyx_2 = PyObject_GetIter(__pyx_5); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __pyx_5 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_v_ns_utf);
  __pyx_v_ns_utf = __pyx_5;
  __pyx_5 = 0;
  __pyx_5 = __Pyx_UnpackItem(__pyx_2); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_v_name_utf);
  __pyx_v_name_utf = __pyx_5;
  __pyx_5 = 0;
  if (__Pyx_EndUnpack(__pyx_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_5 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_v_function);
  __pyx_v_function = __pyx_5;
  __pyx_5 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 246; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":247 */
  __pyx_4 = __pyx_v_ns_utf == Py_None;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":248 */
    __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 248; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k411p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 248; goto __pyx_L1;}
    goto __pyx_L11;
  }
  __pyx_4 = __pyx_v_ns_utf != __pyx_v_last_ns;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":251 */
    Py_INCREF(__pyx_v_ns_utf);
    Py_DECREF(__pyx_v_last_ns);
    __pyx_v_last_ns = __pyx_v_ns_utf;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":252 */
    __pyx_v_dict_result = PyDict_GetItem(__pyx_v_self->__pyx_base._function_cache_ns,__pyx_v_ns_utf);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":254 */
    __pyx_4 = (__pyx_v_dict_result == NULL);
    if (__pyx_4) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":255 */
      __pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 255; goto __pyx_L1;}
      Py_DECREF(__pyx_v_d);
      __pyx_v_d = __pyx_5;
      __pyx_5 = 0;

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":256 */
      __pyx_4 = PyDict_SetItem(__pyx_v_self->__pyx_base._function_cache_ns,__pyx_v_ns_utf,__pyx_v_d); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 256; goto __pyx_L1;}
      goto __pyx_L12;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":258 */
      __pyx_3 = (PyObject *)__pyx_v_dict_result;
      Py_INCREF(__pyx_3);
      Py_DECREF(__pyx_v_d);
      __pyx_v_d = __pyx_3;
      __pyx_3 = 0;
    }
    __pyx_L12:;
    goto __pyx_L11;
  }
  __pyx_L11:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":259 */
  __pyx_4 = PyDict_SetItem(__pyx_v_d,__pyx_v_name_utf,__pyx_v_function); if (__pyx_4 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 259; goto __pyx_L1;}

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":260 */
  xsltRegisterExtFunction(__pyx_v_self->_xsltCtxt,_cstr(__pyx_v_name_utf),_cstr(__pyx_v_ns_utf),__pyx_f_5etree__xpath_function_call);
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_5);
__Pyx_WriteUnraisable("etree._XSLTContext._registerExtensionFunctions");
__pyx_L0:;
Py_DECREF(__pyx_v_ns_utf);
Py_DECREF(__pyx_v_functions);
Py_DECREF(__pyx_v_d);
Py_DECREF(__pyx_v_name_utf);
Py_DECREF(__pyx_v_function);
Py_DECREF(__pyx_v_last_ns);
Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_k412p;
static PyObject *__pyx_k413p;

static char (__pyx_k412[]) = "XSLT:__STRING__XSLT__%s";
static char (__pyx_k413[]) = "Cannot parse style sheet";

static int __pyx_f_5etree_4XSLT___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
PyThreadState (*__pyx_v_state);
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;
int __pyx_2;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"xslt_input","extensions","regexp","access_control",0};
__pyx_v_extensions = __pyx_k173;
__pyx_v_regexp = __pyx_k174;
__pyx_v_access_control = __pyx_k175;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|OOO", __pyx_argnames, &__pyx_v_xslt_input, &__pyx_v_extensions, &__pyx_v_regexp, &__pyx_v_access_control)) 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":284 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_xslt_input)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 284; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":285 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_xslt_input)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 285; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":288 */
if (!__Pyx_TypeTest(__pyx_v_access_control, __pyx_ptype_5etree_XSLTAccessControl)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 288; goto __pyx_L1;}
Py_INCREF(__pyx_v_access_control);
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_access_control));
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_access_control = ((struct __pyx_obj_5etree_XSLTAccessControl *)__pyx_v_access_control);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":291 */
__pyx_v_c_doc = __pyx_f_5etree__copyDocRoot(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":294 */
__pyx_2 = (__pyx_v_c_doc->URL == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":295 */
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 295; goto __pyx_L1;}
  Py_INCREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
  __pyx_3 = PyObject_CallObject(__pyx_v_5etree_id, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 295; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyNumber_Remainder(__pyx_k412p, __pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 295; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_v_doc_url_utf);
  __pyx_v_doc_url_utf = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":296 */
  __pyx_v_c_doc->URL = xmlStrdup(_cstr(__pyx_v_doc_url_utf));
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":298 */
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ErrorLog), 0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 298; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__ErrorLog)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 298; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log));
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":299 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 299; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_doc->_parser));
PyTuple_SET_ITEM(__pyx_1, 0, ((PyObject *)__pyx_v_doc->_parser));
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__XSLTResolverContext), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 299; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__XSLTResolverContext)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 299; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context));
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":301 */
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc = __pyx_f_5etree__copyDoc(__pyx_v_c_doc,1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":302 */
__pyx_v_c_doc->_private = ((PyObject (*))((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":304 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":305 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":306 */
__pyx_v_c_style = xsltParseStylesheetDoc(__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":307 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":308 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":310 */
__pyx_2 = (__pyx_v_c_style == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":311 */
  xmlFreeDoc(__pyx_v_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":312 */
  __pyx_1 = ((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_5etree__ExceptionContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 312; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":313 */
  __pyx_2 = ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error != Py_None;
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":314 */
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 314; goto __pyx_L1;}
    __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error, __pyx_n_message); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 314; 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 = 314; goto __pyx_L1;}
    goto __pyx_L4;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":316 */
    __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTParseError); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 316; goto __pyx_L1;}
    __Pyx_Raise(__pyx_3, __pyx_k413p, 0);
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 316; goto __pyx_L1;}
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":318 */
__pyx_v_c_doc->_private = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":319 */
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_c_style = __pyx_v_c_style;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":321 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 321; goto __pyx_L1;}
Py_INCREF(Py_None);
PyTuple_SET_ITEM(__pyx_1, 0, Py_None);
Py_INCREF(__pyx_v_extensions);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_extensions);
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__XSLTContext), __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 321; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__XSLTContext)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 321; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_context));
((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_context = ((struct __pyx_obj_5etree__XSLTContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":322 */
__pyx_2 = PyObject_IsTrue(__pyx_v_regexp); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 322; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":323 */
  __pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ExsltRegExp), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 323; goto __pyx_L1;}
  if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__ExsltRegExp)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 323; goto __pyx_L1;}
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp));
  ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp = ((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_1);
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":324 */
  __pyx_3 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp->__pyx_vtab)->_register_in_context(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp,((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_context); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 324; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L5;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":326 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__ExsltRegExp)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 326; goto __pyx_L1;}
  Py_INCREF(Py_None);
  Py_DECREF(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp));
  ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_regexp = ((struct __pyx_obj_5etree__ExsltRegExp *)Py_None);
}
__pyx_L5:;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("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);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":330 */
__pyx_1 = ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context != Py_None;
if (__pyx_1) {
  __pyx_1 = (((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc != NULL);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":332 */
  xmlFreeDoc(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc);
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":334 */
xsltFreeStylesheet(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_c_style);

Py_DECREF(__pyx_v_self);
}

static PyObject *__pyx_f_5etree_4XSLT_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":338 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log), __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 338; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __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("etree.XSLT.error_log.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_RuntimeError;
static PyObject *__pyx_n_line;

static PyObject *__pyx_k414p;
static PyObject *__pyx_k415p;
static PyObject *__pyx_k416p;
static PyObject *__pyx_k417p;
static PyObject *__pyx_k418p;

static char (__pyx_k414[]) = "stylesheet is not usable in this thread";
static char (__pyx_k415[]) = "Error preparing stylesheet run";
static char (__pyx_k416[]) = "%s, line %d";
static char (__pyx_k417[]) = "Error applying stylesheet, line %d";
static char (__pyx_k418[]) = "Error applying stylesheet";

static PyObject *__pyx_f_5etree_4XSLT___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyThreadState (*__pyx_v_state);
struct __pyx_obj_5etree__XSLTContext *__pyx_v_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);
struct __pyx_obj_5etree__XSLTResolverContext *__pyx_v_resolver_context;
xsltTransformContext (*__pyx_v_transform_ctxt);
xmlDoc (*__pyx_v_c_result);
xmlDoc (*__pyx_v_c_doc);
char (*(*__pyx_v_params));
Py_ssize_t __pyx_v_i;
Py_ssize_t __pyx_v_kw_count;
PyObject *__pyx_v_keep_ref;
PyObject *__pyx_v_key;
PyObject *__pyx_v_value;
PyObject *__pyx_v_k;
PyObject *__pyx_v_v;
PyObject *__pyx_v_error;
PyObject *__pyx_v_message;
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"_input","profile_run",0};
__pyx_v_profile_run = __pyx_k176;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, &__pyx_v__kw) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__input);
Py_INCREF(__pyx_v_profile_run);
__pyx_v_context = ((struct __pyx_obj_5etree__XSLTContext *)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_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
__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);
__pyx_v_error = Py_None; Py_INCREF(Py_None);
__pyx_v_message = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":355 */
__pyx_1 = (!__pyx_f_5etree__checkThreadDict(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_c_style->doc->dict));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":356 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_RuntimeError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 356; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k414p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 356; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":358 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v__input)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 358; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_input_doc));
__pyx_v_input_doc = ((struct LxmlDocument *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":359 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v__input)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 359; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":361 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_input_doc->_parser));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_input_doc->_parser));
__pyx_3 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__XSLTResolverContext), __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__XSLTResolverContext)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 361; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_resolver_context));
__pyx_v_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":362 */
__pyx_v_resolver_context->_c_style_doc = ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->_c_style_doc;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":364 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_input_doc->_c_doc,__pyx_v_root_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":366 */
__pyx_v_transform_ctxt = xsltNewTransformContext(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_c_style,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":367 */
__pyx_1 = (__pyx_v_transform_ctxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":368 */
  __pyx_f_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc,__pyx_v_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":369 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTApplyError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 369; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k415p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 369; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":371 */
__pyx_f_5etree_initTransformDict(__pyx_v_transform_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":373 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":374 */
xsltSetTransformErrorFunc(__pyx_v_transform_ctxt,((void (*))((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log),__pyx_f_5etree__receiveXSLTError);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":377 */
__pyx_1 = ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_access_control != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":378 */
  ((struct __pyx_vtabstruct_5etree_XSLTAccessControl *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_access_control->__pyx_vtab)->_register_in_context(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_access_control,__pyx_v_transform_ctxt);
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":380 */
__pyx_1 = PyObject_IsTrue(__pyx_v_profile_run); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 380; goto __pyx_L1;}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":381 */
  __pyx_v_transform_ctxt->profile = 1;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":383 */
__pyx_v_transform_ctxt->_private = ((PyObject (*))((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":385 */
__pyx_v_kw_count = PyDict_Size(__pyx_v__kw);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":386 */
__pyx_1 = (__pyx_v_kw_count > 0);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":390 */
  __pyx_v_params = ((char (*(*)))PyMem_Malloc(((sizeof(char (*))) * ((__pyx_v_kw_count * 2) + 1))));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":392 */
  __pyx_v_i = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":393 */
  __pyx_3 = PyList_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 393; goto __pyx_L1;}
  Py_DECREF(__pyx_v_keep_ref);
  __pyx_v_keep_ref = __pyx_3;
  __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":394 */
  __pyx_2 = PyObject_GetAttr(__pyx_v__kw, __pyx_n_iteritems); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = PyObject_GetIter(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  for (;;) {
    __pyx_3 = PyIter_Next(__pyx_2);
    if (!__pyx_3) {
      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
      break;
    }
    __pyx_4 = PyObject_GetIter(__pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
    Py_DECREF(__pyx_3); __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
    Py_DECREF(__pyx_v_key);
    __pyx_v_key = __pyx_3;
    __pyx_3 = 0;
    __pyx_3 = __Pyx_UnpackItem(__pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
    Py_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_3;
    __pyx_3 = 0;
    if (__Pyx_EndUnpack(__pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 394; goto __pyx_L1;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":395 */
    __pyx_3 = __pyx_f_5etree__utf8(__pyx_v_key); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 395; goto __pyx_L1;}
    Py_DECREF(__pyx_v_k);
    __pyx_v_k = __pyx_3;
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":396 */
    __pyx_1 = PyList_Append(__pyx_v_keep_ref,__pyx_v_k); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 396; goto __pyx_L1;}

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":397 */
    __pyx_4 = __pyx_f_5etree__utf8(__pyx_v_value); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 397; goto __pyx_L1;}
    Py_DECREF(__pyx_v_v);
    __pyx_v_v = __pyx_4;
    __pyx_4 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":398 */
    __pyx_1 = PyList_Append(__pyx_v_keep_ref,__pyx_v_v); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 398; goto __pyx_L1;}

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":399 */
    (__pyx_v_params[__pyx_v_i]) = _cstr(__pyx_v_k);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":400 */
    __pyx_v_i = (__pyx_v_i + 1);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":401 */
    (__pyx_v_params[__pyx_v_i]) = _cstr(__pyx_v_v);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":402 */
    __pyx_v_i = (__pyx_v_i + 1);
  }
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":403 */
  (__pyx_v_params[__pyx_v_i]) = NULL;
  goto __pyx_L6;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":405 */
  __pyx_v_params = NULL;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":407 */
__pyx_3 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_context->__pyx_base.__pyx_vtab)->__pyx_base._copy(((struct __pyx_obj_5etree__BaseContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_context)); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 407; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_3, __pyx_ptype_5etree__XSLTContext)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 407; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_context));
__pyx_v_context = ((struct __pyx_obj_5etree__XSLTContext *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":408 */
__pyx_4 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->register_context(__pyx_v_context,__pyx_v_transform_ctxt,__pyx_v_input_doc); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 408; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":410 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":411 */
__pyx_v_c_result = xsltApplyStylesheetUser(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_c_style,__pyx_v_c_doc,__pyx_v_params,NULL,NULL,__pyx_v_transform_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":413 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":415 */
__pyx_1 = (__pyx_v_params != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":417 */
  PyMem_Free(__pyx_v_params);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":419 */
__pyx_1 = __pyx_v_transform_ctxt->profile;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":420 */
  __pyx_v_c_profile_doc = xsltGetProfileInformation(__pyx_v_transform_ctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":421 */
  __pyx_1 = (__pyx_v_c_profile_doc != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":422 */
    __pyx_2 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_profile_doc,__pyx_v_input_doc->_parser)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 422; goto __pyx_L1;}
    Py_DECREF(((PyObject *)__pyx_v_profile_doc));
    __pyx_v_profile_doc = ((struct LxmlDocument *)__pyx_2);
    __pyx_2 = 0;
    goto __pyx_L11;
  }
  __pyx_L11:;
  goto __pyx_L10;
}
__pyx_L10:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":424 */
__pyx_3 = ((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->free_context(__pyx_v_context); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 424; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":425 */
__pyx_f_5etree__destroyFakeDoc(__pyx_v_input_doc->_c_doc,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":427 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":428 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":429 */
  __pyx_1 = ((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._has_raised(((struct __pyx_obj_5etree__ExceptionContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context));
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":430 */
    __pyx_1 = (__pyx_v_c_result != NULL);
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":431 */
      xmlFreeDoc(__pyx_v_c_result);
      goto __pyx_L16;
    }
    __pyx_L16:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":432 */
    __pyx_4 = ((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base._raise_if_stored(((struct __pyx_obj_5etree__ExceptionContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context)); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 432; goto __pyx_L13;}
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    goto __pyx_L15;
  }
  __pyx_L15:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":434 */
  __pyx_1 = (__pyx_v_c_result == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":435 */
    Py_INCREF(((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error);
    Py_DECREF(__pyx_v_error);
    __pyx_v_error = ((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_error_log->__pyx_base.__pyx_base.last_error;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":436 */
    __pyx_1 = __pyx_v_error != Py_None;
    __pyx_2 = PyInt_FromLong(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 436; goto __pyx_L13;}
    __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 436; goto __pyx_L13;}
    if (__pyx_1) {
      Py_DECREF(__pyx_2); __pyx_2 = 0;
      __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 436; goto __pyx_L13;}
    }
    __pyx_1 = PyObject_IsTrue(__pyx_2); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 436; goto __pyx_L13;}
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":437 */
      __pyx_3 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 437; goto __pyx_L13;}
      __pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 437; goto __pyx_L13;}
      if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 437; goto __pyx_L13;}
      __pyx_1 = __pyx_1 >= 0;
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_4); __pyx_4 = 0;
      if (__pyx_1) {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":438 */
        __pyx_2 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 438; goto __pyx_L13;}
        __pyx_3 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 438; goto __pyx_L13;}
        __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 438; goto __pyx_L13;}
        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_k416p, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 438; goto __pyx_L13;}
        Py_DECREF(__pyx_4); __pyx_4 = 0;
        Py_DECREF(__pyx_v_message);
        __pyx_v_message = __pyx_2;
        __pyx_2 = 0;
        goto __pyx_L19;
      }
      /*else*/ {

        /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":440 */
        __pyx_3 = PyObject_GetAttr(__pyx_v_error, __pyx_n_message); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 440; goto __pyx_L13;}
        Py_DECREF(__pyx_v_message);
        __pyx_v_message = __pyx_3;
        __pyx_3 = 0;
      }
      __pyx_L19:;
      goto __pyx_L18;
    }
    __pyx_4 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 441; goto __pyx_L13;}
    __pyx_2 = PyInt_FromLong(0); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 441; goto __pyx_L13;}
    if (PyObject_Cmp(__pyx_4, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 441; goto __pyx_L13;}
    __pyx_1 = __pyx_1 >= 0;
    Py_DECREF(__pyx_4); __pyx_4 = 0;
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    if (__pyx_1) {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":442 */
      __pyx_3 = PyObject_GetAttr(__pyx_v_error, __pyx_n_line); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 442; goto __pyx_L13;}
      __pyx_4 = PyNumber_Remainder(__pyx_k417p, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 442; goto __pyx_L13;}
      Py_DECREF(__pyx_3); __pyx_3 = 0;
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_4;
      __pyx_4 = 0;
      goto __pyx_L18;
    }
    /*else*/ {

      /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":444 */
      Py_INCREF(__pyx_k418p);
      Py_DECREF(__pyx_v_message);
      __pyx_v_message = __pyx_k418p;
    }
    __pyx_L18:;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":445 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTApplyError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 445; goto __pyx_L13;}
    __Pyx_Raise(__pyx_2, __pyx_v_message, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[13]; __pyx_lineno = 445; goto __pyx_L13;}
    goto __pyx_L17;
  }
  __pyx_L17:;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L14;
  __pyx_L13: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_4); __pyx_4 = 0;
    Py_XDECREF(__pyx_2); __pyx_2 = 0;
    PyErr_Fetch(&__pyx_3, &__pyx_4, &__pyx_2);
    __pyx_1 = __pyx_lineno;
    goto __pyx_L14;
  }
  __pyx_L14:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":447 */
  ((struct __pyx_vtabstruct_5etree__XSLTResolverContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.__pyx_base.clear(((struct __pyx_obj_5etree__ExceptionContext *)((struct __pyx_obj_5etree_XSLT *)__pyx_v_self)->_xslt_resolver_context));
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_3, __pyx_4, __pyx_2);
      __pyx_lineno = __pyx_1;
      __pyx_3 = 0;
      __pyx_4 = 0;
      __pyx_2 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":449 */
__pyx_3 = ((PyObject *)__pyx_f_5etree__documentFactory(__pyx_v_c_result,__pyx_v_input_doc->_parser)); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 449; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result_doc));
__pyx_v_result_doc = ((struct LxmlDocument *)__pyx_3);
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":450 */
__pyx_4 = __pyx_f_5etree__xsltResultTreeFactory(__pyx_v_result_doc,((struct __pyx_obj_5etree_XSLT *)__pyx_v_self),__pyx_v_profile_doc); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 450; goto __pyx_L1;}
__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("etree.XSLT.__call__");
__pyx_r = 0;
__pyx_L0:;
Py_XDECREF(__pyx_v__kw);
Py_DECREF((PyObject *)__pyx_v_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((PyObject *)__pyx_v_resolver_context);
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_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;
}

static PyObject *__pyx_f_5etree_4XSLT_apply(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
static char *__pyx_argnames[] = {"_input","profile_run",0};
__pyx_v_profile_run = __pyx_k177;
if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 2, 0, &__pyx_v__kw) < 0) return 0;
if (!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 0;
}
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v__input);
Py_INCREF(__pyx_v_profile_run);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":453 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 453; goto __pyx_L1;}
Py_INCREF(__pyx_v__input);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v__input);
Py_INCREF(__pyx_v_profile_run);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_profile_run);
__pyx_2 = PyEval_CallObjectWithKeywords(__pyx_v_self, __pyx_1, __pyx_v__kw); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 453; 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("etree.XSLT.apply");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_f_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_4XSLT_tostring[] = "Save result doc to string based on stylesheet output method.\n        ";
static PyObject *__pyx_f_5etree_4XSLT_tostring(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
struct LxmlElementTree *__pyx_v_result_tree = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
static char *__pyx_argnames[] = {"result_tree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_result_tree)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_result_tree);
if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_result_tree), __pyx_ptype_5etree__ElementTree, 1, "result_tree")) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 455; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":458 */
__pyx_1 = str(((PyObject *)__pyx_v_result_tree)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 458; 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("etree.XSLT.tostring");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_result_tree);
return __pyx_r;
}

static PyObject *__pyx_k419p;

static char (__pyx_k419[]) = "Error saving XSLT result to string";

static PyObject *__pyx_f_5etree_15_XSLTResultTree__saveToStringAndSize(struct __pyx_obj_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":466 */
__pyx_1 = __pyx_v_self->__pyx_base._context_node != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":467 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":468 */
__pyx_1 = __pyx_v_doc == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":469 */
  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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":470 */
  __pyx_1 = __pyx_v_doc == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":471 */
    (__pyx_v_s[0]) = NULL;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":472 */
    __pyx_r = Py_None; Py_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":473 */
__pyx_v_r = xsltSaveResultToString(__pyx_v_s,__pyx_v_l,__pyx_v_doc->_c_doc,__pyx_v_self->_xslt->_c_style);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":474 */
__pyx_1 = (__pyx_v_r == (-1));
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":475 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTSaveError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 475; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k419p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 475; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

__pyx_r = Py_None; Py_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree._XSLTResultTree._saveToStringAndSize");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k420p;

static char (__pyx_k420[]) = "";

static PyObject *__pyx_f_5etree_15_XSLTResultTree___str__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":480 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XSLTResultTree *)((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_saveToStringAndSize(((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self),(&__pyx_v_s),(&__pyx_v_l)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 480; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":481 */
__pyx_2 = (__pyx_v_s == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":482 */
  Py_INCREF(__pyx_k420p);
  __pyx_r = __pyx_k420p;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":484 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":485 */
  __pyx_1 = PyString_FromStringAndSize(__pyx_v_s,__pyx_v_l); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 485; goto __pyx_L4;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L5;
  __pyx_L4: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_1, &__pyx_3, &__pyx_4);
    __pyx_2 = __pyx_lineno;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":487 */
  xmlFree(__pyx_v_s);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_1, __pyx_3, __pyx_4);
      __pyx_lineno = __pyx_2;
      __pyx_1 = 0;
      __pyx_3 = 0;
      __pyx_4 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":488 */
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_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._XSLTResultTree.__str__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_n_unicode;

static char (__pyx_k421[]) = "ascii";
static char (__pyx_k422[]) = "strict";

static PyObject *__pyx_f_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_5etree_15_XSLTResultTree___unicode__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
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;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
Py_INCREF((PyObject *)__pyx_v_self);
__pyx_v_result = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":494 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__XSLTResultTree *)((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->__pyx_base.__pyx_vtab)->_saveToStringAndSize(((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self),(&__pyx_v_s),(&__pyx_v_l)); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 494; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":495 */
__pyx_2 = (__pyx_v_s == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":496 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_unicode); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 496; goto __pyx_L1;}
  __pyx_3 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 496; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":497 */
__pyx_v_encoding = ((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_xslt->_c_style->encoding;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":498 */
__pyx_2 = (__pyx_v_encoding == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":499 */
  __pyx_v_encoding = __pyx_k421;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":500 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":501 */
  __pyx_1 = PyUnicode_Decode(__pyx_v_s,__pyx_v_l,__pyx_v_encoding,__pyx_k422); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 501; goto __pyx_L5;}
  Py_DECREF(__pyx_v_result);
  __pyx_v_result = __pyx_1;
  __pyx_1 = 0;
}
/*finally:*/ {
  int __pyx_why;
  __pyx_why = 0; goto __pyx_L6;
  __pyx_L5: {
    __pyx_why = 4;
    Py_XDECREF(__pyx_3); __pyx_3 = 0;
    Py_XDECREF(__pyx_1); __pyx_1 = 0;
    PyErr_Fetch(&__pyx_3, &__pyx_1, &__pyx_4);
    __pyx_2 = __pyx_lineno;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":503 */
  xmlFree(__pyx_v_s);
  switch (__pyx_why) {
    case 3: goto __pyx_L0;
    case 4: {
      PyErr_Restore(__pyx_3, __pyx_1, __pyx_4);
      __pyx_lineno = __pyx_2;
      __pyx_3 = 0;
      __pyx_1 = 0;
      __pyx_4 = 0;
      goto __pyx_L1;
    }
  }
}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":504 */
__pyx_3 = __pyx_f_5etree__stripEncodingDeclaration(__pyx_v_result); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 504; 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_1);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("etree._XSLTResultTree.__unicode__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_result);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_15_XSLTResultTree_12xslt_profile___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":511 */
__pyx_1 = ((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_profile == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":512 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":513 */
__pyx_2 = ((struct __pyx_vtabstruct_5etree__Document *)((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_profile->__pyx_vtab)->getroot(((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_profile); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 513; goto __pyx_L1;}
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":514 */
__pyx_1 = __pyx_v_root == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":515 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":516 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ElementTree); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 516; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 516; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 516; 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("etree._XSLTResultTree.xslt_profile.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_root);
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":519 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 519; goto __pyx_L1;}
Py_INCREF(Py_None);
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_profile));
((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_v_self)->_profile = ((struct LxmlDocument *)Py_None);

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree._XSLTResultTree.xslt_profile.__del__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_f_5etree__xsltResultTreeFactory(struct LxmlDocument *__pyx_v_doc,struct __pyx_obj_5etree_XSLT *__pyx_v_xslt,struct LxmlDocument *__pyx_v_profile) {
struct __pyx_obj_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_5etree__XSLTResultTree *)Py_None); Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":523 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 523; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__newElementTree(__pyx_v_doc,((struct LxmlElement *)Py_None),((PyObject*)__pyx_ptype_5etree__XSLTResultTree))); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 523; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_1)));
Py_DECREF(((PyObject *)__pyx_v_result));
__pyx_v_result = ((struct __pyx_obj_5etree__XSLTResultTree *)__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":524 */
Py_INCREF(((PyObject *)__pyx_v_xslt));
Py_DECREF(((PyObject *)__pyx_v_result->_xslt));
__pyx_v_result->_xslt = __pyx_v_xslt;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":525 */
Py_INCREF(((PyObject *)__pyx_v_profile));
Py_DECREF(((PyObject *)__pyx_v_result->_profile));
__pyx_v_result->_profile = __pyx_v_profile;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":526 */
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("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;
}

static xmlXPathFunction __pyx_f_5etree__xslt_function_check(void (*__pyx_v_ctxt),char (*__pyx_v_c_name),char (*__pyx_v_c_ns_uri)) {
xmlXPathFunction __pyx_v_result;
xmlXPathFunction __pyx_r;
int __pyx_1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":540 */
__pyx_v_result = __pyx_f_5etree__function_check(__pyx_v_ctxt,__pyx_v_c_name,__pyx_v_c_ns_uri);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":541 */
__pyx_1 = (__pyx_v_result == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":542 */
  __pyx_r = xsltExtModuleFunctionLookup(__pyx_v_c_name,__pyx_v_c_ns_uri);
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":544 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;
}
__pyx_L2:;

__pyx_L0:;
return __pyx_r;
}

static void __pyx_f_5etree_initTransformDict(xsltTransformContext (*__pyx_v_transform_ctxt)) {

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":547 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initThreadDictRef(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,(&__pyx_v_transform_ctxt->dict));

}

static PyObject *__pyx_k423p;
static PyObject *__pyx_k424p;
static PyObject *__pyx_k425p;
static PyObject *__pyx_k427p;
static PyObject *__pyx_k428p;

static char (__pyx_k423[]) = "PI lacks content";
static char (__pyx_k424[]) = " ";
static char (__pyx_k425[]) = "malformed PI attributes";
static char (__pyx_k427[]) = "reference to non-existing embedded stylesheet";
static char (__pyx_k428[]) = "ambiguous reference to embedded stylesheet";

static PyObject *__pyx_f_5etree_26_XSLTProcessingInstruction_parseXSL(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_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_f_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;
PyObject *__pyx_4 = 0;
int __pyx_5;
static char *__pyx_argnames[] = {"parser",0};
__pyx_v_parser = __pyx_k183;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_parser)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":584 */
__pyx_1 = (((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":585 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 585; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k423p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 585; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":586 */
__pyx_2 = PyString_FromString(((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->content); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 586; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k424p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 586; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 586; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_3);
__pyx_3 = 0;
__pyx_3 = PyObject_CallObject(__pyx_v_5etree__FIND_PI_HREF, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 586; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":587 */
__pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 587; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 587; goto __pyx_L1;}
Py_INCREF(__pyx_v_hrefs_utf);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_hrefs_utf);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 587; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = PyInt_FromLong(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 587; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_4, __pyx_2, &__pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 587; goto __pyx_L1;}
__pyx_1 = __pyx_1 != 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":588 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 588; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_k425p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 588; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":589 */
__pyx_4 = PyInt_FromLong(0); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 589; goto __pyx_L1;}
__pyx_2 = PyObject_GetItem(__pyx_v_hrefs_utf, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 589; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_href_utf);
__pyx_v_href_utf = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":590 */
__pyx_v_c_href = _cstr(__pyx_v_href_utf);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":592 */
__pyx_1 = ((__pyx_v_c_href[0]) != '#');
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":594 */
  __pyx_v_c_href = xmlBuildURI(__pyx_v_c_href,xmlNodeGetBase(((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc,((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":597 */
  __pyx_1 = (__pyx_v_c_href != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":598 */
    __pyx_3 = __pyx_f_5etree_funicode(__pyx_v_c_href); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 598; goto __pyx_L1;}
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_3;
    __pyx_3 = 0;

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":599 */
    xmlFree(__pyx_v_c_href);
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":601 */
    __pyx_4 = __pyx_f_5etree_funicode(_cstr(__pyx_v_href_utf)); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 601; goto __pyx_L1;}
    Py_DECREF(__pyx_v_href);
    __pyx_v_href = __pyx_4;
    __pyx_4 = 0;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":602 */
  if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 602; goto __pyx_L1;}
  __pyx_2 = ((PyObject *)__pyx_f_5etree__parseDocument(__pyx_v_href,((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser))); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 602; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result_doc));
  __pyx_v_result_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":603 */
  if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 603; goto __pyx_L1;}
  __pyx_3 = ((PyObject *)__pyx_f_5etree__elementTreeFactory(__pyx_v_result_doc,((struct LxmlElement *)Py_None))); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 603; goto __pyx_L1;}
  __pyx_r = __pyx_3;
  __pyx_3 = 0;
  goto __pyx_L0;
  goto __pyx_L4;
}
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":607 */
__pyx_v_c_href = (__pyx_v_c_href + 1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":608 */
__pyx_v_c_attr = xmlGetID(((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc,__pyx_v_c_href);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":609 */
__pyx_1 = (__pyx_v_c_attr != NULL);
if (__pyx_1) {
  __pyx_1 = (__pyx_v_c_attr->doc == ((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._c_node->doc);
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":610 */
  __pyx_4 = ((PyObject *)__pyx_f_5etree__elementFactory(((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc,__pyx_v_c_attr->parent)); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 610; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_result_node));
  __pyx_v_result_node = ((struct LxmlElement *)__pyx_4);
  __pyx_4 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":611 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__elementTreeFactory(__pyx_v_result_node->_doc,__pyx_v_result_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 611; goto __pyx_L1;}
  __pyx_r = __pyx_2;
  __pyx_2 = 0;
  goto __pyx_L0;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":614 */
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 614; goto __pyx_L1;}
Py_INCREF(((PyObject *)((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc));
PyTuple_SET_ITEM(__pyx_3, 0, ((PyObject *)((struct __pyx_obj_5etree__XSLTProcessingInstruction *)__pyx_v_self)->__pyx_base.__pyx_base.__pyx_base.__pyx_base._doc));
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 614; goto __pyx_L1;}
__pyx_2 = __pyx_f_5etree_funicode(__pyx_v_c_href); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 614; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_4, __pyx_n_id, __pyx_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 614; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_2 = PyEval_CallObjectWithKeywords(((PyObject *)__pyx_v_5etree__findStylesheetByID), __pyx_3, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 614; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_root);
__pyx_v_root = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":615 */
__pyx_1 = PyObject_IsTrue(__pyx_v_root); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 615; goto __pyx_L1;}
__pyx_5 = (!__pyx_1);
if (__pyx_5) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":616 */
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 616; goto __pyx_L1;}
  __Pyx_Raise(__pyx_3, __pyx_k427p, 0);
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 616; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_len); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 617; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 617; goto __pyx_L1;}
Py_INCREF(__pyx_v_root);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_root);
__pyx_3 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 617; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = PyInt_FromLong(1); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 617; goto __pyx_L1;}
if (PyObject_Cmp(__pyx_3, __pyx_4, &__pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 617; goto __pyx_L1;}
__pyx_1 = __pyx_1 > 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":618 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 618; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k428p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 618; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":619 */
__pyx_3 = PyInt_FromLong(0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 619; goto __pyx_L1;}
__pyx_4 = PyObject_GetItem(__pyx_v_root, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 619; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 619; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_result_node));
__pyx_v_result_node = ((struct LxmlElement *)__pyx_4);
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":620 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementTreeFactory(__pyx_v_result_node->_doc,__pyx_v_result_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 620; 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("etree._XSLTProcessingInstruction.parseXSL");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_href;

static PyObject *__pyx_k430p;
static PyObject *__pyx_k431p;
static PyObject *__pyx_k432p;
static PyObject *__pyx_k433p;
static PyObject *__pyx_k434p;
static PyObject *__pyx_k435p;
static PyObject *__pyx_k436p;

static char (__pyx_k430[]) = "only setting the 'href' attribute is supported on XSLT-PIs";
static char (__pyx_k431[]) = "";
static char (__pyx_k432[]) = "\"";
static char (__pyx_k433[]) = ">";
static char (__pyx_k434[]) = "Invalid URL, must not contain '\"' or '>'";
static char (__pyx_k435[]) = " href=\"%s\"";
static char (__pyx_k436[]) = " ";

static PyObject *__pyx_f_5etree_26_XSLTProcessingInstruction_set(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
static char *__pyx_argnames[] = {"key","value",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_key, &__pyx_v_value)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":623 */
if (PyObject_Cmp(__pyx_v_key, __pyx_n_href, &__pyx_1) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 623; goto __pyx_L1;}
__pyx_1 = __pyx_1 != 0;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":624 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 624; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k430p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 624; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":625 */
__pyx_1 = __pyx_v_value == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":626 */
  Py_INCREF(__pyx_k431p);
  Py_DECREF(__pyx_v_attrib);
  __pyx_v_attrib = __pyx_k431p;
  goto __pyx_L3;
}
__pyx_1 = PySequence_Contains(__pyx_v_value, __pyx_k432p); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 627; goto __pyx_L1;}
if (!__pyx_1) {
  __pyx_1 = PySequence_Contains(__pyx_v_value, __pyx_k433p); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 627; goto __pyx_L1;}
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":628 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 628; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k434p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[13]; __pyx_lineno = 628; goto __pyx_L1;}
  goto __pyx_L3;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":630 */
  __pyx_2 = PyNumber_Remainder(__pyx_k435p, __pyx_v_value); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 630; goto __pyx_L1;}
  Py_DECREF(__pyx_v_attrib);
  __pyx_v_attrib = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":631 */
__pyx_2 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 631; goto __pyx_L1;}
__pyx_3 = PyNumber_Add(__pyx_k436p, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 631; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_text);
__pyx_v_text = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":632 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 632; goto __pyx_L1;}
Py_INCREF(__pyx_v_text);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_text);
__pyx_3 = PyObject_CallObject(__pyx_v_5etree__FIND_PI_HREF, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 632; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_1 = PyObject_IsTrue(__pyx_3); if (__pyx_1 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 632; goto __pyx_L1;}
Py_DECREF(__pyx_3); __pyx_3 = 0;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":633 */
  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 633; goto __pyx_L1;}
  Py_INCREF(__pyx_v_attrib);
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_attrib);
  Py_INCREF(__pyx_v_text);
  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_v_text);
  __pyx_3 = PyObject_CallObject(__pyx_v_5etree__REPLACE_PI_HREF, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 633; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_text, __pyx_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 633; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  goto __pyx_L4;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":635 */
  __pyx_2 = PyNumber_Add(__pyx_v_text, __pyx_v_attrib); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 635; goto __pyx_L1;}
  if (PyObject_SetAttr(__pyx_v_self, __pyx_n_text, __pyx_2) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 635; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
}
__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("etree._XSLTProcessingInstruction.set");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_k437p;

static char (__pyx_k437[]) = " ";

static PyObject *__pyx_f_5etree_26_XSLTProcessingInstruction_get(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
int __pyx_4;
static char *__pyx_argnames[] = {"key","default",0};
__pyx_v_default = __pyx_k184;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O|O", __pyx_argnames, &__pyx_v_key, &__pyx_v_default)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":638 */
__pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_text); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
__pyx_2 = PyNumber_Add(__pyx_k437p, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
__pyx_2 = 0;
__pyx_2 = PyObject_CallObject(__pyx_v_5etree__FIND_PI_ATTRIBUTES, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_1 = PyObject_GetIter(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
for (;;) {
  __pyx_2 = PyIter_Next(__pyx_1);
  if (!__pyx_2) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
    break;
  }
  __pyx_3 = PyObject_GetIter(__pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
  Py_DECREF(__pyx_v_attr);
  __pyx_v_attr = __pyx_2;
  __pyx_2 = 0;
  __pyx_2 = __Pyx_UnpackItem(__pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
  Py_DECREF(__pyx_v_value);
  __pyx_v_value = __pyx_2;
  __pyx_2 = 0;
  if (__Pyx_EndUnpack(__pyx_3) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 638; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":639 */
  if (PyObject_Cmp(__pyx_v_attr, __pyx_v_key, &__pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 639; goto __pyx_L1;}
  __pyx_4 = __pyx_4 == 0;
  if (__pyx_4) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":640 */
    Py_INCREF(__pyx_v_value);
    __pyx_r = __pyx_v_value;
    Py_DECREF(__pyx_1); __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;
}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":641 */
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_1);
Py_XDECREF(__pyx_2);
Py_XDECREF(__pyx_3);
__Pyx_AddTraceback("etree._XSLTProcessingInstruction.get");
__pyx_r = 0;
__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;
}

static int __pyx_f_5etree_12_ExsltRegExp___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":649 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 649; goto __pyx_L1;}
Py_DECREF(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->_compile_map);
((struct __pyx_obj_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("etree._ExsltRegExp.__init__");
__pyx_r = -1;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k438p;

static char (__pyx_k438[]) = "Invalid argument type %s";

static PyObject *__pyx_f_5etree_12_ExsltRegExp__make_string(struct __pyx_obj_5etree__ExsltRegExp *__pyx_v_self,PyObject *__pyx_v_value) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
PyObject *__pyx_5 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_value);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":652 */
__pyx_1 = _isString(__pyx_v_value);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":653 */
  Py_INCREF(__pyx_v_value);
  __pyx_r = __pyx_v_value;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":655 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 655; goto __pyx_L1;}
  __pyx_3 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 655; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 655; goto __pyx_L1;}
  Py_INCREF(__pyx_v_value);
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_value);
  __pyx_5 = PyObject_CallObject(__pyx_3, __pyx_4); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 655; goto __pyx_L1;}
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyNumber_Remainder(__pyx_k438p, __pyx_5); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 655; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  __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[13]; __pyx_lineno = 655; 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);
Py_XDECREF(__pyx_5);
__Pyx_AddTraceback("etree._ExsltRegExp._make_string");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_value);
return __pyx_r;
}

static PyObject *__pyx_n_UNICODE;
static PyObject *__pyx_n_IGNORECASE;

static PyObject *__pyx_f_5etree_12_ExsltRegExp__compile(struct __pyx_obj_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;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":659 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)__pyx_v_self->__pyx_vtab)->_make_string(__pyx_v_self,__pyx_v_rexp); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 659; goto __pyx_L1;}
Py_DECREF(__pyx_v_rexp);
__pyx_v_rexp = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":660 */
__pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 660; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":661 */
__pyx_v_c_result = PyDict_GetItem(__pyx_v_self->_compile_map,__pyx_v_key);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":662 */
__pyx_2 = (__pyx_v_c_result != NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":663 */
  __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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":664 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_UNICODE); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 664; goto __pyx_L1;}
Py_DECREF(__pyx_v_py_flags);
__pyx_v_py_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":665 */
__pyx_2 = PyObject_IsTrue(__pyx_v_ignore_case); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 665; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":666 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_IGNORECASE); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 666; goto __pyx_L1;}
  __pyx_3 = PyNumber_Or(__pyx_v_py_flags, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 666; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":667 */
__pyx_1 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 667; goto __pyx_L1;}
__pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 667; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 667; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":668 */
__pyx_2 = PyDict_SetItem(__pyx_v_self->_compile_map,__pyx_v_key,__pyx_v_rexp_compiled); if (__pyx_2 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 668; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":669 */
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("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;
}

static PyObject *__pyx_n_i;
static PyObject *__pyx_n_search;


static PyObject *__pyx_f_5etree_12_ExsltRegExp_test(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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_k186;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ctxt, &__pyx_v_s, &__pyx_v_rexp, &__pyx_v_flags)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":672 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 672; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":673 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 673; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":674 */
__pyx_2 = PySequence_Contains(__pyx_v_flags, __pyx_n_i); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 674; goto __pyx_L1;}
__pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 674; goto __pyx_L1;}
__pyx_3 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_rexp,__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 674; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":675 */
__pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_search); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 675; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 675; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 675; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_3); __pyx_3 = 0;
__pyx_2 = __pyx_4 == Py_None;
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":676 */
  Py_INCREF(__pyx_v_5etree_False);
  __pyx_r = __pyx_v_5etree_False;
  goto __pyx_L0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":678 */
  Py_INCREF(__pyx_v_5etree_True);
  __pyx_r = __pyx_v_5etree_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("etree._ExsltRegExp.test");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_g;
static PyObject *__pyx_n_extend;
static PyObject *__pyx_n_groups;
static PyObject *__pyx_n_matches;

static PyObject *__pyx_k442p;
static PyObject *__pyx_k444p;

static char (__pyx_k442[]) = "";
static char (__pyx_k444[]) = "";

static PyObject *__pyx_f_5etree_12_ExsltRegExp_match(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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;
static char *__pyx_argnames[] = {"ctxt","s","rexp","flags",0};
__pyx_v_flags = __pyx_k188;
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OOO|O", __pyx_argnames, &__pyx_v_ctxt, &__pyx_v_s, &__pyx_v_rexp, &__pyx_v_flags)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":681 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 681; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":682 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 682; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":683 */
__pyx_2 = PySequence_Contains(__pyx_v_flags, __pyx_n_i); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 683; goto __pyx_L1;}
__pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 683; goto __pyx_L1;}
__pyx_3 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_rexp,__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 683; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":684 */
__pyx_2 = PySequence_Contains(__pyx_v_flags, __pyx_n_g); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 684; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":685 */
  __pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_findall); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 685; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 685; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 685; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":686 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_results); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 686; goto __pyx_L1;}
  __pyx_5 = (!__pyx_2);
  if (__pyx_5) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":687 */
    __pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 687; goto __pyx_L1;}
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L3;
  }
  __pyx_L3:;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":689 */
  __pyx_3 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_search); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 689; goto __pyx_L1;}
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 689; 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 (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 689; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":690 */
  __pyx_2 = PyObject_IsTrue(__pyx_v_result); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 690; goto __pyx_L1;}
  __pyx_5 = (!__pyx_2);
  if (__pyx_5) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":691 */
    __pyx_3 = PyTuple_New(0); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 691; goto __pyx_L1;}
    __pyx_r = __pyx_3;
    __pyx_3 = 0;
    goto __pyx_L0;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":692 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_result, __pyx_n_group); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 692; goto __pyx_L1;}
  __pyx_1 = PyObject_CallObject(__pyx_4, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 692; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyList_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 692; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":693 */
  __pyx_4 = PyObject_GetAttr(__pyx_v_results, __pyx_n_extend); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; goto __pyx_L1;}
  __pyx_1 = PyObject_GetAttr(__pyx_v_result, __pyx_n_groups); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; goto __pyx_L1;}
  Py_INCREF(__pyx_k442p);
  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_k442p);
  __pyx_6 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_3); __pyx_3 = 0;
  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; goto __pyx_L1;}
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_6);
  __pyx_6 = 0;
  __pyx_3 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 693; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":694 */
__pyx_6 = PyList_New(0); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 694; goto __pyx_L1;}
Py_DECREF(__pyx_v_result_list);
__pyx_v_result_list = __pyx_6;
__pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":695 */
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Element); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 695; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 695; 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 (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 695; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":696 */
__pyx_6 = PyObject_GetAttr(__pyx_k444p, __pyx_n_join); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 696; goto __pyx_L1;}
Py_DECREF(__pyx_v_join_groups);
__pyx_v_join_groups = __pyx_6;
__pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":697 */
__pyx_4 = PyObject_GetIter(__pyx_v_results); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 697; goto __pyx_L1;}
for (;;) {
  __pyx_1 = PyIter_Next(__pyx_4);
  if (!__pyx_1) {
    if (PyErr_Occurred()) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 697; goto __pyx_L1;}
    break;
  }
  Py_DECREF(__pyx_v_s_match);
  __pyx_v_s_match = __pyx_1;
  __pyx_1 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":698 */
  __pyx_2 = PyTuple_CheckExact(__pyx_v_s_match);
  if (__pyx_2) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":699 */
    __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 699; 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 (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 699; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":700 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_SubElement); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 700; goto __pyx_L1;}
  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 700; 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 (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 700; 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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":701 */
  if (PyObject_SetAttr(__pyx_v_elem, __pyx_n_text, __pyx_v_s_match) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 701; goto __pyx_L1;}

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":702 */
  __pyx_5 = PyList_Append(__pyx_v_result_list,__pyx_v_elem); if (__pyx_5 == (-1)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 702; goto __pyx_L1;}
}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":703 */
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("etree._ExsltRegExp.match");
__pyx_r = 0;
__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;
}


static PyObject *__pyx_f_5etree_12_ExsltRegExp_replace(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_f_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 (!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 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":706 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_replacement); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 706; goto __pyx_L1;}
Py_DECREF(__pyx_v_replacement);
__pyx_v_replacement = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":707 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_flags); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 707; goto __pyx_L1;}
Py_DECREF(__pyx_v_flags);
__pyx_v_flags = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":708 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_make_string(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 708; goto __pyx_L1;}
Py_DECREF(__pyx_v_s);
__pyx_v_s = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":709 */
__pyx_2 = PySequence_Contains(__pyx_v_flags, __pyx_n_i); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 709; goto __pyx_L1;}
__pyx_1 = PyInt_FromLong(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 709; goto __pyx_L1;}
__pyx_3 = ((struct __pyx_vtabstruct_5etree__ExsltRegExp *)((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self)->__pyx_vtab)->_compile(((struct __pyx_obj_5etree__ExsltRegExp *)__pyx_v_self),__pyx_v_rexp,__pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 709; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_rexpc);
__pyx_v_rexpc = __pyx_3;
__pyx_3 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":710 */
__pyx_2 = PySequence_Contains(__pyx_v_flags, __pyx_n_g); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 710; goto __pyx_L1;}
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":711 */
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 711; goto __pyx_L1;}
  Py_DECREF(__pyx_v_count);
  __pyx_v_count = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":713 */
  __pyx_3 = PyInt_FromLong(1); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 713; goto __pyx_L1;}
  Py_DECREF(__pyx_v_count);
  __pyx_v_count = __pyx_3;
  __pyx_3 = 0;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":714 */
__pyx_1 = PyObject_GetAttr(__pyx_v_rexpc, __pyx_n_sub); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 714; goto __pyx_L1;}
__pyx_3 = PyTuple_New(3); if (!__pyx_3) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 714; 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 (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 714; 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("etree._ExsltRegExp.replace");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_n_test;

static PyObject *__pyx_k448p;

static char (__pyx_k448[]) = "http://exslt.org/regular-expressions";

static PyObject *__pyx_f_5etree_12_ExsltRegExp__register_in_context(struct __pyx_obj_5etree__ExsltRegExp *__pyx_v_self,struct __pyx_obj_5etree__XSLTContext *__pyx_v_context) {
PyObject *__pyx_v_ns;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_self);
Py_INCREF((PyObject *)__pyx_v_context);
__pyx_v_ns = Py_None; Py_INCREF(Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":717 */
Py_INCREF(__pyx_k448p);
Py_DECREF(__pyx_v_ns);
__pyx_v_ns = __pyx_k448p;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":718 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_test); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 718; goto __pyx_L1;}
((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context,__pyx_v_ns,__pyx_n_test,__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":719 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_match); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 719; goto __pyx_L1;}
((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__pyx_vtab)->_addLocalExtensionFunction(__pyx_v_context,__pyx_v_ns,__pyx_n_match,__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":720 */
__pyx_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_replace); if (!__pyx_1) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 720; goto __pyx_L1;}
((struct __pyx_vtabstruct_5etree__XSLTContext *)__pyx_v_context->__pyx_base.__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("etree._ExsltRegExp._register_in_context");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_ns);
Py_DECREF(__pyx_v_self);
Py_DECREF((PyObject *)__pyx_v_context);
return __pyx_r;
}

static int __pyx_f_5etree_10_Validator___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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 (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
Py_INCREF(__pyx_v_self);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1854 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ErrorLog), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree__ErrorLog)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1854; goto __pyx_L1;}
Py_DECREF(((PyObject *)((struct __pyx_obj_5etree__Validator *)__pyx_v_self)->_error_log));
((struct __pyx_obj_5etree__Validator *)__pyx_v_self)->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)__pyx_1);
__pyx_1 = 0;

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

static PyObject *__pyx_f_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_10_Validator_validate[] = "Validate the document using this schema.\n\n        Returns true if document is valid, false if not.";
static PyObject *__pyx_f_5etree_10_Validator_validate(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
static char *__pyx_argnames[] = {"etree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1860 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; 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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1860; 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("etree._Validator.validate");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

static PyObject *__pyx_k452p;

static char (__pyx_k452[]) = "Document does not comply with schema";

static PyObject *__pyx_f_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_10_Validator_assertValid[] = "Raises DocumentInvalid if the document does not comply with the schema.";
static PyObject *__pyx_f_5etree_10_Validator_assertValid(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
static char *__pyx_argnames[] = {"etree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1864 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; 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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1864; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = (!__pyx_3);
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1865 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_DocumentInvalid); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k452p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1865; 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("etree._Validator.assertValid");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

static PyObject *__pyx_n_AssertionError;

static PyObject *__pyx_k453p;

static char (__pyx_k453[]) = "Document does not comply with schema";

static PyObject *__pyx_f_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_10_Validator_assert_[] = "Raises AssertionError if the document does not comply with the schema.";
static PyObject *__pyx_f_5etree_10_Validator_assert_(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
PyObject *__pyx_2 = 0;
int __pyx_3;
int __pyx_4;
static char *__pyx_argnames[] = {"etree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree)) return 0;
Py_INCREF(__pyx_v_self);
Py_INCREF(__pyx_v_etree);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1869 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; 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 (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
__pyx_3 = PyObject_IsTrue(__pyx_2); if (__pyx_3 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1869; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
__pyx_4 = (!__pyx_3);
if (__pyx_4) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1870 */
  __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AssertionError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k453p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1870; 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("etree._Validator.assert_");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
Py_DECREF(__pyx_v_etree);
return __pyx_r;
}

static PyObject *__pyx_f_5etree_10_Validator_9error_log___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_f_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1874 */
__pyx_1 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_5etree__Validator *)__pyx_v_self)->_error_log), __pyx_n_copy); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; goto __pyx_L1;}
__pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1874; 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("etree._Validator.error_log.__get__");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_self);
return __pyx_r;
}

static PyObject *__pyx_k455p;
static PyObject *__pyx_k456p;
static PyObject *__pyx_k457p;
static PyObject *__pyx_k458p;

static char (__pyx_k454[]) = "http://relaxng.org/ns/structure/1.0";
static char (__pyx_k455[]) = "Document is not Relax NG";
static char (__pyx_k456[]) = "No tree or file given";
static char (__pyx_k457[]) = "Document is not parsable as Relax NG";
static char (__pyx_k458[]) = "Document is not valid Relax NG";

static int __pyx_f_5etree_7RelaxNG___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"etree","file",0};
__pyx_v_etree = __pyx_k192;
__pyx_v_file = __pyx_k193;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":28 */
((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->_c_schema = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":29 */
__pyx_v_fake_c_doc = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":30 */
__pyx_1 = __pyx_v_etree != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":31 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_etree)); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 31; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":32 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_etree)); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 32; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root_node));
  __pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":33 */
  __pyx_v_c_node = __pyx_v_root_node->_c_node;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":35 */
  __pyx_v_c_href = _getNs(__pyx_v_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":36 */
  __pyx_1 = (__pyx_v_c_href == NULL);
  if (!__pyx_1) {
    __pyx_1 = (strcmp(__pyx_v_c_href,__pyx_k454) != 0);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":39 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 39; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k455p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[14]; __pyx_lineno = 39; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":40 */
  __pyx_v_fake_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":41 */
  __pyx_v_parser_ctxt = xmlRelaxNGNewDocParserCtxt(__pyx_v_fake_c_doc);
  goto __pyx_L2;
}
__pyx_1 = __pyx_v_file != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":43 */
  __pyx_2 = __pyx_f_5etree__getFilenameForFile(__pyx_v_file); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 43; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":44 */
  __pyx_1 = __pyx_v_filename == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":46 */
    Py_INCREF(__pyx_v_file);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_v_file;
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":47 */
  __pyx_2 = __pyx_f_5etree__encodeFilename(__pyx_v_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 47; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":48 */
  __pyx_v_parser_ctxt = xmlRelaxNGNewParserCtxt(_cstr(__pyx_v_filename));
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":50 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 50; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k456p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 50; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":52 */
__pyx_1 = (__pyx_v_parser_ctxt == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":53 */
  __pyx_1 = (__pyx_v_fake_c_doc != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":54 */
    __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":55 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 55; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k457p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 55; goto __pyx_L1;}
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":56 */
((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->_c_schema = xmlRelaxNGParse(__pyx_v_parser_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":60 */
__pyx_1 = (((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->_c_schema == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":61 */
  __pyx_1 = (__pyx_v_fake_c_doc != NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":62 */
    xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":63 */
    __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
    goto __pyx_L8;
  }
  __pyx_L8:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":64 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k458p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 64; goto __pyx_L1;}
  goto __pyx_L7;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":65 */
xmlRelaxNGFreeParserCtxt(__pyx_v_parser_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":66 */
__pyx_1 = (__pyx_v_fake_c_doc != NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":67 */
  __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
  goto __pyx_L9;
}
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":68 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__Validator), __pyx_n___init__); if (!__pyx_2) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 68; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 68; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 68; goto __pyx_L1;}
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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":71 */
xmlRelaxNGFree(((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->_c_schema);

Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_k459p;
static PyObject *__pyx_k460p;

static char (__pyx_k459[]) = "Failed to create validation context";
static char (__pyx_k460[]) = "Internal error in Relax NG validation";

static PyObject *__pyx_f_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_7RelaxNG___call__[] = "Validate doc using Relax NG.\n\n        Returns true if document is valid, false if not.";
static PyObject *__pyx_f_5etree_7RelaxNG___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyThreadState (*__pyx_v_state);
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;
static char *__pyx_argnames[] = {"etree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":84 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_etree)); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 84; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":85 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_etree)); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 85; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":87 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":88 */
__pyx_v_valid_ctxt = xmlRelaxNGNewValidCtxt(((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->_c_schema);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":89 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":90 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":91 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGError); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 91; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k459p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 91; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":93 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":94 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":95 */
__pyx_v_ret = xmlRelaxNGValidateDoc(__pyx_v_valid_ctxt,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":96 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":97 */
__pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":99 */
xmlRelaxNGFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":101 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_RelaxNG *)__pyx_v_self)->__pyx_base._error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":102 */
__pyx_2 = (__pyx_v_ret == (-1));
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":103 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGValidateError); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 103; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k460p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[14]; __pyx_lineno = 103; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":104 */
__pyx_1 = PyInt_FromLong((__pyx_v_ret == 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 104; 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("etree.RelaxNG.__call__");
__pyx_r = 0;
__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;
}

static PyObject *__pyx_k462p;
static PyObject *__pyx_k463p;
static PyObject *__pyx_k464p;
static PyObject *__pyx_k465p;

static char (__pyx_k461[]) = "http://www.w3.org/2001/XMLSchema";
static char (__pyx_k462[]) = "Document is not XML Schema";
static char (__pyx_k463[]) = "Document is not parsable as XML Schema";
static char (__pyx_k464[]) = "No tree or file given";
static char (__pyx_k465[]) = "Document is not valid XML Schema";

static int __pyx_f_5etree_9XMLSchema___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_f_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;
int __pyx_1;
PyObject *__pyx_2 = 0;
PyObject *__pyx_3 = 0;
PyObject *__pyx_4 = 0;
static char *__pyx_argnames[] = {"etree","file",0};
__pyx_v_etree = __pyx_k197;
__pyx_v_file = __pyx_k198;
if (!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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":27 */
((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":28 */
__pyx_1 = __pyx_v_etree != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":29 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_etree)); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 29; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_doc));
  __pyx_v_doc = ((struct LxmlDocument *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":30 */
  __pyx_2 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_etree)); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 30; goto __pyx_L1;}
  Py_DECREF(((PyObject *)__pyx_v_root_node));
  __pyx_v_root_node = ((struct LxmlElement *)__pyx_2);
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":33 */
  __pyx_v_c_node = __pyx_v_root_node->_c_node;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":34 */
  __pyx_v_c_href = _getNs(__pyx_v_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":35 */
  __pyx_1 = (__pyx_v_c_href == NULL);
  if (!__pyx_1) {
    __pyx_1 = (strcmp(__pyx_v_c_href,__pyx_k461) != 0);
  }
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":37 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k462p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[15]; __pyx_lineno = 37; goto __pyx_L1;}
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":39 */
  __pyx_v_fake_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":40 */
  __pyx_v_parser_ctxt = xmlSchemaNewDocParserCtxt(__pyx_v_fake_c_doc);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":41 */
  __pyx_1 = (__pyx_v_parser_ctxt == NULL);
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":42 */
    __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":43 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 43; goto __pyx_L1;}
    __Pyx_Raise(__pyx_2, __pyx_k463p, 0);
    Py_DECREF(__pyx_2); __pyx_2 = 0;
    {__pyx_filename = __pyx_f[15]; __pyx_lineno = 43; goto __pyx_L1;}
    goto __pyx_L4;
  }
  __pyx_L4:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":44 */
  ((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema = xmlSchemaParse(__pyx_v_parser_ctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":46 */
  xmlSchemaFreeParserCtxt(__pyx_v_parser_ctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":47 */
  __pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_fake_c_doc);
  goto __pyx_L2;
}
__pyx_1 = __pyx_v_file != Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":49 */
  __pyx_2 = __pyx_f_5etree__getFilenameForFile(__pyx_v_file); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 49; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":50 */
  __pyx_1 = __pyx_v_filename == Py_None;
  if (__pyx_1) {

    /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":52 */
    Py_INCREF(__pyx_v_file);
    Py_DECREF(__pyx_v_filename);
    __pyx_v_filename = __pyx_v_file;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":53 */
  __pyx_2 = __pyx_f_5etree__encodeFilename(__pyx_v_filename); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 53; goto __pyx_L1;}
  Py_DECREF(__pyx_v_filename);
  __pyx_v_filename = __pyx_2;
  __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":54 */
  __pyx_v_parser_ctxt = xmlSchemaNewParserCtxt(_cstr(__pyx_v_filename));

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":55 */
  ((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema = xmlSchemaParse(__pyx_v_parser_ctxt);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":56 */
  xmlSchemaFreeParserCtxt(__pyx_v_parser_ctxt);
  goto __pyx_L2;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":58 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 58; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k464p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 58; goto __pyx_L1;}
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":60 */
__pyx_1 = (((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":61 */
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaParseError); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 61; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, __pyx_k465p, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 61; goto __pyx_L1;}
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":62 */
__pyx_2 = PyObject_GetAttr(((PyObject*)__pyx_ptype_5etree__Validator), __pyx_n___init__); if (!__pyx_2) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 62; goto __pyx_L1;}
__pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 62; goto __pyx_L1;}
Py_INCREF(__pyx_v_self);
PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_self);
__pyx_4 = PyObject_CallObject(__pyx_2, __pyx_3); if (!__pyx_4) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 62; goto __pyx_L1;}
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_2);
Py_XDECREF(__pyx_3);
Py_XDECREF(__pyx_4);
__Pyx_AddTraceback("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;
}

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

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":65 */
xmlSchemaFree(((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema);

Py_DECREF((PyObject *)__pyx_v_self);
}

static PyObject *__pyx_k466p;
static PyObject *__pyx_k467p;

static char (__pyx_k466[]) = "Failed to create validation context";
static char (__pyx_k467[]) = "Internal error in XML Schema validation.";

static PyObject *__pyx_f_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_5etree_9XMLSchema___call__[] = "Validate doc using XML Schema.\n\n        Returns true if document is valid, false if not.\n        ";
static PyObject *__pyx_f_5etree_9XMLSchema___call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_etree = 0;
PyThreadState (*__pyx_v_state);
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;
static char *__pyx_argnames[] = {"etree",0};
if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_etree)) return 0;
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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":79 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_etree)); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 79; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_doc));
__pyx_v_doc = ((struct LxmlDocument *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":80 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_etree)); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 80; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_root_node));
__pyx_v_root_node = ((struct LxmlElement *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":82 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->connect(((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":83 */
__pyx_v_valid_ctxt = xmlSchemaNewValidCtxt(((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->_c_schema);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":84 */
__pyx_2 = (__pyx_v_valid_ctxt == NULL);
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":85 */
  ((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":86 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 86; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k466p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 86; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":88 */
__pyx_v_c_doc = __pyx_f_5etree__fakeRootDoc(__pyx_v_doc->_c_doc,__pyx_v_root_node->_c_node);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":89 */
__pyx_v_state = PyEval_SaveThread();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":90 */
__pyx_v_ret = xmlSchemaValidateDoc(__pyx_v_valid_ctxt,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":91 */
PyEval_RestoreThread(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":92 */
__pyx_f_5etree__destroyFakeDoc(__pyx_v_doc->_c_doc,__pyx_v_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":94 */
xmlSchemaFreeValidCtxt(__pyx_v_valid_ctxt);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":96 */
((struct __pyx_vtabstruct_5etree__ErrorLog *)((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log->__pyx_base.__pyx_base.__pyx_vtab)->disconnect(((struct __pyx_obj_5etree_XMLSchema *)__pyx_v_self)->__pyx_base._error_log);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":97 */
__pyx_2 = (__pyx_v_ret == (-1));
if (__pyx_2) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":98 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaValidateError); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 98; goto __pyx_L1;}
  __Pyx_Raise(__pyx_1, __pyx_k467p, 0);
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  {__pyx_filename = __pyx_f[15]; __pyx_lineno = 98; goto __pyx_L1;}
  goto __pyx_L3;
}
__pyx_L3:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":99 */
__pyx_1 = PyInt_FromLong((__pyx_v_ret == 0)); if (!__pyx_1) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 99; 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("etree.XMLSchema.__call__");
__pyx_r = 0;
__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;
}

DL_EXPORT(struct LxmlElement) *deepcopyNodeToDocument(struct LxmlDocument *__pyx_v_doc,xmlNode (*__pyx_v_c_root)) {
xmlNode (*__pyx_v_c_node);
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":6 */
__pyx_v_c_node = __pyx_f_5etree__copyNodeToDoc(__pyx_v_c_root,__pyx_v_doc->_c_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":7 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 7; 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("etree.deepcopyNodeToDocument");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":10 */
__pyx_1 = ((PyObject *)newElementTree(__pyx_v_context_node,((PyObject*)__pyx_ptype_5etree__ElementTree))); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __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("etree.elementTreeFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context_node);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":14 */
__pyx_1 = (((void (*))__pyx_v_context_node) == NULL);
if (!__pyx_1) {
  __pyx_1 = __pyx_v_context_node == Py_None;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":15 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 15; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 15; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":17 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__newElementTree(__pyx_v_context_node->_doc,__pyx_v_context_node,__pyx_v_subclass)); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __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("etree.newElementTree");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_context_node);
Py_DECREF(__pyx_v_subclass);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":20 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (!__pyx_1) {
  __pyx_1 = __pyx_v_doc == Py_None;
}
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":21 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 21; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 21; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":22 */
__pyx_2 = ((PyObject *)__pyx_f_5etree__elementFactory(__pyx_v_doc,__pyx_v_c_node)); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __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("etree.elementFactory");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":26 */
if (!__Pyx_TypeTest(__pyx_v_parser, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 26; goto __pyx_L1;}
__pyx_1 = ((PyObject *)__pyx_f_5etree__makeElement(__pyx_v_tag,NULL,__pyx_v_doc,((struct __pyx_obj_5etree__BaseParser *)__pyx_v_parser),__pyx_v_text,__pyx_v_tail,__pyx_v_attrib,__pyx_v_nsmap,Py_None)); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __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("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;
}

DL_EXPORT(void) setElementClassLookupFunction(PyObject *((*__pyx_v_function)(PyObject *,struct LxmlDocument *,xmlNode (*))),PyObject *__pyx_v_state) {
Py_INCREF(__pyx_v_state);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":30 */
__pyx_f_5etree__setElementClassLookupFunction(__pyx_v_function,__pyx_v_state);

Py_DECREF(__pyx_v_state);
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":33 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 33; goto __pyx_L1;}
__pyx_1 = __pyx_f_5etree__lookupDefaultElementClass(__pyx_v_state,((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 33; 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("etree.lookupDefaultElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":36 */
if (!__Pyx_TypeTest(__pyx_v_doc, __pyx_ptype_5etree__Document)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 36; goto __pyx_L1;}
__pyx_1 = __pyx_f_5etree__find_nselement_class(__pyx_v_state,((struct LxmlDocument *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 36; 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("etree.lookupNamespaceElementClass");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_state);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":40 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree_FallbackElementClassLookup *)__pyx_v_lookup->__pyx_vtab)->_callFallback(__pyx_v_lookup,((PyObject *)__pyx_v_doc),__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __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("etree.callLookupFallback");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF((PyObject *)__pyx_v_lookup);
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":43 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":44 */
  __pyx_r = (-1);
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":45 */
__pyx_r = __pyx_f_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;
}

DL_EXPORT(struct LxmlDocument) *documentOrRaise(PyObject *__pyx_v_input) {
struct LxmlDocument *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":48 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__documentOrRaise(__pyx_v_input)); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 48; 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("etree.documentOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

DL_EXPORT(struct LxmlElement) *rootNodeOrRaise(PyObject *__pyx_v_input) {
struct LxmlElement *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_input);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":51 */
__pyx_1 = ((PyObject *)__pyx_f_5etree__rootNodeOrRaise(__pyx_v_input)); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 51; 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("etree.rootNodeOrRaise");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_input);
return __pyx_r;
}

DL_EXPORT(PyObject) *textOf(xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":54 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":55 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":56 */
__pyx_2 = __pyx_f_5etree__collectText(__pyx_v_c_node->children); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 56; 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("etree.textOf");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(PyObject) *tailOf(xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":59 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":60 */
  Py_INCREF(Py_None);
  __pyx_r = Py_None;
  goto __pyx_L0;
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":61 */
__pyx_2 = __pyx_f_5etree__collectText(__pyx_v_c_node->next); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 61; 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("etree.tailOf");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(int) setNodeText(xmlNode (*__pyx_v_c_node),PyObject *__pyx_v_text) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_text);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":64 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":65 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 65; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 65; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":66 */
__pyx_1 = __pyx_f_5etree__setNodeText(__pyx_v_c_node,__pyx_v_text); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 66; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree.setNodeText");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

DL_EXPORT(int) setTailText(xmlNode (*__pyx_v_c_node),PyObject *__pyx_v_text) {
int __pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_text);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":69 */
__pyx_1 = (__pyx_v_c_node == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":70 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_ValueError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 70; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 70; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":71 */
__pyx_1 = __pyx_f_5etree__setTailText(__pyx_v_c_node,__pyx_v_text); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 71; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree.setTailText");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF(__pyx_v_text);
return __pyx_r;
}

DL_EXPORT(PyObject) *attributeValue(xmlNode (*__pyx_v_c_element),xmlAttr (*__pyx_v_c_attrib_node)) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":74 */
__pyx_1 = __pyx_f_5etree__attributeValue(__pyx_v_c_element,__pyx_v_c_attrib_node); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 74; 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("etree.attributeValue");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":78 */
__pyx_1 = __pyx_f_5etree__attributeValueFromNsName(__pyx_v_c_element,__pyx_v_ns,__pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 78; 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("etree.attributeValueFromNsName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":81 */
__pyx_1 = __pyx_f_5etree__getAttributeValue(__pyx_v_element,__pyx_v_key,__pyx_v_default); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 81; 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("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;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":84 */
__pyx_1 = __pyx_f_5etree__attributeIteratorFactory(__pyx_v_element,__pyx_v_keysvalues); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __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("etree.iterattributes");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_element);
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":87 */
__pyx_1 = __pyx_f_5etree__setAttributeValue(__pyx_v_element,__pyx_v_key,__pyx_v_value); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 87; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("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;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":90 */
__pyx_1 = __pyx_f_5etree__delAttribute(__pyx_v_element,__pyx_v_key); if (__pyx_1 == (-1)) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 90; goto __pyx_L1;}
__pyx_r = __pyx_1;
goto __pyx_L0;

__pyx_r = 0;
goto __pyx_L0;
__pyx_L1:;
__Pyx_AddTraceback("etree.delAttribute");
__pyx_r = (-1);
__pyx_L0:;
Py_DECREF(__pyx_v_element);
Py_DECREF(__pyx_v_key);
return __pyx_r;
}

DL_EXPORT(int) delAttributeFromNsName(xmlNode (*__pyx_v_c_element),char (*__pyx_v_c_href),char (*__pyx_v_c_name)) {
int __pyx_r;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":94 */
__pyx_r = __pyx_f_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;
}

DL_EXPORT(xmlNode) (*findChild(xmlNode (*__pyx_v_c_node),Py_ssize_t __pyx_v_index)) {
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":97 */
__pyx_r = __pyx_f_5etree__findChild(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(xmlNode) (*findChildForwards(xmlNode (*__pyx_v_c_node),Py_ssize_t __pyx_v_index)) {
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":100 */
__pyx_r = __pyx_f_5etree__findChildForwards(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(xmlNode) (*findChildBackwards(xmlNode (*__pyx_v_c_node),Py_ssize_t __pyx_v_index)) {
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":103 */
__pyx_r = __pyx_f_5etree__findChildBackwards(__pyx_v_c_node,__pyx_v_index);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(xmlNode) (*nextElement(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":106 */
__pyx_r = __pyx_f_5etree__nextElement(__pyx_v_c_node);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(xmlNode) (*previousElement(xmlNode (*__pyx_v_c_node))) {
xmlNode (*__pyx_r);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":109 */
__pyx_r = __pyx_f_5etree__previousElement(__pyx_v_c_node);
goto __pyx_L0;

__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(void) appendChild(struct LxmlElement *__pyx_v_parent,struct LxmlElement *__pyx_v_child) {
Py_INCREF(__pyx_v_parent);
Py_INCREF(__pyx_v_child);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":112 */
__pyx_f_5etree__appendChild(__pyx_v_parent,__pyx_v_child);

Py_DECREF(__pyx_v_parent);
Py_DECREF(__pyx_v_child);
}

DL_EXPORT(PyObject) *pyunicode(char (*__pyx_v_s)) {
PyObject *__pyx_r;
int __pyx_1;
PyObject *__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":115 */
__pyx_1 = (__pyx_v_s == NULL);
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":116 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 116; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 116; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":117 */
__pyx_2 = __pyx_f_5etree_funicode(__pyx_v_s); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 117; 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("etree.pyunicode");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(PyObject) *utf8(PyObject *__pyx_v_s) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_s);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":120 */
__pyx_1 = __pyx_f_5etree__utf8(__pyx_v_s); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 120; 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("etree.utf8");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_s);
return __pyx_r;
}

DL_EXPORT(PyObject) *getNsTag(PyObject *__pyx_v_tag) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;
Py_INCREF(__pyx_v_tag);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":123 */
__pyx_1 = __pyx_f_5etree__getNsTag(__pyx_v_tag); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 123; 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("etree.getNsTag");
__pyx_r = 0;
__pyx_L0:;
Py_DECREF(__pyx_v_tag);
return __pyx_r;
}

DL_EXPORT(PyObject) *namespacedName(xmlNode (*__pyx_v_c_node)) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":126 */
__pyx_1 = __pyx_f_5etree__namespacedName(__pyx_v_c_node); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 126; 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("etree.namespacedName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

DL_EXPORT(PyObject) *namespacedNameFromNsName(char (*__pyx_v_href),char (*__pyx_v_name)) {
PyObject *__pyx_r;
PyObject *__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":129 */
__pyx_1 = __pyx_f_5etree__namespacedNameFromNsName(__pyx_v_href,__pyx_v_name); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 129; 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("etree.namespacedNameFromNsName");
__pyx_r = 0;
__pyx_L0:;
return __pyx_r;
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":132 */
((struct __pyx_vtabstruct_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);
}

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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":135 */
__pyx_1 = ((struct __pyx_vtabstruct_5etree__ElementTagMatcher *)__pyx_v_matcher->__pyx_vtab)->_initTagMatch(__pyx_v_matcher,__pyx_v_tag); if (!__pyx_1) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 135; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_1);
__Pyx_WriteUnraisable("etree.initTagMatch");
__pyx_L0:;
Py_DECREF(__pyx_v_matcher);
Py_DECREF(__pyx_v_tag);
}

DL_EXPORT(xmlNs) (*findOrBuildNodeNs(struct LxmlDocument *__pyx_v_doc,xmlNode (*__pyx_v_c_node),char (*__pyx_v_href))) {
xmlNs (*__pyx_r);
int __pyx_1;
PyObject *__pyx_2 = 0;
Py_INCREF(__pyx_v_doc);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":139 */
__pyx_1 = __pyx_v_doc == Py_None;
if (__pyx_1) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":140 */
  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_TypeError); if (!__pyx_2) {__pyx_filename = __pyx_f[16]; __pyx_lineno = 140; goto __pyx_L1;}
  __Pyx_Raise(__pyx_2, 0, 0);
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  {__pyx_filename = __pyx_f[16]; __pyx_lineno = 140; goto __pyx_L1;}
  goto __pyx_L2;
}
__pyx_L2:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":141 */
__pyx_r = ((struct __pyx_vtabstruct_5etree__Document *)__pyx_v_doc->__pyx_vtab)->_findOrBuildNodeNs(__pyx_v_doc,__pyx_v_c_node,__pyx_v_href);
goto __pyx_L0;

goto __pyx_L0;
__pyx_L1:;
Py_XDECREF(__pyx_2);
__Pyx_AddTraceback("etree.findOrBuildNodeNs");
__pyx_r = NULL;
__pyx_L0:;
Py_DECREF(__pyx_v_doc);
return __pyx_r;
}

static __Pyx_InternTabEntry __pyx_intern_tab[] = {
{&__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_DocumentInvalid, "DocumentInvalid"},
{&__pyx_n_ERROR, "ERROR"},
{&__pyx_n_Element, "Element"},
{&__pyx_n_ElementTree, "ElementTree"},
{&__pyx_n_Error, "Error"},
{&__pyx_n_ErrorDomains, "ErrorDomains"},
{&__pyx_n_ErrorLevels, "ErrorLevels"},
{&__pyx_n_ErrorTypes, "ErrorTypes"},
{&__pyx_n_Exception, "Exception"},
{&__pyx_n_Extension, "Extension"},
{&__pyx_n_FATAL, "FATAL"},
{&__pyx_n_False, "False"},
{&__pyx_n_FunctionNamespace, "FunctionNamespace"},
{&__pyx_n_HTML, "HTML"},
{&__pyx_n_IDDict, "IDDict"},
{&__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_Namespace, "Namespace"},
{&__pyx_n_NamespaceRegistryError, "NamespaceRegistryError"},
{&__pyx_n_NotImplementedError, "NotImplementedError"},
{&__pyx_n_PI, "PI"},
{&__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_Set, "Set"},
{&__pyx_n_StopIteration, "StopIteration"},
{&__pyx_n_SubElement, "SubElement"},
{&__pyx_n_SyntaxError, "SyntaxError"},
{&__pyx_n_True, "True"},
{&__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_XIncludeError, "XIncludeError"},
{&__pyx_n_XML, "XML"},
{&__pyx_n_XMLDTDID, "XMLDTDID"},
{&__pyx_n_XMLID, "XMLID"},
{&__pyx_n_XMLSchemaError, "XMLSchemaError"},
{&__pyx_n_XMLSchemaParseError, "XMLSchemaParseError"},
{&__pyx_n_XMLSchemaValidateError, "XMLSchemaValidateError"},
{&__pyx_n_XMLSyntaxError, "XMLSyntaxError"},
{&__pyx_n_XML_XPATH_UNKNOWN_FUNC_ERROR, "XML_XPATH_UNKNOWN_FUNC_ERROR"},
{&__pyx_n_XPathContextError, "XPathContextError"},
{&__pyx_n_XPathError, "XPathError"},
{&__pyx_n_XPathEvaluator, "XPathEvaluator"},
{&__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__ParserContext, "_ParserContext"},
{&__pyx_n___builtin__, "__builtin__"},
{&__pyx_n___class__, "__class__"},
{&__pyx_n___copy__, "__copy__"},
{&__pyx_n___hash__, "__hash__"},
{&__pyx_n___init__, "__init__"},
{&__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__superError, "_superError"},
{&__pyx_n_access_control, "access_control"},
{&__pyx_n_add, "add"},
{&__pyx_n_addNamespace, "addNamespace"},
{&__pyx_n_alpha, "alpha"},
{&__pyx_n_append, "append"},
{&__pyx_n_ascii, "ascii"},
{&__pyx_n_beta, "beta"},
{&__pyx_n_bool, "bool"},
{&__pyx_n_c14n, "c14n"},
{&__pyx_n_clear, "clear"},
{&__pyx_n_clearErrorLog, "clearErrorLog"},
{&__pyx_n_cmp, "cmp"},
{&__pyx_n_comment, "comment"},
{&__pyx_n_compile, "compile"},
{&__pyx_n_config, "config"},
{&__pyx_n_copy, "copy"},
{&__pyx_n_cstd, "cstd"},
{&__pyx_n_dev, "dev"},
{&__pyx_n_dict, "dict"},
{&__pyx_n_dir, "dir"},
{&__pyx_n_discard, "discard"},
{&__pyx_n_domain, "domain"},
{&__pyx_n_domain_name, "domain_name"},
{&__pyx_n_dump, "dump"},
{&__pyx_n_element, "element"},
{&__pyx_n_end, "end"},
{&__pyx_n_error_log, "error_log"},
{&__pyx_n_evaluate, "evaluate"},
{&__pyx_n_exc_info, "exc_info"},
{&__pyx_n_extend, "extend"},
{&__pyx_n_extensions, "extensions"},
{&__pyx_n_filename, "filename"},
{&__pyx_n_filter_from_level, "filter_from_level"},
{&__pyx_n_find, "find"},
{&__pyx_n_findall, "findall"},
{&__pyx_n_findtext, "findtext"},
{&__pyx_n_fromstring, "fromstring"},
{&__pyx_n_g, "g"},
{&__pyx_n_get, "get"},
{&__pyx_n_getDefaultParser, "getDefaultParser"},
{&__pyx_n_getLogger, "getLogger"},
{&__pyx_n_get_default_parser, "get_default_parser"},
{&__pyx_n_getdefaultencoding, "getdefaultencoding"},
{&__pyx_n_getfilesystemencoding, "getfilesystemencoding"},
{&__pyx_n_getiterator, "getiterator"},
{&__pyx_n_getnext, "getnext"},
{&__pyx_n_getroot, "getroot"},
{&__pyx_n_geturl, "geturl"},
{&__pyx_n_getvalue, "getvalue"},
{&__pyx_n_group, "group"},
{&__pyx_n_groups, "groups"},
{&__pyx_n_href, "href"},
{&__pyx_n_htmlparser, "htmlparser"},
{&__pyx_n_i, "i"},
{&__pyx_n_id, "id"},
{&__pyx_n_int, "int"},
{&__pyx_n_iselement, "iselement"},
{&__pyx_n_items, "items"},
{&__pyx_n_iteritems, "iteritems"},
{&__pyx_n_join, "join"},
{&__pyx_n_keys, "keys"},
{&__pyx_n_len, "len"},
{&__pyx_n_level, "level"},
{&__pyx_n_level_name, "level_name"},
{&__pyx_n_line, "line"},
{&__pyx_n_log, "log"},
{&__pyx_n_logging, "logging"},
{&__pyx_n_lookup, "lookup"},
{&__pyx_n_match, "match"},
{&__pyx_n_matches, "matches"},
{&__pyx_n_message, "message"},
{&__pyx_n_name, "name"},
{&__pyx_n_next, "next"},
{&__pyx_n_open, "open"},
{&__pyx_n_parse, "parse"},
{&__pyx_n_parseid, "parseid"},
{&__pyx_n_pop, "pop"},
{&__pyx_n_python, "python"},
{&__pyx_n_rb, "rb"},
{&__pyx_n_re, "re"},
{&__pyx_n_read, "read"},
{&__pyx_n_receive, "receive"},
{&__pyx_n_registerNamespace, "registerNamespace"},
{&__pyx_n_registerNamespaces, "registerNamespaces"},
{&__pyx_n_registerVariables, "registerVariables"},
{&__pyx_n_relaxng, "relaxng"},
{&__pyx_n_replace, "replace"},
{&__pyx_n_resolve, "resolve"},
{&__pyx_n_reversed, "reversed"},
{&__pyx_n_search, "search"},
{&__pyx_n_set, "set"},
{&__pyx_n_setDefaultParser, "setDefaultParser"},
{&__pyx_n_setElementClassLookup, "setElementClassLookup"},
{&__pyx_n_setFallback, "setFallback"},
{&__pyx_n_set_default_parser, "set_default_parser"},
{&__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_target, "target"},
{&__pyx_n_tell, "tell"},
{&__pyx_n_test, "test"},
{&__pyx_n_text, "text"},
{&__pyx_n_tostring, "tostring"},
{&__pyx_n_tounicode, "tounicode"},
{&__pyx_n_tree, "tree"},
{&__pyx_n_tuple, "tuple"},
{&__pyx_n_type, "type"},
{&__pyx_n_type_name, "type_name"},
{&__pyx_n_unicode, "unicode"},
{&__pyx_n_unknown, "unknown"},
{&__pyx_n_update, "update"},
{&__pyx_n_upper, "upper"},
{&__pyx_n_useGlobalPythonLog, "useGlobalPythonLog"},
{&__pyx_n_validate, "validate"},
{&__pyx_n_values, "values"},
{&__pyx_n_write, "write"},
{&__pyx_n_xinclude, "xinclude"},
{&__pyx_n_xmlerror, "xmlerror"},
{&__pyx_n_xmlparser, "xmlparser"},
{&__pyx_n_xmlschema, "xmlschema"},
{&__pyx_n_xpath, "xpath"},
{&__pyx_n_xsl, "xsl"},
{&__pyx_n_xslt, "xslt"},
{0, 0}
};

static __Pyx_StringTabEntry __pyx_string_tab[] = {
{&__pyx_k24p, __pyx_k24, sizeof(__pyx_k24)},
{&__pyx_k25p, __pyx_k25, sizeof(__pyx_k25)},
{&__pyx_k78p, __pyx_k78, sizeof(__pyx_k78)},
{&__pyx_k83p, __pyx_k83, sizeof(__pyx_k83)},
{&__pyx_k85p, __pyx_k85, sizeof(__pyx_k85)},
{&__pyx_k87p, __pyx_k87, sizeof(__pyx_k87)},
{&__pyx_k88p, __pyx_k88, sizeof(__pyx_k88)},
{&__pyx_k89p, __pyx_k89, sizeof(__pyx_k89)},
{&__pyx_k90p, __pyx_k90, sizeof(__pyx_k90)},
{&__pyx_k91p, __pyx_k91, sizeof(__pyx_k91)},
{&__pyx_k92p, __pyx_k92, sizeof(__pyx_k92)},
{&__pyx_k93p, __pyx_k93, sizeof(__pyx_k93)},
{&__pyx_k94p, __pyx_k94, sizeof(__pyx_k94)},
{&__pyx_k95p, __pyx_k95, sizeof(__pyx_k95)},
{&__pyx_k96p, __pyx_k96, sizeof(__pyx_k96)},
{&__pyx_k97p, __pyx_k97, sizeof(__pyx_k97)},
{&__pyx_k98p, __pyx_k98, sizeof(__pyx_k98)},
{&__pyx_k99p, __pyx_k99, sizeof(__pyx_k99)},
{&__pyx_k160p, __pyx_k160, sizeof(__pyx_k160)},
{&__pyx_k161p, __pyx_k161, sizeof(__pyx_k161)},
{&__pyx_k178p, __pyx_k178, sizeof(__pyx_k178)},
{&__pyx_k179p, __pyx_k179, sizeof(__pyx_k179)},
{&__pyx_k180p, __pyx_k180, sizeof(__pyx_k180)},
{&__pyx_k182p, __pyx_k182, sizeof(__pyx_k182)},
{&__pyx_k185p, __pyx_k185, sizeof(__pyx_k185)},
{&__pyx_k187p, __pyx_k187, sizeof(__pyx_k187)},
{&__pyx_k199p, __pyx_k199, sizeof(__pyx_k199)},
{&__pyx_k200p, __pyx_k200, sizeof(__pyx_k200)},
{&__pyx_k201p, __pyx_k201, sizeof(__pyx_k201)},
{&__pyx_k205p, __pyx_k205, sizeof(__pyx_k205)},
{&__pyx_k207p, __pyx_k207, sizeof(__pyx_k207)},
{&__pyx_k208p, __pyx_k208, sizeof(__pyx_k208)},
{&__pyx_k209p, __pyx_k209, sizeof(__pyx_k209)},
{&__pyx_k210p, __pyx_k210, sizeof(__pyx_k210)},
{&__pyx_k211p, __pyx_k211, sizeof(__pyx_k211)},
{&__pyx_k212p, __pyx_k212, sizeof(__pyx_k212)},
{&__pyx_k213p, __pyx_k213, sizeof(__pyx_k213)},
{&__pyx_k214p, __pyx_k214, sizeof(__pyx_k214)},
{&__pyx_k215p, __pyx_k215, sizeof(__pyx_k215)},
{&__pyx_k216p, __pyx_k216, sizeof(__pyx_k216)},
{&__pyx_k218p, __pyx_k218, sizeof(__pyx_k218)},
{&__pyx_k219p, __pyx_k219, sizeof(__pyx_k219)},
{&__pyx_k220p, __pyx_k220, sizeof(__pyx_k220)},
{&__pyx_k221p, __pyx_k221, sizeof(__pyx_k221)},
{&__pyx_k222p, __pyx_k222, sizeof(__pyx_k222)},
{&__pyx_k223p, __pyx_k223, sizeof(__pyx_k223)},
{&__pyx_k224p, __pyx_k224, sizeof(__pyx_k224)},
{&__pyx_k225p, __pyx_k225, sizeof(__pyx_k225)},
{&__pyx_k226p, __pyx_k226, sizeof(__pyx_k226)},
{&__pyx_k227p, __pyx_k227, sizeof(__pyx_k227)},
{&__pyx_k228p, __pyx_k228, sizeof(__pyx_k228)},
{&__pyx_k229p, __pyx_k229, sizeof(__pyx_k229)},
{&__pyx_k232p, __pyx_k232, sizeof(__pyx_k232)},
{&__pyx_k235p, __pyx_k235, sizeof(__pyx_k235)},
{&__pyx_k236p, __pyx_k236, sizeof(__pyx_k236)},
{&__pyx_k237p, __pyx_k237, sizeof(__pyx_k237)},
{&__pyx_k238p, __pyx_k238, sizeof(__pyx_k238)},
{&__pyx_k239p, __pyx_k239, sizeof(__pyx_k239)},
{&__pyx_k240p, __pyx_k240, sizeof(__pyx_k240)},
{&__pyx_k241p, __pyx_k241, sizeof(__pyx_k241)},
{&__pyx_k242p, __pyx_k242, sizeof(__pyx_k242)},
{&__pyx_k243p, __pyx_k243, sizeof(__pyx_k243)},
{&__pyx_k246p, __pyx_k246, sizeof(__pyx_k246)},
{&__pyx_k247p, __pyx_k247, sizeof(__pyx_k247)},
{&__pyx_k248p, __pyx_k248, sizeof(__pyx_k248)},
{&__pyx_k251p, __pyx_k251, sizeof(__pyx_k251)},
{&__pyx_k253p, __pyx_k253, sizeof(__pyx_k253)},
{&__pyx_k254p, __pyx_k254, sizeof(__pyx_k254)},
{&__pyx_k255p, __pyx_k255, sizeof(__pyx_k255)},
{&__pyx_k256p, __pyx_k256, sizeof(__pyx_k256)},
{&__pyx_k257p, __pyx_k257, sizeof(__pyx_k257)},
{&__pyx_k258p, __pyx_k258, sizeof(__pyx_k258)},
{&__pyx_k259p, __pyx_k259, sizeof(__pyx_k259)},
{&__pyx_k260p, __pyx_k260, sizeof(__pyx_k260)},
{&__pyx_k261p, __pyx_k261, sizeof(__pyx_k261)},
{&__pyx_k262p, __pyx_k262, sizeof(__pyx_k262)},
{&__pyx_k264p, __pyx_k264, sizeof(__pyx_k264)},
{&__pyx_k265p, __pyx_k265, sizeof(__pyx_k265)},
{&__pyx_k266p, __pyx_k266, sizeof(__pyx_k266)},
{&__pyx_k267p, __pyx_k267, sizeof(__pyx_k267)},
{&__pyx_k268p, __pyx_k268, sizeof(__pyx_k268)},
{&__pyx_k269p, __pyx_k269, sizeof(__pyx_k269)},
{&__pyx_k270p, __pyx_k270, sizeof(__pyx_k270)},
{&__pyx_k271p, __pyx_k271, sizeof(__pyx_k271)},
{&__pyx_k272p, __pyx_k272, sizeof(__pyx_k272)},
{&__pyx_k273p, __pyx_k273, sizeof(__pyx_k273)},
{&__pyx_k274p, __pyx_k274, sizeof(__pyx_k274)},
{&__pyx_k275p, __pyx_k275, sizeof(__pyx_k275)},
{&__pyx_k276p, __pyx_k276, sizeof(__pyx_k276)},
{&__pyx_k277p, __pyx_k277, sizeof(__pyx_k277)},
{&__pyx_k283p, __pyx_k283, sizeof(__pyx_k283)},
{&__pyx_k284p, __pyx_k284, sizeof(__pyx_k284)},
{&__pyx_k288p, __pyx_k288, sizeof(__pyx_k288)},
{&__pyx_k289p, __pyx_k289, sizeof(__pyx_k289)},
{&__pyx_k298p, __pyx_k298, sizeof(__pyx_k298)},
{&__pyx_k299p, __pyx_k299, sizeof(__pyx_k299)},
{&__pyx_k300p, __pyx_k300, sizeof(__pyx_k300)},
{&__pyx_k301p, __pyx_k301, sizeof(__pyx_k301)},
{&__pyx_k305p, __pyx_k305, sizeof(__pyx_k305)},
{&__pyx_k311p, __pyx_k311, sizeof(__pyx_k311)},
{&__pyx_k312p, __pyx_k312, sizeof(__pyx_k312)},
{&__pyx_k313p, __pyx_k313, sizeof(__pyx_k313)},
{&__pyx_k314p, __pyx_k314, sizeof(__pyx_k314)},
{&__pyx_k315p, __pyx_k315, sizeof(__pyx_k315)},
{&__pyx_k316p, __pyx_k316, sizeof(__pyx_k316)},
{&__pyx_k317p, __pyx_k317, sizeof(__pyx_k317)},
{&__pyx_k318p, __pyx_k318, sizeof(__pyx_k318)},
{&__pyx_k320p, __pyx_k320, sizeof(__pyx_k320)},
{&__pyx_k330p, __pyx_k330, sizeof(__pyx_k330)},
{&__pyx_k331p, __pyx_k331, sizeof(__pyx_k331)},
{&__pyx_k333p, __pyx_k333, sizeof(__pyx_k333)},
{&__pyx_k334p, __pyx_k334, sizeof(__pyx_k334)},
{&__pyx_k335p, __pyx_k335, sizeof(__pyx_k335)},
{&__pyx_k336p, __pyx_k336, sizeof(__pyx_k336)},
{&__pyx_k337p, __pyx_k337, sizeof(__pyx_k337)},
{&__pyx_k338p, __pyx_k338, sizeof(__pyx_k338)},
{&__pyx_k339p, __pyx_k339, sizeof(__pyx_k339)},
{&__pyx_k344p, __pyx_k344, sizeof(__pyx_k344)},
{&__pyx_k345p, __pyx_k345, sizeof(__pyx_k345)},
{&__pyx_k347p, __pyx_k347, sizeof(__pyx_k347)},
{&__pyx_k348p, __pyx_k348, sizeof(__pyx_k348)},
{&__pyx_k354p, __pyx_k354, sizeof(__pyx_k354)},
{&__pyx_k355p, __pyx_k355, sizeof(__pyx_k355)},
{&__pyx_k358p, __pyx_k358, sizeof(__pyx_k358)},
{&__pyx_k360p, __pyx_k360, sizeof(__pyx_k360)},
{&__pyx_k361p, __pyx_k361, sizeof(__pyx_k361)},
{&__pyx_k362p, __pyx_k362, sizeof(__pyx_k362)},
{&__pyx_k366p, __pyx_k366, sizeof(__pyx_k366)},
{&__pyx_k367p, __pyx_k367, sizeof(__pyx_k367)},
{&__pyx_k368p, __pyx_k368, sizeof(__pyx_k368)},
{&__pyx_k369p, __pyx_k369, sizeof(__pyx_k369)},
{&__pyx_k370p, __pyx_k370, sizeof(__pyx_k370)},
{&__pyx_k371p, __pyx_k371, sizeof(__pyx_k371)},
{&__pyx_k372p, __pyx_k372, sizeof(__pyx_k372)},
{&__pyx_k375p, __pyx_k375, sizeof(__pyx_k375)},
{&__pyx_k378p, __pyx_k378, sizeof(__pyx_k378)},
{&__pyx_k379p, __pyx_k379, sizeof(__pyx_k379)},
{&__pyx_k380p, __pyx_k380, sizeof(__pyx_k380)},
{&__pyx_k381p, __pyx_k381, sizeof(__pyx_k381)},
{&__pyx_k384p, __pyx_k384, sizeof(__pyx_k384)},
{&__pyx_k385p, __pyx_k385, sizeof(__pyx_k385)},
{&__pyx_k387p, __pyx_k387, sizeof(__pyx_k387)},
{&__pyx_k388p, __pyx_k388, sizeof(__pyx_k388)},
{&__pyx_k389p, __pyx_k389, sizeof(__pyx_k389)},
{&__pyx_k390p, __pyx_k390, sizeof(__pyx_k390)},
{&__pyx_k392p, __pyx_k392, sizeof(__pyx_k392)},
{&__pyx_k393p, __pyx_k393, sizeof(__pyx_k393)},
{&__pyx_k394p, __pyx_k394, sizeof(__pyx_k394)},
{&__pyx_k395p, __pyx_k395, sizeof(__pyx_k395)},
{&__pyx_k396p, __pyx_k396, sizeof(__pyx_k396)},
{&__pyx_k397p, __pyx_k397, sizeof(__pyx_k397)},
{&__pyx_k398p, __pyx_k398, sizeof(__pyx_k398)},
{&__pyx_k399p, __pyx_k399, sizeof(__pyx_k399)},
{&__pyx_k400p, __pyx_k400, sizeof(__pyx_k400)},
{&__pyx_k401p, __pyx_k401, sizeof(__pyx_k401)},
{&__pyx_k405p, __pyx_k405, sizeof(__pyx_k405)},
{&__pyx_k408p, __pyx_k408, sizeof(__pyx_k408)},
{&__pyx_k409p, __pyx_k409, sizeof(__pyx_k409)},
{&__pyx_k410p, __pyx_k410, sizeof(__pyx_k410)},
{&__pyx_k411p, __pyx_k411, sizeof(__pyx_k411)},
{&__pyx_k412p, __pyx_k412, sizeof(__pyx_k412)},
{&__pyx_k413p, __pyx_k413, sizeof(__pyx_k413)},
{&__pyx_k414p, __pyx_k414, sizeof(__pyx_k414)},
{&__pyx_k415p, __pyx_k415, sizeof(__pyx_k415)},
{&__pyx_k416p, __pyx_k416, sizeof(__pyx_k416)},
{&__pyx_k417p, __pyx_k417, sizeof(__pyx_k417)},
{&__pyx_k418p, __pyx_k418, sizeof(__pyx_k418)},
{&__pyx_k419p, __pyx_k419, sizeof(__pyx_k419)},
{&__pyx_k420p, __pyx_k420, sizeof(__pyx_k420)},
{&__pyx_k423p, __pyx_k423, sizeof(__pyx_k423)},
{&__pyx_k424p, __pyx_k424, sizeof(__pyx_k424)},
{&__pyx_k425p, __pyx_k425, sizeof(__pyx_k425)},
{&__pyx_k427p, __pyx_k427, sizeof(__pyx_k427)},
{&__pyx_k428p, __pyx_k428, sizeof(__pyx_k428)},
{&__pyx_k430p, __pyx_k430, sizeof(__pyx_k430)},
{&__pyx_k431p, __pyx_k431, sizeof(__pyx_k431)},
{&__pyx_k432p, __pyx_k432, sizeof(__pyx_k432)},
{&__pyx_k433p, __pyx_k433, sizeof(__pyx_k433)},
{&__pyx_k434p, __pyx_k434, sizeof(__pyx_k434)},
{&__pyx_k435p, __pyx_k435, sizeof(__pyx_k435)},
{&__pyx_k436p, __pyx_k436, sizeof(__pyx_k436)},
{&__pyx_k437p, __pyx_k437, sizeof(__pyx_k437)},
{&__pyx_k438p, __pyx_k438, sizeof(__pyx_k438)},
{&__pyx_k442p, __pyx_k442, sizeof(__pyx_k442)},
{&__pyx_k444p, __pyx_k444, sizeof(__pyx_k444)},
{&__pyx_k448p, __pyx_k448, sizeof(__pyx_k448)},
{&__pyx_k452p, __pyx_k452, sizeof(__pyx_k452)},
{&__pyx_k453p, __pyx_k453, sizeof(__pyx_k453)},
{&__pyx_k455p, __pyx_k455, sizeof(__pyx_k455)},
{&__pyx_k456p, __pyx_k456, sizeof(__pyx_k456)},
{&__pyx_k457p, __pyx_k457, sizeof(__pyx_k457)},
{&__pyx_k458p, __pyx_k458, sizeof(__pyx_k458)},
{&__pyx_k459p, __pyx_k459, sizeof(__pyx_k459)},
{&__pyx_k460p, __pyx_k460, sizeof(__pyx_k460)},
{&__pyx_k462p, __pyx_k462, sizeof(__pyx_k462)},
{&__pyx_k463p, __pyx_k463, sizeof(__pyx_k463)},
{&__pyx_k464p, __pyx_k464, sizeof(__pyx_k464)},
{&__pyx_k465p, __pyx_k465, sizeof(__pyx_k465)},
{&__pyx_k466p, __pyx_k466, sizeof(__pyx_k466)},
{&__pyx_k467p, __pyx_k467, sizeof(__pyx_k467)},
{0, 0, 0}
};
static __Pyx_CApiTabEntry __pyx_c_api_tab[] = {
{"appendChild", appendChild},
{"attributeValue", attributeValue},
{"attributeValueFromNsName", attributeValueFromNsName},
{"callLookupFallback", callLookupFallback},
{"deepcopyNodeToDocument", deepcopyNodeToDocument},
{"delAttribute", delAttribute},
{"delAttributeFromNsName", delAttributeFromNsName},
{"documentOrRaise", documentOrRaise},
{"elementFactory", elementFactory},
{"elementTreeFactory", elementTreeFactory},
{"findChild", findChild},
{"findChildBackwards", findChildBackwards},
{"findChildForwards", findChildForwards},
{"findOrBuildNodeNs", findOrBuildNodeNs},
{"getAttributeValue", getAttributeValue},
{"getNsTag", getNsTag},
{"initTagMatch", initTagMatch},
{"iteratorStoreNext", iteratorStoreNext},
{"iterattributes", iterattributes},
{"lookupDefaultElementClass", lookupDefaultElementClass},
{"lookupNamespaceElementClass", lookupNamespaceElementClass},
{"makeElement", makeElement},
{"namespacedName", namespacedName},
{"namespacedNameFromNsName", namespacedNameFromNsName},
{"newElementTree", newElementTree},
{"nextElement", nextElement},
{"previousElement", previousElement},
{"pyunicode", pyunicode},
{"rootNodeOrRaise", rootNodeOrRaise},
{"setAttributeValue", setAttributeValue},
{"setElementClassLookupFunction", setElementClassLookupFunction},
{"setNodeText", setNodeText},
{"setTailText", setTailText},
{"tagMatches", tagMatches},
{"tailOf", tailOf},
{"textOf", textOf},
{"utf8", utf8},
{0, 0}
};
static struct __pyx_vtabstruct_5etree__TempStore __pyx_vtable_5etree__TempStore;

static PyObject *__pyx_tp_new_5etree__TempStore(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__TempStore *p = (struct __pyx_obj_5etree__TempStore *)o;
*(struct __pyx_vtabstruct_5etree__TempStore **)&p->__pyx_vtab = __pyx_vtabptr_5etree__TempStore;
p->_storage = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__TempStore(PyObject *o) {
struct __pyx_obj_5etree__TempStore *p = (struct __pyx_obj_5etree__TempStore *)o;
Py_XDECREF(p->_storage);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__TempStore(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__TempStore *p = (struct __pyx_obj_5etree__TempStore *)o;
if (p->_storage) {
  e = (*v)(p->_storage, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__TempStore(PyObject *o) {
struct __pyx_obj_5etree__TempStore *p = (struct __pyx_obj_5etree__TempStore *)o;
Py_XDECREF(p->_storage);
p->_storage = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__TempStore = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._TempStore", /*tp_name*/
sizeof(struct __pyx_obj_5etree__TempStore), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__TempStore, /*tp_traverse*/
__pyx_tp_clear_5etree__TempStore, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_10_TempStore___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ExceptionContext __pyx_vtable_5etree__ExceptionContext;

static PyObject *__pyx_tp_new_5etree__ExceptionContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__ExceptionContext *p = (struct __pyx_obj_5etree__ExceptionContext *)o;
*(struct __pyx_vtabstruct_5etree__ExceptionContext **)&p->__pyx_vtab = __pyx_vtabptr_5etree__ExceptionContext;
p->_exc_info = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ExceptionContext(PyObject *o) {
struct __pyx_obj_5etree__ExceptionContext *p = (struct __pyx_obj_5etree__ExceptionContext *)o;
Py_XDECREF(p->_exc_info);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__ExceptionContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ExceptionContext *p = (struct __pyx_obj_5etree__ExceptionContext *)o;
if (p->_exc_info) {
  e = (*v)(p->_exc_info, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__ExceptionContext(PyObject *o) {
struct __pyx_obj_5etree__ExceptionContext *p = (struct __pyx_obj_5etree__ExceptionContext *)o;
Py_XDECREF(p->_exc_info);
p->_exc_info = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__ExceptionContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ExceptionContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ExceptionContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ExceptionContext, /*tp_traverse*/
__pyx_tp_clear_5etree__ExceptionContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree_QName(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree_QName *p = (struct __pyx_obj_5etree_QName *)o;
p->text = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_QName(PyObject *o) {
struct __pyx_obj_5etree_QName *p = (struct __pyx_obj_5etree_QName *)o;
Py_XDECREF(p->text);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree_QName(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_QName *p = (struct __pyx_obj_5etree_QName *)o;
if (p->text) {
  e = (*v)(p->text, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree_QName(PyObject *o) {
struct __pyx_obj_5etree_QName *p = (struct __pyx_obj_5etree_QName *)o;
Py_XDECREF(p->text);
p->text = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_QName[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_QName[] = {
{"text", T_OBJECT, offsetof(struct __pyx_obj_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*/
};

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_5etree_QName = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.QName", /*tp_name*/
sizeof(struct __pyx_obj_5etree_QName), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_5etree_5QName___hash__, /*tp_hash*/
0, /*tp_call*/
__pyx_f_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    ", /*tp_doc*/
__pyx_tp_traverse_5etree_QName, /*tp_traverse*/
__pyx_tp_clear_5etree_QName, /*tp_clear*/
__pyx_f_5etree_5QName___richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_QName, /*tp_methods*/
__pyx_members_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_f_5etree_5QName___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__BaseParser __pyx_vtable_5etree__BaseParser;

static PyObject *__pyx_tp_new_5etree__BaseParser(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__BaseParser *p = (struct __pyx_obj_5etree__BaseParser *)o;
*(struct __pyx_vtabstruct_5etree__BaseParser **)&p->__pyx_vtab = __pyx_vtabptr_5etree__BaseParser;
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
p->resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
p->_context = ((struct __pyx_obj_5etree__ResolverContext *)Py_None); Py_INCREF(Py_None);
p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__BaseParser(PyObject *o) {
struct __pyx_obj_5etree__BaseParser *p = (struct __pyx_obj_5etree__BaseParser *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_11_BaseParser___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_error_log));
Py_XDECREF(((PyObject *)p->resolvers));
Py_XDECREF(((PyObject *)p->_context));
Py_XDECREF(((PyObject *)p->_class_lookup));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__BaseParser(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__BaseParser *p = (struct __pyx_obj_5etree__BaseParser *)o;
if (p->_error_log) {
  e = (*v)(((PyObject*)p->_error_log), a); if (e) return e;
}
if (p->resolvers) {
  e = (*v)(((PyObject*)p->resolvers), a); if (e) return e;
}
if (p->_context) {
  e = (*v)(((PyObject*)p->_context), a); if (e) return e;
}
if (p->_class_lookup) {
  e = (*v)(((PyObject*)p->_class_lookup), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__BaseParser(PyObject *o) {
struct __pyx_obj_5etree__BaseParser *p = (struct __pyx_obj_5etree__BaseParser *)o;
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->resolvers));
p->resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_context));
p->_context = ((struct __pyx_obj_5etree__ResolverContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_class_lookup));
p->_class_lookup = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_5etree_11_BaseParser_error_log(PyObject *o, void *x) {
return __pyx_f_5etree_11_BaseParser_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__BaseParser[] = {
{"__dummy", (PyCFunction)__pyx_f_5etree_11_BaseParser___dummy, METH_VARARGS|METH_KEYWORDS, 0},
{"setElementClassLookup", (PyCFunction)__pyx_f_5etree_11_BaseParser_setElementClassLookup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_11_BaseParser_setElementClassLookup},
{"copy", (PyCFunction)__pyx_f_5etree_11_BaseParser_copy, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_11_BaseParser_copy},
{"makeelement", (PyCFunction)__pyx_f_5etree_11_BaseParser_makeelement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_11_BaseParser_makeelement},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree__BaseParser[] = {
{"resolvers", T_OBJECT, offsetof(struct __pyx_obj_5etree__BaseParser, resolvers), READONLY, 0},
{0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__BaseParser[] = {
{"error_log", __pyx_getprop_5etree_11_BaseParser_error_log, 0, 0, 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*/
};

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_5etree__BaseParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._BaseParser", /*tp_name*/
sizeof(struct __pyx_obj_5etree__BaseParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__BaseParser, /*tp_traverse*/
__pyx_tp_clear_5etree__BaseParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__BaseParser, /*tp_methods*/
__pyx_members_5etree__BaseParser, /*tp_members*/
__pyx_getsets_5etree__BaseParser, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_f_5etree_11_BaseParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__Document __pyx_vtable_5etree__Document;

static PyObject *__pyx_tp_new_5etree__Document(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct LxmlDocument *p = (struct LxmlDocument *)o;
*(struct __pyx_vtabstruct_5etree__Document **)&p->__pyx_vtab = __pyx_vtabptr_5etree__Document;
p->_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__Document(PyObject *o) {
struct LxmlDocument *p = (struct LxmlDocument *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_9_Document___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_parser));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__Document(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlDocument *p = (struct LxmlDocument *)o;
if (p->_parser) {
  e = (*v)(((PyObject*)p->_parser), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__Document(PyObject *o) {
struct LxmlDocument *p = (struct LxmlDocument *)o;
Py_XDECREF(((PyObject *)p->_parser));
p->_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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*/
"etree._Document", /*tp_name*/
sizeof(struct LxmlDocument), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__Document, /*tp_traverse*/
__pyx_tp_clear_5etree__Document, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree_DocInfo(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree_DocInfo *p = (struct __pyx_obj_5etree_DocInfo *)o;
p->root_name = Py_None; Py_INCREF(Py_None);
p->public_id = Py_None; Py_INCREF(Py_None);
p->system_url = Py_None; Py_INCREF(Py_None);
p->xml_version = Py_None; Py_INCREF(Py_None);
p->encoding = Py_None; Py_INCREF(Py_None);
p->URL = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_DocInfo(PyObject *o) {
struct __pyx_obj_5etree_DocInfo *p = (struct __pyx_obj_5etree_DocInfo *)o;
Py_XDECREF(p->root_name);
Py_XDECREF(p->public_id);
Py_XDECREF(p->system_url);
Py_XDECREF(p->xml_version);
Py_XDECREF(p->encoding);
Py_XDECREF(p->URL);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree_DocInfo(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_DocInfo *p = (struct __pyx_obj_5etree_DocInfo *)o;
if (p->root_name) {
  e = (*v)(p->root_name, a); if (e) return e;
}
if (p->public_id) {
  e = (*v)(p->public_id, a); if (e) return e;
}
if (p->system_url) {
  e = (*v)(p->system_url, a); if (e) return e;
}
if (p->xml_version) {
  e = (*v)(p->xml_version, 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;
}
return 0;
}

static int __pyx_tp_clear_5etree_DocInfo(PyObject *o) {
struct __pyx_obj_5etree_DocInfo *p = (struct __pyx_obj_5etree_DocInfo *)o;
Py_XDECREF(p->root_name);
p->root_name = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->public_id);
p->public_id = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->system_url);
p->system_url = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->xml_version);
p->xml_version = 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);
return 0;
}

static PyObject *__pyx_getprop_5etree_7DocInfo_doctype(PyObject *o, void *x) {
return __pyx_f_5etree_7DocInfo_7doctype___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree_DocInfo[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_DocInfo[] = {
{"root_name", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, root_name), READONLY, 0},
{"public_id", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, public_id), READONLY, 0},
{"system_url", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, system_url), READONLY, 0},
{"xml_version", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, xml_version), READONLY, 0},
{"encoding", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, encoding), READONLY, 0},
{"URL", T_OBJECT, offsetof(struct __pyx_obj_5etree_DocInfo, URL), READONLY, 0},
{0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree_DocInfo[] = {
{"doctype", __pyx_getprop_5etree_7DocInfo_doctype, 0, 0, 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*/
};

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_5etree_DocInfo = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.DocInfo", /*tp_name*/
sizeof(struct __pyx_obj_5etree_DocInfo), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_DocInfo, /*tp_traverse*/
__pyx_tp_clear_5etree_DocInfo, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_DocInfo, /*tp_methods*/
__pyx_members_5etree_DocInfo, /*tp_members*/
__pyx_getsets_5etree_DocInfo, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_f_5etree_7DocInfo___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__Element(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct LxmlElement *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_5etree__Element(PyObject *o) {
struct LxmlElement *p = (struct LxmlElement *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_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_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_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_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_5etree__Element(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_f_5etree_8_Element___setitem__(o, i, v);
}
else {
  return __pyx_f_5etree_8_Element___delitem__(o, i);
}
}

static int __pyx_sq_ass_slice_5etree__Element(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {
if (v) {
  return __pyx_f_5etree_8_Element___setslice__(o, i, j, v);
}
else {
  return __pyx_f_5etree_8_Element___delslice__(o, i, j);
}
}

static PyObject *__pyx_getprop_5etree_8_Element_tag(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_3tag___get__(o);
}

static int __pyx_setprop_5etree_8_Element_tag(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_8_Element_3tag___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_5etree_8_Element_attrib(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_6attrib___get__(o);
}

static PyObject *__pyx_getprop_5etree_8_Element_text(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_4text___get__(o);
}

static int __pyx_setprop_5etree_8_Element_text(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_8_Element_4text___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_5etree_8_Element_tail(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_4tail___get__(o);
}

static int __pyx_setprop_5etree_8_Element_tail(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_8_Element_4tail___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static PyObject *__pyx_getprop_5etree_8_Element_prefix(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_6prefix___get__(o);
}

static PyObject *__pyx_getprop_5etree_8_Element_nsmap(PyObject *o, void *x) {
return __pyx_f_5etree_8_Element_5nsmap___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__Element[] = {
{"_init", (PyCFunction)__pyx_f_5etree_8_Element__init, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element__init},
{"__deepcopy__", (PyCFunction)__pyx_f_5etree_8_Element___deepcopy__, METH_VARARGS|METH_KEYWORDS, 0},
{"__copy__", (PyCFunction)__pyx_f_5etree_8_Element___copy__, METH_VARARGS|METH_KEYWORDS, 0},
{"set", (PyCFunction)__pyx_f_5etree_8_Element_set, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_set},
{"append", (PyCFunction)__pyx_f_5etree_8_Element_append, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_append},
{"extend", (PyCFunction)__pyx_f_5etree_8_Element_extend, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_extend},
{"clear", (PyCFunction)__pyx_f_5etree_8_Element_clear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_clear},
{"insert", (PyCFunction)__pyx_f_5etree_8_Element_insert, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_insert},
{"remove", (PyCFunction)__pyx_f_5etree_8_Element_remove, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_remove},
{"replace", (PyCFunction)__pyx_f_5etree_8_Element_replace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_replace},
{"__reversed__", (PyCFunction)__pyx_f_5etree_8_Element___reversed__, METH_VARARGS|METH_KEYWORDS, 0},
{"index", (PyCFunction)__pyx_f_5etree_8_Element_index, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_index},
{"get", (PyCFunction)__pyx_f_5etree_8_Element_get, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_get},
{"keys", (PyCFunction)__pyx_f_5etree_8_Element_keys, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_keys},
{"items", (PyCFunction)__pyx_f_5etree_8_Element_items, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_items},
{"getchildren", (PyCFunction)__pyx_f_5etree_8_Element_getchildren, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getchildren},
{"getparent", (PyCFunction)__pyx_f_5etree_8_Element_getparent, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getparent},
{"getnext", (PyCFunction)__pyx_f_5etree_8_Element_getnext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getnext},
{"getprevious", (PyCFunction)__pyx_f_5etree_8_Element_getprevious, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getprevious},
{"itersiblings", (PyCFunction)__pyx_f_5etree_8_Element_itersiblings, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_itersiblings},
{"iterancestors", (PyCFunction)__pyx_f_5etree_8_Element_iterancestors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_iterancestors},
{"iterdescendants", (PyCFunction)__pyx_f_5etree_8_Element_iterdescendants, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_iterdescendants},
{"iterchildren", (PyCFunction)__pyx_f_5etree_8_Element_iterchildren, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_iterchildren},
{"getroottree", (PyCFunction)__pyx_f_5etree_8_Element_getroottree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getroottree},
{"getiterator", (PyCFunction)__pyx_f_5etree_8_Element_getiterator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_getiterator},
{"makeelement", (PyCFunction)__pyx_f_5etree_8_Element_makeelement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_makeelement},
{"find", (PyCFunction)__pyx_f_5etree_8_Element_find, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_find},
{"findtext", (PyCFunction)__pyx_f_5etree_8_Element_findtext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_findtext},
{"findall", (PyCFunction)__pyx_f_5etree_8_Element_findall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_findall},
{"xpath", (PyCFunction)__pyx_f_5etree_8_Element_xpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8_Element_xpath},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__Element[] = {
{"tag", __pyx_getprop_5etree_8_Element_tag, __pyx_setprop_5etree_8_Element_tag, __pyx_k1, 0},
{"attrib", __pyx_getprop_5etree_8_Element_attrib, 0, __pyx_k2, 0},
{"text", __pyx_getprop_5etree_8_Element_text, __pyx_setprop_5etree_8_Element_text, __pyx_k3, 0},
{"tail", __pyx_getprop_5etree_8_Element_tail, __pyx_setprop_5etree_8_Element_tail, __pyx_k4, 0},
{"prefix", __pyx_getprop_5etree_8_Element_prefix, 0, __pyx_k5, 0},
{"nsmap", __pyx_getprop_5etree_8_Element_nsmap, 0, __pyx_k6, 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_f_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*/
};

static PySequenceMethods __pyx_tp_as_sequence__Element = {
__pyx_f_5etree_8_Element___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5etree__Element, /*sq_item*/
__pyx_f_5etree_8_Element___getslice__, /*sq_slice*/
0, /*sq_ass_item*/
__pyx_sq_ass_slice_5etree__Element, /*sq_ass_slice*/
__pyx_f_5etree_8_Element___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Element = {
__pyx_f_5etree_8_Element___len__, /*mp_length*/
__pyx_f_5etree_8_Element___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_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*/
"etree._Element", /*tp_name*/
sizeof(struct LxmlElement), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__Element, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__Element, /*tp_traverse*/
__pyx_tp_clear_5etree__Element, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_8_Element___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__Element, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree___ContentOnlyElement __pyx_vtable_5etree___ContentOnlyElement;

static PyObject *__pyx_tp_new_5etree___ContentOnlyElement(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__Element->tp_new(t, a, k);
struct __pyx_obj_5etree___ContentOnlyElement *p = (struct __pyx_obj_5etree___ContentOnlyElement *)o;
*(struct __pyx_vtabstruct_5etree___ContentOnlyElement **)&p->__pyx_vtab = __pyx_vtabptr_5etree___ContentOnlyElement;
return o;
}

static void __pyx_tp_dealloc_5etree___ContentOnlyElement(PyObject *o) {
__pyx_ptype_5etree__Element->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree___ContentOnlyElement(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__Element->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree___ContentOnlyElement(PyObject *o) {
__pyx_ptype_5etree__Element->tp_clear(o);
return 0;
}
static PyObject *__pyx_sq_item_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_5etree___ContentOnlyElement(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_f_5etree_20__ContentOnlyElement___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_5etree__Element->tp_as_mapping && __pyx_ptype_5etree__Element->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_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_5etree___ContentOnlyElement(PyObject *o, Py_ssize_t i, Py_ssize_t j, PyObject *v) {
if (v) {
  return __pyx_f_5etree_20__ContentOnlyElement___setslice__(o, i, j, v);
}
else {
  if (__pyx_ptype_5etree__Element->tp_as_sequence && __pyx_ptype_5etree__Element->tp_as_sequence->sq_ass_slice)
    return __pyx_ptype_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_5etree_20__ContentOnlyElement_attrib(PyObject *o, void *x) {
return __pyx_f_5etree_20__ContentOnlyElement_6attrib___get__(o);
}

static PyObject *__pyx_getprop_5etree_20__ContentOnlyElement_text(PyObject *o, void *x) {
return __pyx_f_5etree_20__ContentOnlyElement_4text___get__(o);
}

static int __pyx_setprop_5etree_20__ContentOnlyElement_text(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_20__ContentOnlyElement_4text___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static struct PyMethodDef __pyx_methods_5etree___ContentOnlyElement[] = {
{"set", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_set, METH_VARARGS|METH_KEYWORDS, 0},
{"append", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_append, METH_VARARGS|METH_KEYWORDS, 0},
{"insert", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_insert, METH_VARARGS|METH_KEYWORDS, 0},
{"get", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_get, METH_VARARGS|METH_KEYWORDS, 0},
{"keys", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_keys, METH_VARARGS|METH_KEYWORDS, 0},
{"items", (PyCFunction)__pyx_f_5etree_20__ContentOnlyElement_items, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree___ContentOnlyElement[] = {
{"attrib", __pyx_getprop_5etree_20__ContentOnlyElement_attrib, 0, 0, 0},
{"text", __pyx_getprop_5etree_20__ContentOnlyElement_text, __pyx_setprop_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*/
};

static PySequenceMethods __pyx_tp_as_sequence___ContentOnlyElement = {
__pyx_f_5etree_20__ContentOnlyElement___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5etree___ContentOnlyElement, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
__pyx_sq_ass_slice_5etree___ContentOnlyElement, /*sq_ass_slice*/
0, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping___ContentOnlyElement = {
__pyx_f_5etree_20__ContentOnlyElement___len__, /*mp_length*/
__pyx_f_5etree_20__ContentOnlyElement___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_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_5etree___ContentOnlyElement = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.__ContentOnlyElement", /*tp_name*/
sizeof(struct __pyx_obj_5etree___ContentOnlyElement), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree___ContentOnlyElement, /*tp_traverse*/
__pyx_tp_clear_5etree___ContentOnlyElement, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree___ContentOnlyElement, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__Comment __pyx_vtable_5etree__Comment;

static PyObject *__pyx_tp_new_5etree__Comment(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree___ContentOnlyElement->tp_new(t, a, k);
struct __pyx_obj_5etree__Comment *p = (struct __pyx_obj_5etree__Comment *)o;
*(struct __pyx_vtabstruct_5etree__Comment **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__Comment;
return o;
}

static void __pyx_tp_dealloc_5etree__Comment(PyObject *o) {
__pyx_ptype_5etree___ContentOnlyElement->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__Comment(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree___ContentOnlyElement->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__Comment(PyObject *o) {
__pyx_ptype_5etree___ContentOnlyElement->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_5etree_8_Comment_tag(PyObject *o, void *x) {
return __pyx_f_5etree_8_Comment_3tag___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__Comment[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__Comment[] = {
{"tag", __pyx_getprop_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*/
};

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_5etree__Comment = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._Comment", /*tp_name*/
sizeof(struct __pyx_obj_5etree__Comment), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__Comment, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__Comment, /*tp_traverse*/
__pyx_tp_clear_5etree__Comment, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__Comment, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__ProcessingInstruction __pyx_vtable_5etree__ProcessingInstruction;

static PyObject *__pyx_tp_new_5etree__ProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree___ContentOnlyElement->tp_new(t, a, k);
struct __pyx_obj_5etree__ProcessingInstruction *p = (struct __pyx_obj_5etree__ProcessingInstruction *)o;
*(struct __pyx_vtabstruct_5etree__ProcessingInstruction **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ProcessingInstruction;
return o;
}

static void __pyx_tp_dealloc_5etree__ProcessingInstruction(PyObject *o) {
__pyx_ptype_5etree___ContentOnlyElement->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ProcessingInstruction(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree___ContentOnlyElement->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__ProcessingInstruction(PyObject *o) {
__pyx_ptype_5etree___ContentOnlyElement->tp_clear(o);
return 0;
}

static PyObject *__pyx_getprop_5etree_22_ProcessingInstruction_tag(PyObject *o, void *x) {
return __pyx_f_5etree_22_ProcessingInstruction_3tag___get__(o);
}

static PyObject *__pyx_getprop_5etree_22_ProcessingInstruction_target(PyObject *o, void *x) {
return __pyx_f_5etree_22_ProcessingInstruction_6target___get__(o);
}

static int __pyx_setprop_5etree_22_ProcessingInstruction_target(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_22_ProcessingInstruction_6target___set__(o, v);
}
else {
  PyErr_SetString(PyExc_NotImplementedError, "__del__");
  return -1;
}
}

static struct PyMethodDef __pyx_methods_5etree__ProcessingInstruction[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__ProcessingInstruction[] = {
{"tag", __pyx_getprop_5etree_22_ProcessingInstruction_tag, 0, 0, 0},
{"target", __pyx_getprop_5etree_22_ProcessingInstruction_target, __pyx_setprop_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*/
};

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_5etree__ProcessingInstruction = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ProcessingInstruction", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ProcessingInstruction), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__ProcessingInstruction, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__ProcessingInstruction, /*tp_traverse*/
__pyx_tp_clear_5etree__ProcessingInstruction, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__ProcessingInstruction, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__ElementTree __pyx_vtable_5etree__ElementTree;

static PyObject *__pyx_tp_new_5etree__ElementTree(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct LxmlElementTree *p = (struct LxmlElementTree *)o;
*(struct __pyx_vtabstruct_5etree__ElementTree **)&p->__pyx_vtab = __pyx_vtabptr_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_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_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_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_5etree_12_ElementTree_docinfo(PyObject *o, void *x) {
return __pyx_f_5etree_12_ElementTree_7docinfo___get__(o);
}

static PyObject *__pyx_getprop_5etree_12_ElementTree_parser(PyObject *o, void *x) {
return __pyx_f_5etree_12_ElementTree_6parser___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__ElementTree[] = {
{"parse", (PyCFunction)__pyx_f_5etree_12_ElementTree_parse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_parse},
{"getroot", (PyCFunction)__pyx_f_5etree_12_ElementTree_getroot, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_getroot},
{"__copy__", (PyCFunction)__pyx_f_5etree_12_ElementTree___copy__, METH_VARARGS|METH_KEYWORDS, 0},
{"__deepcopy__", (PyCFunction)__pyx_f_5etree_12_ElementTree___deepcopy__, METH_VARARGS|METH_KEYWORDS, 0},
{"write", (PyCFunction)__pyx_f_5etree_12_ElementTree_write, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_write},
{"getpath", (PyCFunction)__pyx_f_5etree_12_ElementTree_getpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_getpath},
{"getiterator", (PyCFunction)__pyx_f_5etree_12_ElementTree_getiterator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_getiterator},
{"find", (PyCFunction)__pyx_f_5etree_12_ElementTree_find, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_find},
{"findtext", (PyCFunction)__pyx_f_5etree_12_ElementTree_findtext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_findtext},
{"findall", (PyCFunction)__pyx_f_5etree_12_ElementTree_findall, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_findall},
{"xpath", (PyCFunction)__pyx_f_5etree_12_ElementTree_xpath, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_xpath},
{"xslt", (PyCFunction)__pyx_f_5etree_12_ElementTree_xslt, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_xslt},
{"relaxng", (PyCFunction)__pyx_f_5etree_12_ElementTree_relaxng, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_relaxng},
{"xmlschema", (PyCFunction)__pyx_f_5etree_12_ElementTree_xmlschema, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_xmlschema},
{"xinclude", (PyCFunction)__pyx_f_5etree_12_ElementTree_xinclude, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_xinclude},
{"write_c14n", (PyCFunction)__pyx_f_5etree_12_ElementTree_write_c14n, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_12_ElementTree_write_c14n},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__ElementTree[] = {
{"docinfo", __pyx_getprop_5etree_12_ElementTree_docinfo, 0, __pyx_k7, 0},
{"parser", __pyx_getprop_5etree_12_ElementTree_parser, 0, __pyx_k8, 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*/
};

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*/
"etree._ElementTree", /*tp_name*/
sizeof(struct LxmlElementTree), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ElementTree, /*tp_traverse*/
__pyx_tp_clear_5etree__ElementTree, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__ElementTree, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__Attrib(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__Attrib *p = (struct __pyx_obj_5etree__Attrib *)o;
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__Attrib(PyObject *o) {
struct __pyx_obj_5etree__Attrib *p = (struct __pyx_obj_5etree__Attrib *)o;
Py_XDECREF(((PyObject *)p->_element));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__Attrib(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__Attrib *p = (struct __pyx_obj_5etree__Attrib *)o;
if (p->_element) {
  e = (*v)(((PyObject*)p->_element), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__Attrib(PyObject *o) {
struct __pyx_obj_5etree__Attrib *p = (struct __pyx_obj_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_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_5etree__Attrib(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_f_5etree_7_Attrib___setitem__(o, i, v);
}
else {
  return __pyx_f_5etree_7_Attrib___delitem__(o, i);
}
}

static struct PyMethodDef __pyx_methods_5etree__Attrib[] = {
{"get", (PyCFunction)__pyx_f_5etree_7_Attrib_get, METH_VARARGS|METH_KEYWORDS, 0},
{"keys", (PyCFunction)__pyx_f_5etree_7_Attrib_keys, METH_VARARGS|METH_KEYWORDS, 0},
{"iterkeys", (PyCFunction)__pyx_f_5etree_7_Attrib_iterkeys, METH_VARARGS|METH_KEYWORDS, 0},
{"values", (PyCFunction)__pyx_f_5etree_7_Attrib_values, METH_VARARGS|METH_KEYWORDS, 0},
{"itervalues", (PyCFunction)__pyx_f_5etree_7_Attrib_itervalues, METH_VARARGS|METH_KEYWORDS, 0},
{"items", (PyCFunction)__pyx_f_5etree_7_Attrib_items, METH_VARARGS|METH_KEYWORDS, 0},
{"iteritems", (PyCFunction)__pyx_f_5etree_7_Attrib_iteritems, METH_VARARGS|METH_KEYWORDS, 0},
{"has_key", (PyCFunction)__pyx_f_5etree_7_Attrib_has_key, METH_VARARGS|METH_KEYWORDS, 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_f_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*/
};

static PySequenceMethods __pyx_tp_as_sequence__Attrib = {
__pyx_f_5etree_7_Attrib___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5etree__Attrib, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_f_5etree_7_Attrib___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__Attrib = {
__pyx_f_5etree_7_Attrib___len__, /*mp_length*/
__pyx_f_5etree_7_Attrib___getitem__, /*mp_subscript*/
__pyx_mp_ass_subscript_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_5etree__Attrib = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._Attrib", /*tp_name*/
sizeof(struct __pyx_obj_5etree__Attrib), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__Attrib, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__Attrib, /*tp_traverse*/
__pyx_tp_clear_5etree__Attrib, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_7_Attrib___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_7_Attrib___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__AttribIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__AttribIterator *p = (struct __pyx_obj_5etree__AttribIterator *)o;
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__AttribIterator(PyObject *o) {
struct __pyx_obj_5etree__AttribIterator *p = (struct __pyx_obj_5etree__AttribIterator *)o;
Py_XDECREF(((PyObject *)p->_node));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__AttribIterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__AttribIterator *p = (struct __pyx_obj_5etree__AttribIterator *)o;
if (p->_node) {
  e = (*v)(((PyObject*)p->_node), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__AttribIterator(PyObject *o) {
struct __pyx_obj_5etree__AttribIterator *p = (struct __pyx_obj_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_5etree__AttribIterator[] = {
{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*/
};

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_5etree__AttribIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._AttribIterator", /*tp_name*/
sizeof(struct __pyx_obj_5etree__AttribIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__AttribIterator, /*tp_traverse*/
__pyx_tp_clear_5etree__AttribIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_15_AttribIterator___iter__, /*tp_iter*/
__pyx_f_5etree_15_AttribIterator___next__, /*tp_iternext*/
__pyx_methods_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_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_5etree__ElementTagMatcher __pyx_vtable_5etree__ElementTagMatcher;

static PyObject *__pyx_tp_new_5etree__ElementTagMatcher(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct LxmlElementTagMatcher *p = (struct LxmlElementTagMatcher *)o;
*(struct __pyx_vtabstruct_5etree__ElementTagMatcher **)&p->__pyx_vtab = __pyx_vtabptr_5etree__ElementTagMatcher;
p->_pystrings = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_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_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_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_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*/
};

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*/
"etree._ElementTagMatcher", /*tp_name*/
sizeof(struct LxmlElementTagMatcher), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ElementTagMatcher, /*tp_traverse*/
__pyx_tp_clear_5etree__ElementTagMatcher, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__ElementIterator __pyx_vtable_5etree__ElementIterator;

static PyObject *__pyx_tp_new_5etree__ElementIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementTagMatcher->tp_new(t, a, k);
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
*(struct __pyx_vtabstruct_5etree__ElementIterator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ElementIterator;
p->_node = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ElementIterator(PyObject *o) {
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
Py_XDECREF(((PyObject *)p->_node));
__pyx_ptype_5etree__ElementTagMatcher->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ElementIterator(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
e = __pyx_ptype_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_5etree__ElementIterator(PyObject *o) {
struct LxmlElementIterator *p = (struct LxmlElementIterator *)o;
__pyx_ptype_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_5etree__ElementIterator[] = {
{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*/
};

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*/
"etree._ElementIterator", /*tp_name*/
sizeof(struct LxmlElementIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ElementIterator, /*tp_traverse*/
__pyx_tp_clear_5etree__ElementIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_16_ElementIterator___iter__, /*tp_iter*/
__pyx_f_5etree_16_ElementIterator___next__, /*tp_iternext*/
__pyx_methods_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_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_5etree_ElementChildIterator __pyx_vtable_5etree_ElementChildIterator;

static PyObject *__pyx_tp_new_5etree_ElementChildIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementIterator->tp_new(t, a, k);
struct __pyx_obj_5etree_ElementChildIterator *p = (struct __pyx_obj_5etree_ElementChildIterator *)o;
*(struct __pyx_vtabstruct_5etree_ElementChildIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_ElementChildIterator;
return o;
}

static void __pyx_tp_dealloc_5etree_ElementChildIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ElementChildIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_ElementChildIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_ElementChildIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ElementChildIterator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ElementChildIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_ElementChildIterator, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementChildIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_20ElementChildIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_SiblingsIterator __pyx_vtable_5etree_SiblingsIterator;

static PyObject *__pyx_tp_new_5etree_SiblingsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementIterator->tp_new(t, a, k);
struct __pyx_obj_5etree_SiblingsIterator *p = (struct __pyx_obj_5etree_SiblingsIterator *)o;
*(struct __pyx_vtabstruct_5etree_SiblingsIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_SiblingsIterator;
return o;
}

static void __pyx_tp_dealloc_5etree_SiblingsIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_SiblingsIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_SiblingsIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_SiblingsIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.SiblingsIterator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_SiblingsIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_SiblingsIterator, /*tp_traverse*/
__pyx_tp_clear_5etree_SiblingsIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_16SiblingsIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_AncestorsIterator __pyx_vtable_5etree_AncestorsIterator;

static PyObject *__pyx_tp_new_5etree_AncestorsIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementIterator->tp_new(t, a, k);
struct __pyx_obj_5etree_AncestorsIterator *p = (struct __pyx_obj_5etree_AncestorsIterator *)o;
*(struct __pyx_vtabstruct_5etree_AncestorsIterator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_AncestorsIterator;
return o;
}

static void __pyx_tp_dealloc_5etree_AncestorsIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_AncestorsIterator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ElementIterator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_AncestorsIterator(PyObject *o) {
__pyx_ptype_5etree__ElementIterator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_AncestorsIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.AncestorsIterator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_AncestorsIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_AncestorsIterator, /*tp_traverse*/
__pyx_tp_clear_5etree_AncestorsIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_17AncestorsIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ElementDepthFirstIterator __pyx_vtable_5etree_ElementDepthFirstIterator;

static PyObject *__pyx_tp_new_5etree_ElementDepthFirstIterator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementTagMatcher->tp_new(t, a, k);
struct __pyx_obj_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_5etree_ElementDepthFirstIterator *)o;
*(struct __pyx_vtabstruct_5etree_ElementDepthFirstIterator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_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_5etree_ElementDepthFirstIterator(PyObject *o) {
struct __pyx_obj_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_5etree_ElementDepthFirstIterator *)o;
Py_XDECREF(((PyObject *)p->_next_node));
Py_XDECREF(((PyObject *)p->_top_node));
__pyx_ptype_5etree__ElementTagMatcher->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ElementDepthFirstIterator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_5etree_ElementDepthFirstIterator *)o;
e = __pyx_ptype_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_5etree_ElementDepthFirstIterator(PyObject *o) {
struct __pyx_obj_5etree_ElementDepthFirstIterator *p = (struct __pyx_obj_5etree_ElementDepthFirstIterator *)o;
__pyx_ptype_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_5etree_ElementDepthFirstIterator[] = {
{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*/
};

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_5etree_ElementDepthFirstIterator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ElementDepthFirstIterator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ElementDepthFirstIterator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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).\n\n    If the optional \'tag\' argument is not None, it returns only the elements\n    that match the respective name and namespace.\n\n    The optional boolean \'inclusive\' argument 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_5etree_ElementDepthFirstIterator, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementDepthFirstIterator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_25ElementDepthFirstIterator___iter__, /*tp_iter*/
__pyx_f_5etree_25ElementDepthFirstIterator___next__, /*tp_iternext*/
__pyx_methods_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_f_5etree_25ElementDepthFirstIterator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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 struct __pyx_vtabstruct_5etree__LogEntry __pyx_vtable_5etree__LogEntry;

static PyObject *__pyx_tp_new_5etree__LogEntry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__LogEntry *p = (struct __pyx_obj_5etree__LogEntry *)o;
*(struct __pyx_vtabstruct_5etree__LogEntry **)&p->__pyx_vtab = __pyx_vtabptr_5etree__LogEntry;
p->domain = Py_None; Py_INCREF(Py_None);
p->type = Py_None; Py_INCREF(Py_None);
p->line = Py_None; Py_INCREF(Py_None);
p->level = 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_5etree__LogEntry(PyObject *o) {
struct __pyx_obj_5etree__LogEntry *p = (struct __pyx_obj_5etree__LogEntry *)o;
Py_XDECREF(p->domain);
Py_XDECREF(p->type);
Py_XDECREF(p->line);
Py_XDECREF(p->level);
Py_XDECREF(p->message);
Py_XDECREF(p->filename);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__LogEntry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__LogEntry *p = (struct __pyx_obj_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->line) {
  e = (*v)(p->line, a); if (e) return e;
}
if (p->level) {
  e = (*v)(p->level, 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_5etree__LogEntry(PyObject *o) {
struct __pyx_obj_5etree__LogEntry *p = (struct __pyx_obj_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->line);
p->line = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->level);
p->level = 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_5etree_9_LogEntry_domain_name(PyObject *o, void *x) {
return __pyx_f_5etree_9_LogEntry_11domain_name___get__(o);
}

static PyObject *__pyx_getprop_5etree_9_LogEntry_type_name(PyObject *o, void *x) {
return __pyx_f_5etree_9_LogEntry_9type_name___get__(o);
}

static PyObject *__pyx_getprop_5etree_9_LogEntry_level_name(PyObject *o, void *x) {
return __pyx_f_5etree_9_LogEntry_10level_name___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__LogEntry[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree__LogEntry[] = {
{"domain", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, domain), READONLY, 0},
{"type", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, type), READONLY, 0},
{"line", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, line), READONLY, 0},
{"level", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, level), READONLY, 0},
{"message", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, message), READONLY, 0},
{"filename", T_OBJECT, offsetof(struct __pyx_obj_5etree__LogEntry, filename), READONLY, 0},
{0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__LogEntry[] = {
{"domain_name", __pyx_getprop_5etree_9_LogEntry_domain_name, 0, 0, 0},
{"type_name", __pyx_getprop_5etree_9_LogEntry_type_name, 0, 0, 0},
{"level_name", __pyx_getprop_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*/
};

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_5etree__LogEntry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._LogEntry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__LogEntry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__LogEntry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__LogEntry, /*tp_traverse*/
__pyx_tp_clear_5etree__LogEntry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__LogEntry, /*tp_methods*/
__pyx_members_5etree__LogEntry, /*tp_members*/
__pyx_getsets_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_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_5etree__BaseErrorLog __pyx_vtable_5etree__BaseErrorLog;

static PyObject *__pyx_tp_new_5etree__BaseErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__BaseErrorLog *p = (struct __pyx_obj_5etree__BaseErrorLog *)o;
*(struct __pyx_vtabstruct_5etree__BaseErrorLog **)&p->__pyx_vtab = __pyx_vtabptr_5etree__BaseErrorLog;
p->last_error = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__BaseErrorLog(PyObject *o) {
struct __pyx_obj_5etree__BaseErrorLog *p = (struct __pyx_obj_5etree__BaseErrorLog *)o;
Py_XDECREF(p->last_error);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__BaseErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__BaseErrorLog *p = (struct __pyx_obj_5etree__BaseErrorLog *)o;
if (p->last_error) {
  e = (*v)(p->last_error, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__BaseErrorLog(PyObject *o) {
struct __pyx_obj_5etree__BaseErrorLog *p = (struct __pyx_obj_5etree__BaseErrorLog *)o;
Py_XDECREF(p->last_error);
p->last_error = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__BaseErrorLog[] = {
{"copy", (PyCFunction)__pyx_f_5etree_13_BaseErrorLog_copy, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree__BaseErrorLog[] = {
{"last_error", T_OBJECT, offsetof(struct __pyx_obj_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*/
};

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_5etree__BaseErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._BaseErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree__BaseErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__BaseErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__BaseErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree__BaseErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__BaseErrorLog, /*tp_methods*/
__pyx_members_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_f_5etree_13_BaseErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ListErrorLog __pyx_vtable_5etree__ListErrorLog;

static PyObject *__pyx_tp_new_5etree__ListErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseErrorLog->tp_new(t, a, k);
struct __pyx_obj_5etree__ListErrorLog *p = (struct __pyx_obj_5etree__ListErrorLog *)o;
*(struct __pyx_vtabstruct_5etree__ListErrorLog **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ListErrorLog;
p->_entries = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ListErrorLog(PyObject *o) {
struct __pyx_obj_5etree__ListErrorLog *p = (struct __pyx_obj_5etree__ListErrorLog *)o;
Py_XDECREF(p->_entries);
__pyx_ptype_5etree__BaseErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ListErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ListErrorLog *p = (struct __pyx_obj_5etree__ListErrorLog *)o;
e = __pyx_ptype_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_5etree__ListErrorLog(PyObject *o) {
struct __pyx_obj_5etree__ListErrorLog *p = (struct __pyx_obj_5etree__ListErrorLog *)o;
__pyx_ptype_5etree__BaseErrorLog->tp_clear(o);
Py_XDECREF(p->_entries);
p->_entries = Py_None; Py_INCREF(Py_None);
return 0;
}
static PyObject *__pyx_sq_item_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_5etree__ListErrorLog[] = {
{"copy", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_copy, METH_VARARGS|METH_KEYWORDS, 0},
{"filter_domains", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_domains, METH_VARARGS|METH_KEYWORDS, 0},
{"filter_types", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_types, METH_VARARGS|METH_KEYWORDS, 0},
{"filter_levels", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_levels, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_13_ListErrorLog_filter_levels},
{"filter_from_level", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_from_level, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_13_ListErrorLog_filter_from_level},
{"filter_from_fatals", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_from_fatals, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_13_ListErrorLog_filter_from_fatals},
{"filter_from_errors", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_from_errors, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_13_ListErrorLog_filter_from_errors},
{"filter_from_warnings", (PyCFunction)__pyx_f_5etree_13_ListErrorLog_filter_from_warnings, METH_VARARGS|METH_KEYWORDS, __pyx_doc_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*/
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*/
};

static PySequenceMethods __pyx_tp_as_sequence__ListErrorLog = {
__pyx_f_5etree_13_ListErrorLog___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5etree__ListErrorLog, /*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__ListErrorLog = {
__pyx_f_5etree_13_ListErrorLog___len__, /*mp_length*/
__pyx_f_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_5etree__ListErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ListErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ListErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__ListErrorLog, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__ListErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree__ListErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_13_ListErrorLog___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_13_ListErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ErrorLog __pyx_vtable_5etree__ErrorLog;

static PyObject *__pyx_tp_new_5etree__ErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ListErrorLog->tp_new(t, a, k);
struct __pyx_obj_5etree__ErrorLog *p = (struct __pyx_obj_5etree__ErrorLog *)o;
*(struct __pyx_vtabstruct_5etree__ErrorLog **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ErrorLog;
return o;
}

static void __pyx_tp_dealloc_5etree__ErrorLog(PyObject *o) {
__pyx_ptype_5etree__ListErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ListErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__ErrorLog(PyObject *o) {
__pyx_ptype_5etree__ListErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__ErrorLog[] = {
{"clear", (PyCFunction)__pyx_f_5etree_9_ErrorLog_clear, METH_VARARGS|METH_KEYWORDS, 0},
{"copy", (PyCFunction)__pyx_f_5etree_9_ErrorLog_copy, METH_VARARGS|METH_KEYWORDS, 0},
{"receive", (PyCFunction)__pyx_f_5etree_9_ErrorLog_receive, METH_VARARGS|METH_KEYWORDS, 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*/
};

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_5etree__ErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree__ErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_9_ErrorLog___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_9_ErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__DomainErrorLog __pyx_vtable_5etree__DomainErrorLog;

static PyObject *__pyx_tp_new_5etree__DomainErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ErrorLog->tp_new(t, a, k);
struct __pyx_obj_5etree__DomainErrorLog *p = (struct __pyx_obj_5etree__DomainErrorLog *)o;
*(struct __pyx_vtabstruct_5etree__DomainErrorLog **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__DomainErrorLog;
return o;
}

static void __pyx_tp_dealloc_5etree__DomainErrorLog(PyObject *o) {
__pyx_ptype_5etree__ErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__DomainErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__DomainErrorLog(PyObject *o) {
__pyx_ptype_5etree__ErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__DomainErrorLog[] = {
{"receive", (PyCFunction)__pyx_f_5etree_15_DomainErrorLog_receive, METH_VARARGS|METH_KEYWORDS, 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*/
};

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_5etree__DomainErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._DomainErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree__DomainErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__DomainErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree__DomainErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_15_DomainErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__RotatingErrorLog __pyx_vtable_5etree__RotatingErrorLog;

static PyObject *__pyx_tp_new_5etree__RotatingErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ErrorLog->tp_new(t, a, k);
struct __pyx_obj_5etree__RotatingErrorLog *p = (struct __pyx_obj_5etree__RotatingErrorLog *)o;
*(struct __pyx_vtabstruct_5etree__RotatingErrorLog **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__RotatingErrorLog;
return o;
}

static void __pyx_tp_dealloc_5etree__RotatingErrorLog(PyObject *o) {
__pyx_ptype_5etree__ErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__RotatingErrorLog(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ErrorLog->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__RotatingErrorLog(PyObject *o) {
__pyx_ptype_5etree__ErrorLog->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__RotatingErrorLog[] = {
{"receive", (PyCFunction)__pyx_f_5etree_17_RotatingErrorLog_receive, METH_VARARGS|METH_KEYWORDS, 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*/
};

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_5etree__RotatingErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._RotatingErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree__RotatingErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__RotatingErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree__RotatingErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_17_RotatingErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_PyErrorLog __pyx_vtable_5etree_PyErrorLog;

static PyObject *__pyx_tp_new_5etree_PyErrorLog(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseErrorLog->tp_new(t, a, k);
struct __pyx_obj_5etree_PyErrorLog *p = (struct __pyx_obj_5etree_PyErrorLog *)o;
*(struct __pyx_vtabstruct_5etree_PyErrorLog **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_PyErrorLog;
p->level_map = Py_None; Py_INCREF(Py_None);
p->_log = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_PyErrorLog(PyObject *o) {
struct __pyx_obj_5etree_PyErrorLog *p = (struct __pyx_obj_5etree_PyErrorLog *)o;
Py_XDECREF(p->level_map);
Py_XDECREF(p->_log);
__pyx_ptype_5etree__BaseErrorLog->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_PyErrorLog(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_PyErrorLog *p = (struct __pyx_obj_5etree_PyErrorLog *)o;
e = __pyx_ptype_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->_log) {
  e = (*v)(p->_log, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree_PyErrorLog(PyObject *o) {
struct __pyx_obj_5etree_PyErrorLog *p = (struct __pyx_obj_5etree_PyErrorLog *)o;
__pyx_ptype_5etree__BaseErrorLog->tp_clear(o);
Py_XDECREF(p->level_map);
p->level_map = 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_5etree_PyErrorLog[] = {
{"copy", (PyCFunction)__pyx_f_5etree_10PyErrorLog_copy, METH_VARARGS|METH_KEYWORDS, 0},
{"log", (PyCFunction)__pyx_f_5etree_10PyErrorLog_log, METH_VARARGS|METH_KEYWORDS, 0},
{"receive", (PyCFunction)__pyx_f_5etree_10PyErrorLog_receive, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_PyErrorLog[] = {
{"level_map", T_OBJECT, offsetof(struct __pyx_obj_5etree_PyErrorLog, level_map), 0, 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*/
};

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_5etree_PyErrorLog = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.PyErrorLog", /*tp_name*/
sizeof(struct __pyx_obj_5etree_PyErrorLog), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_PyErrorLog, /*tp_traverse*/
__pyx_tp_clear_5etree_PyErrorLog, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_PyErrorLog, /*tp_methods*/
__pyx_members_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_f_5etree_10PyErrorLog___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ElementBase(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__Element->tp_new(t, a, k);
return o;
}

static void __pyx_tp_dealloc_5etree_ElementBase(PyObject *o) {
__pyx_ptype_5etree__Element->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ElementBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__Element->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_ElementBase(PyObject *o) {
__pyx_ptype_5etree__Element->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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*/
"etree.ElementBase", /*tp_name*/
sizeof(struct LxmlElementBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_ElementBase, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree_CommentBase __pyx_vtable_5etree_CommentBase;

static PyObject *__pyx_tp_new_5etree_CommentBase(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__Comment->tp_new(t, a, k);
struct __pyx_obj_5etree_CommentBase *p = (struct __pyx_obj_5etree_CommentBase *)o;
*(struct __pyx_vtabstruct_5etree_CommentBase **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_CommentBase;
return o;
}

static void __pyx_tp_dealloc_5etree_CommentBase(PyObject *o) {
__pyx_ptype_5etree__Comment->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_CommentBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__Comment->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_CommentBase(PyObject *o) {
__pyx_ptype_5etree__Comment->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_CommentBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.CommentBase", /*tp_name*/
sizeof(struct __pyx_obj_5etree_CommentBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_CommentBase, /*tp_traverse*/
__pyx_tp_clear_5etree_CommentBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree_PIBase __pyx_vtable_5etree_PIBase;

static PyObject *__pyx_tp_new_5etree_PIBase(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ProcessingInstruction->tp_new(t, a, k);
struct __pyx_obj_5etree_PIBase *p = (struct __pyx_obj_5etree_PIBase *)o;
*(struct __pyx_vtabstruct_5etree_PIBase **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_PIBase;
return o;
}

static void __pyx_tp_dealloc_5etree_PIBase(PyObject *o) {
__pyx_ptype_5etree__ProcessingInstruction->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_PIBase(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__ProcessingInstruction->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_PIBase(PyObject *o) {
__pyx_ptype_5etree__ProcessingInstruction->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_PIBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.PIBase", /*tp_name*/
sizeof(struct __pyx_obj_5etree_PIBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_PIBase, /*tp_traverse*/
__pyx_tp_clear_5etree_PIBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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 PyObject *__pyx_tp_new_5etree_ElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
return o;
}

static void __pyx_tp_dealloc_5etree_ElementClassLookup(PyObject *o) {
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree_ElementClassLookup(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_5etree_ElementClassLookup(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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*/
"etree.ElementClassLookup", /*tp_name*/
sizeof(struct LxmlElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_ElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_18ElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_FallbackElementClassLookup __pyx_vtable_5etree_FallbackElementClassLookup;

static PyObject *__pyx_tp_new_5etree_FallbackElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_ElementClassLookup->tp_new(t, a, k);
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
*(struct __pyx_vtabstruct_5etree_FallbackElementClassLookup **)&p->__pyx_vtab = __pyx_vtabptr_5etree_FallbackElementClassLookup;
p->fallback = ((struct LxmlElementClassLookup *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_FallbackElementClassLookup(PyObject *o) {
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
Py_XDECREF(((PyObject *)p->fallback));
__pyx_ptype_5etree_ElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_FallbackElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
e = __pyx_ptype_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_5etree_FallbackElementClassLookup(PyObject *o) {
struct LxmlFallbackElementClassLookup *p = (struct LxmlFallbackElementClassLookup *)o;
__pyx_ptype_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_5etree_FallbackElementClassLookup[] = {
{"setFallback", (PyCFunction)__pyx_f_5etree_26FallbackElementClassLookup_setFallback, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_26FallbackElementClassLookup_setFallback},
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_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*/
};

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*/
"etree.FallbackElementClassLookup", /*tp_name*/
sizeof(struct LxmlFallbackElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_FallbackElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_FallbackElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_FallbackElementClassLookup, /*tp_methods*/
__pyx_members_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_f_5etree_26FallbackElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ElementDefaultClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_ElementClassLookup->tp_new(t, a, k);
struct __pyx_obj_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_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);
return o;
}

static void __pyx_tp_dealloc_5etree_ElementDefaultClassLookup(PyObject *o) {
struct __pyx_obj_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_5etree_ElementDefaultClassLookup *)o;
Py_XDECREF(p->element_class);
Py_XDECREF(p->comment_class);
Py_XDECREF(p->pi_class);
__pyx_ptype_5etree_ElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ElementDefaultClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_5etree_ElementDefaultClassLookup *)o;
e = __pyx_ptype_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;
}
return 0;
}

static int __pyx_tp_clear_5etree_ElementDefaultClassLookup(PyObject *o) {
struct __pyx_obj_5etree_ElementDefaultClassLookup *p = (struct __pyx_obj_5etree_ElementDefaultClassLookup *)o;
__pyx_ptype_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);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_ElementDefaultClassLookup[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_ElementDefaultClassLookup[] = {
{"element_class", T_OBJECT, offsetof(struct __pyx_obj_5etree_ElementDefaultClassLookup, element_class), READONLY, 0},
{"comment_class", T_OBJECT, offsetof(struct __pyx_obj_5etree_ElementDefaultClassLookup, comment_class), READONLY, 0},
{"pi_class", T_OBJECT, offsetof(struct __pyx_obj_5etree_ElementDefaultClassLookup, pi_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*/
};

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_5etree_ElementDefaultClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ElementDefaultClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ElementDefaultClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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    ", /*tp_doc*/
__pyx_tp_traverse_5etree_ElementDefaultClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementDefaultClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_ElementDefaultClassLookup, /*tp_methods*/
__pyx_members_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_f_5etree_25ElementDefaultClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ElementNamespaceClassLookup __pyx_vtable_5etree_ElementNamespaceClassLookup;

static PyObject *__pyx_tp_new_5etree_ElementNamespaceClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_FallbackElementClassLookup->tp_new(t, a, k);
struct __pyx_obj_5etree_ElementNamespaceClassLookup *p = (struct __pyx_obj_5etree_ElementNamespaceClassLookup *)o;
*(struct __pyx_vtabstruct_5etree_ElementNamespaceClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_ElementNamespaceClassLookup;
return o;
}

static void __pyx_tp_dealloc_5etree_ElementNamespaceClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ElementNamespaceClassLookup(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_ElementNamespaceClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_ElementNamespaceClassLookup[] = {
{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*/
};

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_5etree_ElementNamespaceClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ElementNamespaceClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ElementNamespaceClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_ElementNamespaceClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_ElementNamespaceClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_27ElementNamespaceClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_AttributeBasedElementClassLookup __pyx_vtable_5etree_AttributeBasedElementClassLookup;

static PyObject *__pyx_tp_new_5etree_AttributeBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_FallbackElementClassLookup->tp_new(t, a, k);
struct __pyx_obj_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)o;
*(struct __pyx_vtabstruct_5etree_AttributeBasedElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_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_5etree_AttributeBasedElementClassLookup(PyObject *o) {
struct __pyx_obj_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)o;
Py_XDECREF(p->_class_mapping);
Py_XDECREF(p->_pytag);
__pyx_ptype_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_AttributeBasedElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)o;
e = __pyx_ptype_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_5etree_AttributeBasedElementClassLookup(PyObject *o) {
struct __pyx_obj_5etree_AttributeBasedElementClassLookup *p = (struct __pyx_obj_5etree_AttributeBasedElementClassLookup *)o;
__pyx_ptype_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_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*/
};

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_5etree_AttributeBasedElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.AttributeBasedElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_5etree_AttributeBasedElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_AttributeBasedElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_AttributeBasedElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_32AttributeBasedElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ParserBasedElementClassLookup __pyx_vtable_5etree_ParserBasedElementClassLookup;

static PyObject *__pyx_tp_new_5etree_ParserBasedElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_FallbackElementClassLookup->tp_new(t, a, k);
struct __pyx_obj_5etree_ParserBasedElementClassLookup *p = (struct __pyx_obj_5etree_ParserBasedElementClassLookup *)o;
*(struct __pyx_vtabstruct_5etree_ParserBasedElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_ParserBasedElementClassLookup;
return o;
}

static void __pyx_tp_dealloc_5etree_ParserBasedElementClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ParserBasedElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_ParserBasedElementClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_ParserBasedElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ParserBasedElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ParserBasedElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_ParserBasedElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_ParserBasedElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_29ParserBasedElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_CustomElementClassLookup __pyx_vtable_5etree_CustomElementClassLookup;

static PyObject *__pyx_tp_new_5etree_CustomElementClassLookup(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_FallbackElementClassLookup->tp_new(t, a, k);
struct __pyx_obj_5etree_CustomElementClassLookup *p = (struct __pyx_obj_5etree_CustomElementClassLookup *)o;
*(struct __pyx_vtabstruct_5etree_CustomElementClassLookup **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_CustomElementClassLookup;
return o;
}

static void __pyx_tp_dealloc_5etree_CustomElementClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_CustomElementClassLookup(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_FallbackElementClassLookup->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_CustomElementClassLookup(PyObject *o) {
__pyx_ptype_5etree_FallbackElementClassLookup->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_CustomElementClassLookup[] = {
{"lookup", (PyCFunction)__pyx_f_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*/
};

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_5etree_CustomElementClassLookup = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.CustomElementClassLookup", /*tp_name*/
sizeof(struct __pyx_obj_5etree_CustomElementClassLookup), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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(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\'\n    * doc:       document that the node is in\n    * namespace: namespace URI of the node (or None for comments/PIs)\n    * name:      name of the element, 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_5etree_CustomElementClassLookup, /*tp_traverse*/
__pyx_tp_clear_5etree_CustomElementClassLookup, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_24CustomElementClassLookup___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__NamespaceRegistry __pyx_vtable_5etree__NamespaceRegistry;

static PyObject *__pyx_tp_new_5etree__NamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__NamespaceRegistry *p = (struct __pyx_obj_5etree__NamespaceRegistry *)o;
*(struct __pyx_vtabstruct_5etree__NamespaceRegistry **)&p->__pyx_vtab = __pyx_vtabptr_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_5etree__NamespaceRegistry(PyObject *o) {
struct __pyx_obj_5etree__NamespaceRegistry *p = (struct __pyx_obj_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_5etree__NamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__NamespaceRegistry *p = (struct __pyx_obj_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_5etree__NamespaceRegistry(PyObject *o) {
struct __pyx_obj_5etree__NamespaceRegistry *p = (struct __pyx_obj_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_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 struct PyMethodDef __pyx_methods_5etree__NamespaceRegistry[] = {
{"update", (PyCFunction)__pyx_f_5etree_18_NamespaceRegistry_update, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_18_NamespaceRegistry_update},
{"items", (PyCFunction)__pyx_f_5etree_18_NamespaceRegistry_items, METH_VARARGS|METH_KEYWORDS, 0},
{"iteritems", (PyCFunction)__pyx_f_5etree_18_NamespaceRegistry_iteritems, METH_VARARGS|METH_KEYWORDS, 0},
{"clear", (PyCFunction)__pyx_f_5etree_18_NamespaceRegistry_clear, METH_VARARGS|METH_KEYWORDS, 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*/
};

static PySequenceMethods __pyx_tp_as_sequence__NamespaceRegistry = {
0, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_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_f_5etree_18_NamespaceRegistry___getitem__, /*mp_subscript*/
0, /*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_5etree__NamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._NamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__NamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__NamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_5etree__NamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_18_NamespaceRegistry___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_18_NamespaceRegistry___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ClassNamespaceRegistry __pyx_vtable_5etree__ClassNamespaceRegistry;

static PyObject *__pyx_tp_new_5etree__ClassNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__NamespaceRegistry->tp_new(t, a, k);
struct __pyx_obj_5etree__ClassNamespaceRegistry *p = (struct __pyx_obj_5etree__ClassNamespaceRegistry *)o;
*(struct __pyx_vtabstruct_5etree__ClassNamespaceRegistry **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ClassNamespaceRegistry;
return o;
}

static void __pyx_tp_dealloc_5etree__ClassNamespaceRegistry(PyObject *o) {
__pyx_ptype_5etree__NamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ClassNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__NamespaceRegistry->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__ClassNamespaceRegistry(PyObject *o) {
__pyx_ptype_5etree__NamespaceRegistry->tp_clear(o);
return 0;
}

static int __pyx_mp_ass_subscript_5etree__ClassNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_f_5etree_23_ClassNamespaceRegistry___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_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_5etree__ClassNamespaceRegistry[] = {
{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*/
};

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_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_5etree__ClassNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ClassNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ClassNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__ClassNamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__ClassNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_5etree__ClassNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__FunctionNamespaceRegistry __pyx_vtable_5etree__FunctionNamespaceRegistry;

static PyObject *__pyx_tp_new_5etree__FunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__NamespaceRegistry->tp_new(t, a, k);
struct __pyx_obj_5etree__FunctionNamespaceRegistry *p = (struct __pyx_obj_5etree__FunctionNamespaceRegistry *)o;
*(struct __pyx_vtabstruct_5etree__FunctionNamespaceRegistry **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__FunctionNamespaceRegistry;
return o;
}

static void __pyx_tp_dealloc_5etree__FunctionNamespaceRegistry(PyObject *o) {
__pyx_ptype_5etree__NamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__FunctionNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__NamespaceRegistry->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__FunctionNamespaceRegistry(PyObject *o) {
__pyx_ptype_5etree__NamespaceRegistry->tp_clear(o);
return 0;
}

static int __pyx_mp_ass_subscript_5etree__FunctionNamespaceRegistry(PyObject *o, PyObject *i, PyObject *v) {
if (v) {
  return __pyx_f_5etree_26_FunctionNamespaceRegistry___setitem__(o, i, v);
}
else {
  if (__pyx_ptype_5etree__NamespaceRegistry->tp_as_mapping && __pyx_ptype_5etree__NamespaceRegistry->tp_as_mapping->mp_ass_subscript)
    return __pyx_ptype_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_5etree__FunctionNamespaceRegistry[] = {
{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*/
};

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_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_5etree__FunctionNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._FunctionNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__FunctionNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__FunctionNamespaceRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__FunctionNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_5etree__FunctionNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__XPathFunctionNamespaceRegistry __pyx_vtable_5etree__XPathFunctionNamespaceRegistry;

static PyObject *__pyx_tp_new_5etree__XPathFunctionNamespaceRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__FunctionNamespaceRegistry->tp_new(t, a, k);
struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)o;
*(struct __pyx_vtabstruct_5etree__XPathFunctionNamespaceRegistry **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_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_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)o;
Py_XDECREF(p->_prefix);
Py_XDECREF(p->_prefix_utf);
__pyx_ptype_5etree__FunctionNamespaceRegistry->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XPathFunctionNamespaceRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)o;
e = __pyx_ptype_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_5etree__XPathFunctionNamespaceRegistry(PyObject *o) {
struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *p = (struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry *)o;
__pyx_ptype_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_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, void *x) {
return __pyx_f_5etree_31_XPathFunctionNamespaceRegistry_6prefix___get__(o);
}

static int __pyx_setprop_5etree_31_XPathFunctionNamespaceRegistry_prefix(PyObject *o, PyObject *v, void *x) {
if (v) {
  return __pyx_f_5etree_31_XPathFunctionNamespaceRegistry_6prefix___set__(o, v);
}
else {
  return __pyx_f_5etree_31_XPathFunctionNamespaceRegistry_6prefix___del__(o);
}
}

static struct PyMethodDef __pyx_methods_5etree__XPathFunctionNamespaceRegistry[] = {
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__XPathFunctionNamespaceRegistry[] = {
{"prefix", __pyx_getprop_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_setprop_5etree_31_XPathFunctionNamespaceRegistry_prefix, __pyx_k9, 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*/
};

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_5etree__XPathFunctionNamespaceRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XPathFunctionNamespaceRegistry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XPathFunctionNamespaceRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XPathFunctionNamespaceRegistry, /*tp_traverse*/
__pyx_tp_clear_5etree__XPathFunctionNamespaceRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__XPathFunctionNamespaceRegistry, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__InputDocument(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__InputDocument *p = (struct __pyx_obj_5etree__InputDocument *)o;
p->_data_bytes = Py_None; Py_INCREF(Py_None);
p->_file = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__InputDocument(PyObject *o) {
struct __pyx_obj_5etree__InputDocument *p = (struct __pyx_obj_5etree__InputDocument *)o;
Py_XDECREF(p->_data_bytes);
Py_XDECREF(p->_file);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__InputDocument(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__InputDocument *p = (struct __pyx_obj_5etree__InputDocument *)o;
if (p->_data_bytes) {
  e = (*v)(p->_data_bytes, a); if (e) return e;
}
if (p->_file) {
  e = (*v)(p->_file, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__InputDocument(PyObject *o) {
struct __pyx_obj_5etree__InputDocument *p = (struct __pyx_obj_5etree__InputDocument *)o;
Py_XDECREF(p->_data_bytes);
p->_data_bytes = 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_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*/
};

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_5etree__InputDocument = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._InputDocument", /*tp_name*/
sizeof(struct __pyx_obj_5etree__InputDocument), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__InputDocument, /*tp_traverse*/
__pyx_tp_clear_5etree__InputDocument, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree_Resolver(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
return o;
}

static void __pyx_tp_dealloc_5etree_Resolver(PyObject *o) {
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree_Resolver(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_5etree_Resolver(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_Resolver[] = {
{"resolve", (PyCFunction)__pyx_f_5etree_8Resolver_resolve, METH_VARARGS|METH_KEYWORDS, 0},
{"resolve_empty", (PyCFunction)__pyx_f_5etree_8Resolver_resolve_empty, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8Resolver_resolve_empty},
{"resolve_string", (PyCFunction)__pyx_f_5etree_8Resolver_resolve_string, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8Resolver_resolve_string},
{"resolve_filename", (PyCFunction)__pyx_f_5etree_8Resolver_resolve_filename, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_8Resolver_resolve_filename},
{"resolve_file", (PyCFunction)__pyx_f_5etree_8Resolver_resolve_file, METH_VARARGS|METH_KEYWORDS, __pyx_doc_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*/
};

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_5etree_Resolver = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.Resolver", /*tp_name*/
sizeof(struct __pyx_obj_5etree_Resolver), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_Resolver, /*tp_traverse*/
__pyx_tp_clear_5etree_Resolver, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__ResolverRegistry __pyx_vtable_5etree__ResolverRegistry;

static PyObject *__pyx_tp_new_5etree__ResolverRegistry(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__ResolverRegistry *p = (struct __pyx_obj_5etree__ResolverRegistry *)o;
*(struct __pyx_vtabstruct_5etree__ResolverRegistry **)&p->__pyx_vtab = __pyx_vtabptr_5etree__ResolverRegistry;
p->_resolvers = Py_None; Py_INCREF(Py_None);
p->_default_resolver = ((struct __pyx_obj_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ResolverRegistry(PyObject *o) {
struct __pyx_obj_5etree__ResolverRegistry *p = (struct __pyx_obj_5etree__ResolverRegistry *)o;
Py_XDECREF(p->_resolvers);
Py_XDECREF(((PyObject *)p->_default_resolver));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__ResolverRegistry(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ResolverRegistry *p = (struct __pyx_obj_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_5etree__ResolverRegistry(PyObject *o) {
struct __pyx_obj_5etree__ResolverRegistry *p = (struct __pyx_obj_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_5etree_Resolver *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__ResolverRegistry[] = {
{"add", (PyCFunction)__pyx_f_5etree_17_ResolverRegistry_add, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_17_ResolverRegistry_add},
{"remove", (PyCFunction)__pyx_f_5etree_17_ResolverRegistry_remove, METH_VARARGS|METH_KEYWORDS, 0},
{"copy", (PyCFunction)__pyx_f_5etree_17_ResolverRegistry_copy, METH_VARARGS|METH_KEYWORDS, 0},
{"resolve", (PyCFunction)__pyx_f_5etree_17_ResolverRegistry_resolve, METH_VARARGS|METH_KEYWORDS, 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*/
};

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_5etree__ResolverRegistry = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ResolverRegistry", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ResolverRegistry), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__ResolverRegistry, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
__pyx_f_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_5etree__ResolverRegistry, /*tp_traverse*/
__pyx_tp_clear_5etree__ResolverRegistry, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_17_ResolverRegistry___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ResolverContext __pyx_vtable_5etree__ResolverContext;

static PyObject *__pyx_tp_new_5etree__ResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ExceptionContext->tp_new(t, a, k);
struct __pyx_obj_5etree__ResolverContext *p = (struct __pyx_obj_5etree__ResolverContext *)o;
*(struct __pyx_vtabstruct_5etree__ResolverContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__ResolverContext;
p->_resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
p->_storage = ((struct __pyx_obj_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ResolverContext(PyObject *o) {
struct __pyx_obj_5etree__ResolverContext *p = (struct __pyx_obj_5etree__ResolverContext *)o;
Py_XDECREF(((PyObject *)p->_resolvers));
Py_XDECREF(((PyObject *)p->_storage));
__pyx_ptype_5etree__ExceptionContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__ResolverContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ResolverContext *p = (struct __pyx_obj_5etree__ResolverContext *)o;
e = __pyx_ptype_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_5etree__ResolverContext(PyObject *o) {
struct __pyx_obj_5etree__ResolverContext *p = (struct __pyx_obj_5etree__ResolverContext *)o;
__pyx_ptype_5etree__ExceptionContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_resolvers));
p->_resolvers = ((struct __pyx_obj_5etree__ResolverRegistry *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_storage));
p->_storage = ((struct __pyx_obj_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__ResolverContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ResolverContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ResolverContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ResolverContext, /*tp_traverse*/
__pyx_tp_clear_5etree__ResolverContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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*/
__pyx_f_5etree_16_ResolverContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ParserContext __pyx_vtable_5etree__ParserContext;

static PyObject *__pyx_tp_new_5etree__ParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__ParserContext *p = (struct __pyx_obj_5etree__ParserContext *)o;
*(struct __pyx_vtabstruct_5etree__ParserContext **)&p->__pyx_vtab = __pyx_vtabptr_5etree__ParserContext;
p->_default_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ParserContext(PyObject *o) {
struct __pyx_obj_5etree__ParserContext *p = (struct __pyx_obj_5etree__ParserContext *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_14_ParserContext___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_5etree__ParserContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ParserContext *p = (struct __pyx_obj_5etree__ParserContext *)o;
if (p->_default_parser) {
  e = (*v)(((PyObject*)p->_default_parser), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__ParserContext(PyObject *o) {
struct __pyx_obj_5etree__ParserContext *p = (struct __pyx_obj_5etree__ParserContext *)o;
Py_XDECREF(((PyObject *)p->_default_parser));
p->_default_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__ParserContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ParserContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ParserContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ParserContext, /*tp_traverse*/
__pyx_tp_clear_5etree__ParserContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__FileParserContext __pyx_vtable_5etree__FileParserContext;

static PyObject *__pyx_tp_new_5etree__FileParserContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__FileParserContext *p = (struct __pyx_obj_5etree__FileParserContext *)o;
*(struct __pyx_vtabstruct_5etree__FileParserContext **)&p->__pyx_vtab = __pyx_vtabptr_5etree__FileParserContext;
p->_filelike = 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_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__FileParserContext(PyObject *o) {
struct __pyx_obj_5etree__FileParserContext *p = (struct __pyx_obj_5etree__FileParserContext *)o;
Py_XDECREF(p->_filelike);
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_5etree__FileParserContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__FileParserContext *p = (struct __pyx_obj_5etree__FileParserContext *)o;
if (p->_filelike) {
  e = (*v)(p->_filelike, 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_5etree__FileParserContext(PyObject *o) {
struct __pyx_obj_5etree__FileParserContext *p = (struct __pyx_obj_5etree__FileParserContext *)o;
Py_XDECREF(p->_filelike);
p->_filelike = 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_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__FileParserContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__FileParserContext = {
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*/
};

static PySequenceMethods __pyx_tp_as_sequence__FileParserContext = {
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__FileParserContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__FileParserContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_5etree__FileParserContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._FileParserContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__FileParserContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__FileParserContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__FileParserContext, /*tp_as_number*/
&__pyx_tp_as_sequence__FileParserContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__FileParserContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__FileParserContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5etree__FileParserContext, /*tp_traverse*/
__pyx_tp_clear_5etree__FileParserContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__FileParserContext, /*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_f_5etree_18_FileParserContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5etree__FileParserContext, /*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_5etree_XMLParser __pyx_vtable_5etree_XMLParser;

static PyObject *__pyx_tp_new_5etree_XMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseParser->tp_new(t, a, k);
struct __pyx_obj_5etree_XMLParser *p = (struct __pyx_obj_5etree_XMLParser *)o;
*(struct __pyx_vtabstruct_5etree_XMLParser **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_XMLParser;
return o;
}

static void __pyx_tp_dealloc_5etree_XMLParser(PyObject *o) {
__pyx_ptype_5etree__BaseParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_XMLParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__BaseParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_XMLParser(PyObject *o) {
__pyx_ptype_5etree__BaseParser->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_XMLParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XMLParser", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XMLParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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\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\n    For read-only documents that will not be altered after parsing, you can\n    also pass the following keyword arguments:\n    * compact            - compactly store short element text content\n\n    Note that you should avoid sharing parsers between threads.  This does not\n    apply to the default parser.\n\n    You must not modify documents that were parsed with the \'compact\' option.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_XMLParser, /*tp_traverse*/
__pyx_tp_clear_5etree_XMLParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_9XMLParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_HTMLParser __pyx_vtable_5etree_HTMLParser;

static PyObject *__pyx_tp_new_5etree_HTMLParser(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseParser->tp_new(t, a, k);
struct __pyx_obj_5etree_HTMLParser *p = (struct __pyx_obj_5etree_HTMLParser *)o;
*(struct __pyx_vtabstruct_5etree_HTMLParser **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_HTMLParser;
return o;
}

static void __pyx_tp_dealloc_5etree_HTMLParser(PyObject *o) {
__pyx_ptype_5etree__BaseParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_HTMLParser(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__BaseParser->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_HTMLParser(PyObject *o) {
__pyx_ptype_5etree__BaseParser->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_HTMLParser = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.HTMLParser", /*tp_name*/
sizeof(struct __pyx_obj_5etree_HTMLParser), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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\n    * remove_blank_text  - discard empty text nodes\n\n    For read-only documents that will not be altered after parsing, you can\n    also pass the following keyword arguments:\n    * compact            - compactly store short element text content\n\n    Note that you should avoid sharing parsers between threads.  You must not\n    modify documents that were parsed with the \'compact\' option.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_HTMLParser, /*tp_traverse*/
__pyx_tp_clear_5etree_HTMLParser, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_10HTMLParser___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__FilelikeWriter __pyx_vtable_5etree__FilelikeWriter;

static PyObject *__pyx_tp_new_5etree__FilelikeWriter(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__FilelikeWriter *p = (struct __pyx_obj_5etree__FilelikeWriter *)o;
*(struct __pyx_vtabstruct_5etree__FilelikeWriter **)&p->__pyx_vtab = __pyx_vtabptr_5etree__FilelikeWriter;
p->_filelike = Py_None; Py_INCREF(Py_None);
p->_exc_context = ((struct __pyx_obj_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
p->error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__FilelikeWriter(PyObject *o) {
struct __pyx_obj_5etree__FilelikeWriter *p = (struct __pyx_obj_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_5etree__FilelikeWriter(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__FilelikeWriter *p = (struct __pyx_obj_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_5etree__FilelikeWriter(PyObject *o) {
struct __pyx_obj_5etree__FilelikeWriter *p = (struct __pyx_obj_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_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->error_log));
p->error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__FilelikeWriter = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._FilelikeWriter", /*tp_name*/
sizeof(struct __pyx_obj_5etree__FilelikeWriter), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__FilelikeWriter, /*tp_traverse*/
__pyx_tp_clear_5etree__FilelikeWriter, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_15_FilelikeWriter___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__IterparseResolverContext __pyx_vtable_5etree__IterparseResolverContext;

static PyObject *__pyx_tp_new_5etree__IterparseResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ResolverContext->tp_new(t, a, k);
struct __pyx_obj_5etree__IterparseResolverContext *p = (struct __pyx_obj_5etree__IterparseResolverContext *)o;
*(struct __pyx_vtabstruct_5etree__IterparseResolverContext **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__IterparseResolverContext;
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_5etree__IterparseResolverContext(PyObject *o) {
struct __pyx_obj_5etree__IterparseResolverContext *p = (struct __pyx_obj_5etree__IterparseResolverContext *)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_5etree__ResolverContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__IterparseResolverContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__IterparseResolverContext *p = (struct __pyx_obj_5etree__IterparseResolverContext *)o;
e = __pyx_ptype_5etree__ResolverContext->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_5etree__IterparseResolverContext(PyObject *o) {
struct __pyx_obj_5etree__IterparseResolverContext *p = (struct __pyx_obj_5etree__IterparseResolverContext *)o;
__pyx_ptype_5etree__ResolverContext->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_5etree__IterparseResolverContext[] = {
{0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number__IterparseResolverContext = {
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*/
};

static PySequenceMethods __pyx_tp_as_sequence__IterparseResolverContext = {
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__IterparseResolverContext = {
0, /*mp_length*/
0, /*mp_subscript*/
0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer__IterparseResolverContext = {
0, /*bf_getreadbuffer*/
0, /*bf_getwritebuffer*/
0, /*bf_getsegcount*/
0, /*bf_getcharbuffer*/
};

PyTypeObject __pyx_type_5etree__IterparseResolverContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._IterparseResolverContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__IterparseResolverContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__IterparseResolverContext, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*tp_repr*/
&__pyx_tp_as_number__IterparseResolverContext, /*tp_as_number*/
&__pyx_tp_as_sequence__IterparseResolverContext, /*tp_as_sequence*/
&__pyx_tp_as_mapping__IterparseResolverContext, /*tp_as_mapping*/
0, /*tp_hash*/
0, /*tp_call*/
0, /*tp_str*/
0, /*tp_getattro*/
0, /*tp_setattro*/
&__pyx_tp_as_buffer__IterparseResolverContext, /*tp_as_buffer*/
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
0, /*tp_doc*/
__pyx_tp_traverse_5etree__IterparseResolverContext, /*tp_traverse*/
__pyx_tp_clear_5etree__IterparseResolverContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__IterparseResolverContext, /*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_f_5etree_25_IterparseResolverContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_5etree__IterparseResolverContext, /*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_5etree_iterparse __pyx_vtable_5etree_iterparse;

static PyObject *__pyx_tp_new_5etree_iterparse(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseParser->tp_new(t, a, k);
struct __pyx_obj_5etree_iterparse *p = (struct __pyx_obj_5etree_iterparse *)o;
*(struct __pyx_vtabstruct_5etree_iterparse **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_iterparse;
p->_source = Py_None; Py_INCREF(Py_None);
p->_filename = Py_None; Py_INCREF(Py_None);
p->root = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_iterparse(PyObject *o) {
struct __pyx_obj_5etree_iterparse *p = (struct __pyx_obj_5etree_iterparse *)o;
Py_XDECREF(p->_source);
Py_XDECREF(p->_filename);
Py_XDECREF(p->root);
__pyx_ptype_5etree__BaseParser->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_iterparse(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_iterparse *p = (struct __pyx_obj_5etree_iterparse *)o;
e = __pyx_ptype_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->_filename) {
  e = (*v)(p->_filename, a); if (e) return e;
}
if (p->root) {
  e = (*v)(p->root, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree_iterparse(PyObject *o) {
struct __pyx_obj_5etree_iterparse *p = (struct __pyx_obj_5etree_iterparse *)o;
__pyx_ptype_5etree__BaseParser->tp_clear(o);
Py_XDECREF(p->_source);
p->_source = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_filename);
p->_filename = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->root);
p->root = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_iterparse[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_iterparse[] = {
{"root", T_OBJECT, offsetof(struct __pyx_obj_5etree_iterparse, root), READONLY, 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*/
};

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_5etree_iterparse = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.iterparse", /*tp_name*/
sizeof(struct __pyx_obj_5etree_iterparse), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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\n    * remove_blank_text  - discard blank text nodes\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_iterparse, /*tp_traverse*/
__pyx_tp_clear_5etree_iterparse, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_9iterparse___iter__, /*tp_iter*/
__pyx_f_5etree_9iterparse___next__, /*tp_iternext*/
__pyx_methods_5etree_iterparse, /*tp_methods*/
__pyx_members_5etree_iterparse, /*tp_members*/
0, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_f_5etree_9iterparse___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_iterwalk __pyx_vtable_5etree_iterwalk;

static PyObject *__pyx_tp_new_5etree_iterwalk(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree_iterwalk *p = (struct __pyx_obj_5etree_iterwalk *)o;
*(struct __pyx_vtabstruct_5etree_iterwalk **)&p->__pyx_vtab = __pyx_vtabptr_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_5etree_iterwalk(PyObject *o) {
struct __pyx_obj_5etree_iterwalk *p = (struct __pyx_obj_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_5etree_iterwalk(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_iterwalk *p = (struct __pyx_obj_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_5etree_iterwalk(PyObject *o) {
struct __pyx_obj_5etree_iterwalk *p = (struct __pyx_obj_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_5etree_iterwalk[] = {
{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*/
};

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_5etree_iterwalk = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.iterwalk", /*tp_name*/
sizeof(struct __pyx_obj_5etree_iterwalk), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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 ``iterparse()`` events from an existing\n    tree as if it was parsing XML data.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_iterwalk, /*tp_traverse*/
__pyx_tp_clear_5etree_iterwalk, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_8iterwalk___iter__, /*tp_iter*/
__pyx_f_5etree_8iterwalk___next__, /*tp_iternext*/
__pyx_methods_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_f_5etree_8iterwalk___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__IDDict __pyx_vtable_5etree__IDDict;

static PyObject *__pyx_tp_new_5etree__IDDict(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__IDDict *p = (struct __pyx_obj_5etree__IDDict *)o;
*(struct __pyx_vtabstruct_5etree__IDDict **)&p->__pyx_vtab = __pyx_vtabptr_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_5etree__IDDict(PyObject *o) {
struct __pyx_obj_5etree__IDDict *p = (struct __pyx_obj_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_5etree__IDDict(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__IDDict *p = (struct __pyx_obj_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_5etree__IDDict(PyObject *o) {
struct __pyx_obj_5etree__IDDict *p = (struct __pyx_obj_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_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_5etree__IDDict[] = {
{"copy", (PyCFunction)__pyx_f_5etree_7_IDDict_copy, METH_VARARGS|METH_KEYWORDS, 0},
{"get", (PyCFunction)__pyx_f_5etree_7_IDDict_get, METH_VARARGS|METH_KEYWORDS, 0},
{"has_key", (PyCFunction)__pyx_f_5etree_7_IDDict_has_key, METH_VARARGS|METH_KEYWORDS, 0},
{"keys", (PyCFunction)__pyx_f_5etree_7_IDDict_keys, METH_VARARGS|METH_KEYWORDS, 0},
{"iterkeys", (PyCFunction)__pyx_f_5etree_7_IDDict_iterkeys, METH_VARARGS|METH_KEYWORDS, 0},
{"items", (PyCFunction)__pyx_f_5etree_7_IDDict_items, METH_VARARGS|METH_KEYWORDS, 0},
{"iteritems", (PyCFunction)__pyx_f_5etree_7_IDDict_iteritems, METH_VARARGS|METH_KEYWORDS, 0},
{"values", (PyCFunction)__pyx_f_5etree_7_IDDict_values, METH_VARARGS|METH_KEYWORDS, 0},
{"itervalues", (PyCFunction)__pyx_f_5etree_7_IDDict_itervalues, METH_VARARGS|METH_KEYWORDS, 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*/
};

static PySequenceMethods __pyx_tp_as_sequence__IDDict = {
__pyx_f_5etree_7_IDDict___len__, /*sq_length*/
0, /*sq_concat*/
0, /*sq_repeat*/
__pyx_sq_item_5etree__IDDict, /*sq_item*/
0, /*sq_slice*/
0, /*sq_ass_item*/
0, /*sq_ass_slice*/
__pyx_f_5etree_7_IDDict___contains__, /*sq_contains*/
0, /*sq_inplace_concat*/
0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping__IDDict = {
__pyx_f_5etree_7_IDDict___len__, /*mp_length*/
__pyx_f_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_5etree__IDDict = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._IDDict", /*tp_name*/
sizeof(struct __pyx_obj_5etree__IDDict), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree__IDDict, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
__pyx_f_5etree_7_IDDict___cmp__, /*tp_compare*/
__pyx_f_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_5etree__IDDict, /*tp_traverse*/
__pyx_tp_clear_5etree__IDDict, /*tp_clear*/
__pyx_f_5etree_7_IDDict___richcmp__, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
__pyx_f_5etree_7_IDDict___iter__, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_7_IDDict___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__BaseContext __pyx_vtable_5etree__BaseContext;

static PyObject *__pyx_tp_new_5etree__BaseContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__BaseContext *p = (struct __pyx_obj_5etree__BaseContext *)o;
*(struct __pyx_vtabstruct_5etree__BaseContext **)&p->__pyx_vtab = __pyx_vtabptr_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->_utf_refs = Py_None; Py_INCREF(Py_None);
p->_function_cache = Py_None; Py_INCREF(Py_None);
p->_function_cache_ns = Py_None; Py_INCREF(Py_None);
p->_called_function = Py_None; Py_INCREF(Py_None);
p->_temp_refs = ((struct __pyx_obj_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
p->_exc = ((struct __pyx_obj_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__BaseContext(PyObject *o) {
struct __pyx_obj_5etree__BaseContext *p = (struct __pyx_obj_5etree__BaseContext *)o;
Py_XDECREF(((PyObject *)p->_doc));
Py_XDECREF(p->_extensions);
Py_XDECREF(p->_namespaces);
Py_XDECREF(p->_utf_refs);
Py_XDECREF(p->_function_cache);
Py_XDECREF(p->_function_cache_ns);
Py_XDECREF(p->_called_function);
Py_XDECREF(((PyObject *)p->_temp_refs));
Py_XDECREF(((PyObject *)p->_exc));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__BaseContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__BaseContext *p = (struct __pyx_obj_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->_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->_function_cache_ns) {
  e = (*v)(p->_function_cache_ns, a); if (e) return e;
}
if (p->_called_function) {
  e = (*v)(p->_called_function, 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_5etree__BaseContext(PyObject *o) {
struct __pyx_obj_5etree__BaseContext *p = (struct __pyx_obj_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->_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->_function_cache_ns);
p->_function_cache_ns = Py_None; Py_INCREF(Py_None);
Py_XDECREF(p->_called_function);
p->_called_function = Py_None; Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_temp_refs));
p->_temp_refs = ((struct __pyx_obj_5etree__TempStore *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_exc));
p->_exc = ((struct __pyx_obj_5etree__ExceptionContext *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__BaseContext[] = {
{"addNamespace", (PyCFunction)__pyx_f_5etree_12_BaseContext_addNamespace, METH_VARARGS|METH_KEYWORDS, 0},
{"registerNamespaces", (PyCFunction)__pyx_f_5etree_12_BaseContext_registerNamespaces, METH_VARARGS|METH_KEYWORDS, 0},
{"registerNamespace", (PyCFunction)__pyx_f_5etree_12_BaseContext_registerNamespace, METH_VARARGS|METH_KEYWORDS, 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*/
};

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_5etree__BaseContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._BaseContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__BaseContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__BaseContext, /*tp_traverse*/
__pyx_tp_clear_5etree__BaseContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__BaseContext, /*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_f_5etree_12_BaseContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__XPathContext __pyx_vtable_5etree__XPathContext;

static PyObject *__pyx_tp_new_5etree__XPathContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseContext->tp_new(t, a, k);
struct __pyx_obj_5etree__XPathContext *p = (struct __pyx_obj_5etree__XPathContext *)o;
*(struct __pyx_vtabstruct_5etree__XPathContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__XPathContext;
p->_variables = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__XPathContext(PyObject *o) {
struct __pyx_obj_5etree__XPathContext *p = (struct __pyx_obj_5etree__XPathContext *)o;
Py_XDECREF(p->_variables);
__pyx_ptype_5etree__BaseContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XPathContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__XPathContext *p = (struct __pyx_obj_5etree__XPathContext *)o;
e = __pyx_ptype_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_5etree__XPathContext(PyObject *o) {
struct __pyx_obj_5etree__XPathContext *p = (struct __pyx_obj_5etree__XPathContext *)o;
__pyx_ptype_5etree__BaseContext->tp_clear(o);
Py_XDECREF(p->_variables);
p->_variables = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__XPathContext[] = {
{"registerVariables", (PyCFunction)__pyx_f_5etree_13_XPathContext_registerVariables, METH_VARARGS|METH_KEYWORDS, 0},
{"registerVariable", (PyCFunction)__pyx_f_5etree_13_XPathContext_registerVariable, METH_VARARGS|METH_KEYWORDS, 0},
{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*/
};

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_5etree__XPathContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XPathContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XPathContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XPathContext, /*tp_traverse*/
__pyx_tp_clear_5etree__XPathContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_13_XPathContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__XPathEvaluatorBase __pyx_vtable_5etree__XPathEvaluatorBase;

static PyObject *__pyx_tp_new_5etree__XPathEvaluatorBase(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_5etree__XPathEvaluatorBase *)o;
*(struct __pyx_vtabstruct_5etree__XPathEvaluatorBase **)&p->__pyx_vtab = __pyx_vtabptr_5etree__XPathEvaluatorBase;
p->_context = ((struct __pyx_obj_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__XPathEvaluatorBase(PyObject *o) {
struct __pyx_obj_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_5etree__XPathEvaluatorBase *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_19_XPathEvaluatorBase___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(((PyObject *)p->_context));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__XPathEvaluatorBase(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_5etree__XPathEvaluatorBase *)o;
if (p->_context) {
  e = (*v)(((PyObject*)p->_context), a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__XPathEvaluatorBase(PyObject *o) {
struct __pyx_obj_5etree__XPathEvaluatorBase *p = (struct __pyx_obj_5etree__XPathEvaluatorBase *)o;
Py_XDECREF(((PyObject *)p->_context));
p->_context = ((struct __pyx_obj_5etree__XPathContext *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__XPathEvaluatorBase[] = {
{"evaluate", (PyCFunction)__pyx_f_5etree_19_XPathEvaluatorBase_evaluate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_19_XPathEvaluatorBase_evaluate},
{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*/
};

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_5etree__XPathEvaluatorBase = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XPathEvaluatorBase", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XPathEvaluatorBase), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XPathEvaluatorBase, /*tp_traverse*/
__pyx_tp_clear_5etree__XPathEvaluatorBase, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__XPathEvaluatorBase, /*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_f_5etree_19_XPathEvaluatorBase___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_XPathElementEvaluator __pyx_vtable_5etree_XPathElementEvaluator;

static PyObject *__pyx_tp_new_5etree_XPathElementEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__XPathEvaluatorBase->tp_new(t, a, k);
struct __pyx_obj_5etree_XPathElementEvaluator *p = (struct __pyx_obj_5etree_XPathElementEvaluator *)o;
*(struct __pyx_vtabstruct_5etree_XPathElementEvaluator **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_XPathElementEvaluator;
p->_element = ((struct LxmlElement *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_XPathElementEvaluator(PyObject *o) {
struct __pyx_obj_5etree_XPathElementEvaluator *p = (struct __pyx_obj_5etree_XPathElementEvaluator *)o;
Py_XDECREF(((PyObject *)p->_element));
__pyx_ptype_5etree__XPathEvaluatorBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_XPathElementEvaluator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_XPathElementEvaluator *p = (struct __pyx_obj_5etree_XPathElementEvaluator *)o;
e = __pyx_ptype_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_5etree_XPathElementEvaluator(PyObject *o) {
struct __pyx_obj_5etree_XPathElementEvaluator *p = (struct __pyx_obj_5etree_XPathElementEvaluator *)o;
__pyx_ptype_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_5etree_XPathElementEvaluator[] = {
{"registerNamespace", (PyCFunction)__pyx_f_5etree_21XPathElementEvaluator_registerNamespace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_21XPathElementEvaluator_registerNamespace},
{"registerNamespaces", (PyCFunction)__pyx_f_5etree_21XPathElementEvaluator_registerNamespaces, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_21XPathElementEvaluator_registerNamespaces},
{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*/
};

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_5etree_XPathElementEvaluator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XPathElementEvaluator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XPathElementEvaluator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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    XPath evaluators must not be shared between threads.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_XPathElementEvaluator, /*tp_traverse*/
__pyx_tp_clear_5etree_XPathElementEvaluator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_21XPathElementEvaluator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_XPathDocumentEvaluator __pyx_vtable_5etree_XPathDocumentEvaluator;

static PyObject *__pyx_tp_new_5etree_XPathDocumentEvaluator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_XPathElementEvaluator->tp_new(t, a, k);
struct __pyx_obj_5etree_XPathDocumentEvaluator *p = (struct __pyx_obj_5etree_XPathDocumentEvaluator *)o;
*(struct __pyx_vtabstruct_5etree_XPathDocumentEvaluator **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_XPathDocumentEvaluator;
return o;
}

static void __pyx_tp_dealloc_5etree_XPathDocumentEvaluator(PyObject *o) {
__pyx_ptype_5etree_XPathElementEvaluator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_XPathDocumentEvaluator(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_XPathElementEvaluator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_XPathDocumentEvaluator(PyObject *o) {
__pyx_ptype_5etree_XPathElementEvaluator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_XPathDocumentEvaluator[] = {
{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*/
};

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_5etree_XPathDocumentEvaluator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XPathDocumentEvaluator", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XPathDocumentEvaluator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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    XPath evaluators must not be shared between threads.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_XPathDocumentEvaluator, /*tp_traverse*/
__pyx_tp_clear_5etree_XPathDocumentEvaluator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_22XPathDocumentEvaluator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_XPath __pyx_vtable_5etree_XPath;

static PyObject *__pyx_tp_new_5etree_XPath(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__XPathEvaluatorBase->tp_new(t, a, k);
struct __pyx_obj_5etree_XPath *p = (struct __pyx_obj_5etree_XPath *)o;
*(struct __pyx_vtabstruct_5etree_XPath **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_XPath;
p->path = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_XPath(PyObject *o) {
struct __pyx_obj_5etree_XPath *p = (struct __pyx_obj_5etree_XPath *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_5XPath___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
Py_XDECREF(p->path);
__pyx_ptype_5etree__XPathEvaluatorBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_XPath(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_XPath *p = (struct __pyx_obj_5etree_XPath *)o;
e = __pyx_ptype_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_5etree_XPath(PyObject *o) {
struct __pyx_obj_5etree_XPath *p = (struct __pyx_obj_5etree_XPath *)o;
__pyx_ptype_5etree__XPathEvaluatorBase->tp_clear(o);
Py_XDECREF(p->path);
p->path = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_XPath[] = {
{0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_5etree_XPath[] = {
{"path", T_OBJECT, offsetof(struct __pyx_obj_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*/
};

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_5etree_XPath = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XPath", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XPath), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_5etree_XPath, /*tp_dealloc*/
0, /*tp_print*/
0, /*tp_getattr*/
0, /*tp_setattr*/
0, /*tp_compare*/
0, /*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_f_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 namespace mappings and\n    extensions to the constructor through the keyword arguments ``namespaces``\n    and ``extensions``.\n    ", /*tp_doc*/
__pyx_tp_traverse_5etree_XPath, /*tp_traverse*/
__pyx_tp_clear_5etree_XPath, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_XPath, /*tp_methods*/
__pyx_members_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_f_5etree_5XPath___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_ETXPath __pyx_vtable_5etree_ETXPath;

static PyObject *__pyx_tp_new_5etree_ETXPath(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_XPath->tp_new(t, a, k);
struct __pyx_obj_5etree_ETXPath *p = (struct __pyx_obj_5etree_ETXPath *)o;
*(struct __pyx_vtabstruct_5etree_ETXPath **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree_ETXPath;
return o;
}

static void __pyx_tp_dealloc_5etree_ETXPath(PyObject *o) {
__pyx_ptype_5etree_XPath->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_ETXPath(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_XPath->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_ETXPath(PyObject *o) {
__pyx_ptype_5etree_XPath->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_ETXPath = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.ETXPath", /*tp_name*/
sizeof(struct __pyx_obj_5etree_ETXPath), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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.", /*tp_doc*/
__pyx_tp_traverse_5etree_ETXPath, /*tp_traverse*/
__pyx_tp_clear_5etree_ETXPath, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_7ETXPath___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__XSLTResolverContext __pyx_vtable_5etree__XSLTResolverContext;

static PyObject *__pyx_tp_new_5etree__XSLTResolverContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ResolverContext->tp_new(t, a, k);
struct __pyx_obj_5etree__XSLTResolverContext *p = (struct __pyx_obj_5etree__XSLTResolverContext *)o;
*(struct __pyx_vtabstruct_5etree__XSLTResolverContext **)&p->__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__XSLTResolverContext;
p->_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__XSLTResolverContext(PyObject *o) {
struct __pyx_obj_5etree__XSLTResolverContext *p = (struct __pyx_obj_5etree__XSLTResolverContext *)o;
Py_XDECREF(((PyObject *)p->_parser));
__pyx_ptype_5etree__ResolverContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XSLTResolverContext(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__XSLTResolverContext *p = (struct __pyx_obj_5etree__XSLTResolverContext *)o;
e = __pyx_ptype_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_5etree__XSLTResolverContext(PyObject *o) {
struct __pyx_obj_5etree__XSLTResolverContext *p = (struct __pyx_obj_5etree__XSLTResolverContext *)o;
__pyx_ptype_5etree__ResolverContext->tp_clear(o);
Py_XDECREF(((PyObject *)p->_parser));
p->_parser = ((struct __pyx_obj_5etree__BaseParser *)Py_None); Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__XSLTResolverContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XSLTResolverContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XSLTResolverContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XSLTResolverContext, /*tp_traverse*/
__pyx_tp_clear_5etree__XSLTResolverContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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*/
__pyx_f_5etree_20_XSLTResolverContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_XSLTAccessControl __pyx_vtable_5etree_XSLTAccessControl;

static PyObject *__pyx_tp_new_5etree_XSLTAccessControl(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree_XSLTAccessControl *p = (struct __pyx_obj_5etree_XSLTAccessControl *)o;
*(struct __pyx_vtabstruct_5etree_XSLTAccessControl **)&p->__pyx_vtab = __pyx_vtabptr_5etree_XSLTAccessControl;
return o;
}

static void __pyx_tp_dealloc_5etree_XSLTAccessControl(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_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_5etree_XSLTAccessControl(PyObject *o, visitproc v, void *a) {
return 0;
}

static int __pyx_tp_clear_5etree_XSLTAccessControl(PyObject *o) {
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree_XSLTAccessControl = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XSLTAccessControl", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XSLTAccessControl), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree_XSLTAccessControl, /*tp_traverse*/
__pyx_tp_clear_5etree_XSLTAccessControl, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_17XSLTAccessControl___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__XSLTContext __pyx_vtable_5etree__XSLTContext;

static PyObject *__pyx_tp_new_5etree__XSLTContext(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__BaseContext->tp_new(t, a, k);
struct __pyx_obj_5etree__XSLTContext *p = (struct __pyx_obj_5etree__XSLTContext *)o;
*(struct __pyx_vtabstruct_5etree__XSLTContext **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__XSLTContext;
return o;
}

static void __pyx_tp_dealloc_5etree__XSLTContext(PyObject *o) {
__pyx_ptype_5etree__BaseContext->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XSLTContext(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__BaseContext->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__XSLTContext(PyObject *o) {
__pyx_ptype_5etree__BaseContext->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_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*/
};

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_5etree__XSLTContext = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XSLTContext", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XSLTContext), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XSLTContext, /*tp_traverse*/
__pyx_tp_clear_5etree__XSLTContext, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_12_XSLTContext___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__ExsltRegExp __pyx_vtable_5etree__ExsltRegExp;

static PyObject *__pyx_tp_new_5etree__ExsltRegExp(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__ExsltRegExp *p = (struct __pyx_obj_5etree__ExsltRegExp *)o;
*(struct __pyx_vtabstruct_5etree__ExsltRegExp **)&p->__pyx_vtab = __pyx_vtabptr_5etree__ExsltRegExp;
p->_compile_map = Py_None; Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__ExsltRegExp(PyObject *o) {
struct __pyx_obj_5etree__ExsltRegExp *p = (struct __pyx_obj_5etree__ExsltRegExp *)o;
Py_XDECREF(p->_compile_map);
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__ExsltRegExp(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__ExsltRegExp *p = (struct __pyx_obj_5etree__ExsltRegExp *)o;
if (p->_compile_map) {
  e = (*v)(p->_compile_map, a); if (e) return e;
}
return 0;
}

static int __pyx_tp_clear_5etree__ExsltRegExp(PyObject *o) {
struct __pyx_obj_5etree__ExsltRegExp *p = (struct __pyx_obj_5etree__ExsltRegExp *)o;
Py_XDECREF(p->_compile_map);
p->_compile_map = Py_None; Py_INCREF(Py_None);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__ExsltRegExp[] = {
{"test", (PyCFunction)__pyx_f_5etree_12_ExsltRegExp_test, METH_VARARGS|METH_KEYWORDS, 0},
{"match", (PyCFunction)__pyx_f_5etree_12_ExsltRegExp_match, METH_VARARGS|METH_KEYWORDS, 0},
{"replace", (PyCFunction)__pyx_f_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*/
};

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_5etree__ExsltRegExp = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._ExsltRegExp", /*tp_name*/
sizeof(struct __pyx_obj_5etree__ExsltRegExp), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__ExsltRegExp, /*tp_traverse*/
__pyx_tp_clear_5etree__ExsltRegExp, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_12_ExsltRegExp___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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 PyObject *__pyx_tp_new_5etree_XSLT(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree_XSLT *p = (struct __pyx_obj_5etree_XSLT *)o;
p->_context = ((struct __pyx_obj_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
p->_xslt_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
p->_access_control = ((struct __pyx_obj_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
p->_regexp = ((struct __pyx_obj_5etree__ExsltRegExp *)Py_None); Py_INCREF(Py_None);
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree_XSLT(PyObject *o) {
struct __pyx_obj_5etree_XSLT *p = (struct __pyx_obj_5etree_XSLT *)o;
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_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->_regexp));
Py_XDECREF(((PyObject *)p->_error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree_XSLT(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree_XSLT *p = (struct __pyx_obj_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->_regexp) {
  e = (*v)(((PyObject*)p->_regexp), 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_5etree_XSLT(PyObject *o) {
struct __pyx_obj_5etree_XSLT *p = (struct __pyx_obj_5etree_XSLT *)o;
Py_XDECREF(((PyObject *)p->_context));
p->_context = ((struct __pyx_obj_5etree__XSLTContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_xslt_resolver_context));
p->_xslt_resolver_context = ((struct __pyx_obj_5etree__XSLTResolverContext *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_access_control));
p->_access_control = ((struct __pyx_obj_5etree_XSLTAccessControl *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_regexp));
p->_regexp = ((struct __pyx_obj_5etree__ExsltRegExp *)Py_None); Py_INCREF(Py_None);
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_5etree_4XSLT_error_log(PyObject *o, void *x) {
return __pyx_f_5etree_4XSLT_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree_XSLT[] = {
{"apply", (PyCFunction)__pyx_f_5etree_4XSLT_apply, METH_VARARGS|METH_KEYWORDS, 0},
{"tostring", (PyCFunction)__pyx_f_5etree_4XSLT_tostring, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_4XSLT_tostring},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree_XSLT[] = {
{"error_log", __pyx_getprop_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*/
};

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_5etree_XSLT = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XSLT", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XSLT), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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    ", /*tp_doc*/
__pyx_tp_traverse_5etree_XSLT, /*tp_traverse*/
__pyx_tp_clear_5etree_XSLT, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree_XSLT, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5etree_XSLT, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_f_5etree_4XSLT___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree__XSLTResultTree __pyx_vtable_5etree__XSLTResultTree;

static PyObject *__pyx_tp_new_5etree__XSLTResultTree(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__ElementTree->tp_new(t, a, k);
struct __pyx_obj_5etree__XSLTResultTree *p = (struct __pyx_obj_5etree__XSLTResultTree *)o;
*(struct __pyx_vtabstruct_5etree__XSLTResultTree **)&p->__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__XSLTResultTree;
p->_xslt = ((struct __pyx_obj_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_5etree__XSLTResultTree(PyObject *o) {
struct __pyx_obj_5etree__XSLTResultTree *p = (struct __pyx_obj_5etree__XSLTResultTree *)o;
Py_XDECREF(((PyObject *)p->_xslt));
Py_XDECREF(((PyObject *)p->_profile));
__pyx_ptype_5etree__ElementTree->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XSLTResultTree(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__XSLTResultTree *p = (struct __pyx_obj_5etree__XSLTResultTree *)o;
e = __pyx_ptype_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_5etree__XSLTResultTree(PyObject *o) {
struct __pyx_obj_5etree__XSLTResultTree *p = (struct __pyx_obj_5etree__XSLTResultTree *)o;
__pyx_ptype_5etree__ElementTree->tp_clear(o);
Py_XDECREF(((PyObject *)p->_xslt));
p->_xslt = ((struct __pyx_obj_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_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, void *x) {
return __pyx_f_5etree_15_XSLTResultTree_12xslt_profile___get__(o);
}

static int __pyx_setprop_5etree_15_XSLTResultTree_xslt_profile(PyObject *o, PyObject *v, void *x) {
if (v) {
  PyErr_SetString(PyExc_NotImplementedError, "__set__");
  return -1;
}
else {
  return __pyx_f_5etree_15_XSLTResultTree_12xslt_profile___del__(o);
}
}

static struct PyMethodDef __pyx_methods_5etree__XSLTResultTree[] = {
{"__unicode__", (PyCFunction)__pyx_f_5etree_15_XSLTResultTree___unicode__, METH_VARARGS|METH_KEYWORDS, 0},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__XSLTResultTree[] = {
{"xslt_profile", __pyx_getprop_5etree_15_XSLTResultTree_xslt_profile, __pyx_setprop_5etree_15_XSLTResultTree_xslt_profile, __pyx_k10, 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*/
};

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_5etree__XSLTResultTree = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XSLTResultTree", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XSLTResultTree), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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_5etree__XSLTResultTree, /*tp_traverse*/
__pyx_tp_clear_5etree__XSLTResultTree, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__XSLTResultTree, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_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_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_5etree__XSLTProcessingInstruction __pyx_vtable_5etree__XSLTProcessingInstruction;

static PyObject *__pyx_tp_new_5etree__XSLTProcessingInstruction(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree_PIBase->tp_new(t, a, k);
struct __pyx_obj_5etree__XSLTProcessingInstruction *p = (struct __pyx_obj_5etree__XSLTProcessingInstruction *)o;
*(struct __pyx_vtabstruct_5etree__XSLTProcessingInstruction **)&p->__pyx_base.__pyx_base.__pyx_base.__pyx_vtab = __pyx_vtabptr_5etree__XSLTProcessingInstruction;
return o;
}

static void __pyx_tp_dealloc_5etree__XSLTProcessingInstruction(PyObject *o) {
__pyx_ptype_5etree_PIBase->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree__XSLTProcessingInstruction(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree_PIBase->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree__XSLTProcessingInstruction(PyObject *o) {
__pyx_ptype_5etree_PIBase->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree__XSLTProcessingInstruction[] = {
{"parseXSL", (PyCFunction)__pyx_f_5etree_26_XSLTProcessingInstruction_parseXSL, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_26_XSLTProcessingInstruction_parseXSL},
{"set", (PyCFunction)__pyx_f_5etree_26_XSLTProcessingInstruction_set, METH_VARARGS|METH_KEYWORDS, 0},
{"get", (PyCFunction)__pyx_f_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*/
};

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_5etree__XSLTProcessingInstruction = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._XSLTProcessingInstruction", /*tp_name*/
sizeof(struct __pyx_obj_5etree__XSLTProcessingInstruction), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__XSLTProcessingInstruction, /*tp_traverse*/
__pyx_tp_clear_5etree__XSLTProcessingInstruction, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_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_5etree__Validator(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = (*t->tp_alloc)(t, 0);
struct __pyx_obj_5etree__Validator *p = (struct __pyx_obj_5etree__Validator *)o;
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return o;
}

static void __pyx_tp_dealloc_5etree__Validator(PyObject *o) {
struct __pyx_obj_5etree__Validator *p = (struct __pyx_obj_5etree__Validator *)o;
Py_XDECREF(((PyObject *)p->_error_log));
(*o->ob_type->tp_free)(o);
}

static int __pyx_tp_traverse_5etree__Validator(PyObject *o, visitproc v, void *a) {
int e;
struct __pyx_obj_5etree__Validator *p = (struct __pyx_obj_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_5etree__Validator(PyObject *o) {
struct __pyx_obj_5etree__Validator *p = (struct __pyx_obj_5etree__Validator *)o;
Py_XDECREF(((PyObject *)p->_error_log));
p->_error_log = ((struct __pyx_obj_5etree__ErrorLog *)Py_None); Py_INCREF(Py_None);
return 0;
}

static PyObject *__pyx_getprop_5etree_10_Validator_error_log(PyObject *o, void *x) {
return __pyx_f_5etree_10_Validator_9error_log___get__(o);
}

static struct PyMethodDef __pyx_methods_5etree__Validator[] = {
{"validate", (PyCFunction)__pyx_f_5etree_10_Validator_validate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_10_Validator_validate},
{"assertValid", (PyCFunction)__pyx_f_5etree_10_Validator_assertValid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_10_Validator_assertValid},
{"assert_", (PyCFunction)__pyx_f_5etree_10_Validator_assert_, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_10_Validator_assert_},
{0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_5etree__Validator[] = {
{"error_log", __pyx_getprop_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*/
};

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_5etree__Validator = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree._Validator", /*tp_name*/
sizeof(struct __pyx_obj_5etree__Validator), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_5etree__Validator, /*tp_traverse*/
__pyx_tp_clear_5etree__Validator, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_5etree__Validator, /*tp_methods*/
0, /*tp_members*/
__pyx_getsets_5etree__Validator, /*tp_getset*/
0, /*tp_base*/
0, /*tp_dict*/
0, /*tp_descr_get*/
0, /*tp_descr_set*/
0, /*tp_dictoffset*/
__pyx_f_5etree_10_Validator___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_RelaxNG(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__Validator->tp_new(t, a, k);
return o;
}

static void __pyx_tp_dealloc_5etree_RelaxNG(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_7RelaxNG___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_RelaxNG(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_RelaxNG(PyObject *o) {
__pyx_ptype_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_RelaxNG[] = {
{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*/
};

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_5etree_RelaxNG = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.RelaxNG", /*tp_name*/
sizeof(struct __pyx_obj_5etree_RelaxNG), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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_5etree_RelaxNG, /*tp_traverse*/
__pyx_tp_clear_5etree_RelaxNG, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_7RelaxNG___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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_5etree_XMLSchema(PyTypeObject *t, PyObject *a, PyObject *k) {
PyObject *o = __pyx_ptype_5etree__Validator->tp_new(t, a, k);
return o;
}

static void __pyx_tp_dealloc_5etree_XMLSchema(PyObject *o) {
{
  PyObject *etype, *eval, *etb;
  PyErr_Fetch(&etype, &eval, &etb);
  ++o->ob_refcnt;
  __pyx_f_5etree_9XMLSchema___dealloc__(o);
  if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
  --o->ob_refcnt;
  PyErr_Restore(etype, eval, etb);
}
__pyx_ptype_5etree__Validator->tp_dealloc(o);
}

static int __pyx_tp_traverse_5etree_XMLSchema(PyObject *o, visitproc v, void *a) {
int e;
e = __pyx_ptype_5etree__Validator->tp_traverse(o, v, a); if (e) return e;
return 0;
}

static int __pyx_tp_clear_5etree_XMLSchema(PyObject *o) {
__pyx_ptype_5etree__Validator->tp_clear(o);
return 0;
}

static struct PyMethodDef __pyx_methods_5etree_XMLSchema[] = {
{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*/
};

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_5etree_XMLSchema = {
PyObject_HEAD_INIT(0)
0, /*ob_size*/
"etree.XMLSchema", /*tp_name*/
sizeof(struct __pyx_obj_5etree_XMLSchema), /*tp_basicsize*/
0, /*tp_itemsize*/
__pyx_tp_dealloc_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_f_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_5etree_XMLSchema, /*tp_traverse*/
__pyx_tp_clear_5etree_XMLSchema, /*tp_clear*/
0, /*tp_richcompare*/
0, /*tp_weaklistoffset*/
0, /*tp_iter*/
0, /*tp_iternext*/
__pyx_methods_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_f_5etree_9XMLSchema___init__, /*tp_init*/
0, /*tp_alloc*/
__pyx_tp_new_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 struct PyMethodDef __pyx_methods[] = {
{"_superError", (PyCFunction)__pyx_f_5etree__superError, METH_VARARGS|METH_KEYWORDS, 0},
{"Element", (PyCFunction)__pyx_f_5etree_Element, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_Element},
{"Comment", (PyCFunction)__pyx_f_5etree_Comment, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_Comment},
{"ProcessingInstruction", (PyCFunction)__pyx_f_5etree_ProcessingInstruction, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_ProcessingInstruction},
{"SubElement", (PyCFunction)__pyx_f_5etree_SubElement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_SubElement},
{"ElementTree", (PyCFunction)__pyx_f_5etree_ElementTree, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_ElementTree},
{"HTML", (PyCFunction)__pyx_f_5etree_HTML, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_HTML},
{"XML", (PyCFunction)__pyx_f_5etree_XML, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_XML},
{"iselement", (PyCFunction)__pyx_f_5etree_iselement, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_iselement},
{"dump", (PyCFunction)__pyx_f_5etree_dump, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_dump},
{"tostring", (PyCFunction)__pyx_f_5etree_tostring, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_tostring},
{"tounicode", (PyCFunction)__pyx_f_5etree_tounicode, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_tounicode},
{"parse", (PyCFunction)__pyx_f_5etree_parse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_parse},
{"clearErrorLog", (PyCFunction)__pyx_f_5etree_clearErrorLog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_clearErrorLog},
{"useGlobalPythonLog", (PyCFunction)__pyx_f_5etree_useGlobalPythonLog, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_useGlobalPythonLog},
{"setElementClassLookup", (PyCFunction)__pyx_f_5etree_setElementClassLookup, METH_VARARGS|METH_KEYWORDS, 0},
{"Namespace", (PyCFunction)__pyx_f_5etree_Namespace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_Namespace},
{"FunctionNamespace", (PyCFunction)__pyx_f_5etree_FunctionNamespace, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_FunctionNamespace},
{"setDefaultParser", (PyCFunction)__pyx_f_5etree_setDefaultParser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_setDefaultParser},
{"getDefaultParser", (PyCFunction)__pyx_f_5etree_getDefaultParser, METH_VARARGS|METH_KEYWORDS, 0},
{"set_default_parser", (PyCFunction)__pyx_f_5etree_set_default_parser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_set_default_parser},
{"get_default_parser", (PyCFunction)__pyx_f_5etree_get_default_parser, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_get_default_parser},
{"XMLID", (PyCFunction)__pyx_f_5etree_XMLID, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_XMLID},
{"XMLDTDID", (PyCFunction)__pyx_f_5etree_XMLDTDID, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_XMLDTDID},
{"parseid", (PyCFunction)__pyx_f_5etree_parseid, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5etree_parseid},
{"Extension", (PyCFunction)__pyx_f_5etree_Extension, METH_VARARGS|METH_KEYWORDS, 0},
{"XPathEvaluator", (PyCFunction)__pyx_f_5etree_XPathEvaluator, METH_VARARGS|METH_KEYWORDS, __pyx_doc_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;
PyObject *__pyx_7 = 0;
__pyx_init_filenames();
__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;};
if (__Pyx_InternStrings(__pyx_intern_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;};
if (__Pyx_InitCApi(__pyx_m) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; goto __pyx_L1;}
__pyx_v_5etree_True = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_False = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_set = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_id = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_super = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_StopIteration = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__elementpath = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_sys = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_re = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_ITER_EMPTY = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__FILENAME_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__LxmlError = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__initError = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___RE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___REPLACE_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___HAS_XML_ENCODING = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_5etree__BaseErrorLog *)Py_None); Py_INCREF(Py_None);
__pyx_v_5etree___ERROR_LEVELS = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___ERROR_DOMAINS = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___ERROR_TYPES = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_ELEMENT_CLASS_LOOKUP_STATE = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_5etree_ParserBasedElementClassLookup *)Py_None); Py_INCREF(Py_None);
__pyx_v_5etree___NAMESPACE_REGISTRIES = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_5etree__ParserContext *)Py_None); Py_INCREF(Py_None);
__pyx_v_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_5etree_XMLParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_5etree_HTMLParser *)Py_None); Py_INCREF(Py_None);
__pyx_v_5etree___ITERPARSE_CHUNK_SIZE = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__replace_strings = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__find_namespaces = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__FIND_PI_ATTRIBUTES = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__RE_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__FIND_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__REPLACE_PI_HREF = Py_None; Py_INCREF(Py_None);
__pyx_v_5etree__findStylesheetByID = ((struct __pyx_obj_5etree_XPath *)Py_None); Py_INCREF(Py_None);
__pyx_vtabptr_5etree__TempStore = &__pyx_vtable_5etree__TempStore;
*(void(**)())&__pyx_vtable_5etree__TempStore.add = (void(*)())__pyx_f_5etree_10_TempStore_add;
*(void(**)())&__pyx_vtable_5etree__TempStore.clear = (void(*)())__pyx_f_5etree_10_TempStore_clear;
*(void(**)())&__pyx_vtable_5etree__TempStore.dictcopy = (void(*)())__pyx_f_5etree_10_TempStore_dictcopy;
__pyx_type_5etree__TempStore.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__TempStore.tp_dict, __pyx_vtabptr_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_TempStore", (PyObject *)&__pyx_type_5etree__TempStore) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; goto __pyx_L1;}
__pyx_ptype_5etree__TempStore = &__pyx_type_5etree__TempStore;
__pyx_vtabptr_5etree__ExceptionContext = &__pyx_vtable_5etree__ExceptionContext;
*(void(**)())&__pyx_vtable_5etree__ExceptionContext.clear = (void(*)())__pyx_f_5etree_17_ExceptionContext_clear;
*(void(**)())&__pyx_vtable_5etree__ExceptionContext._store_raised = (void(*)())__pyx_f_5etree_17_ExceptionContext__store_raised;
*(void(**)())&__pyx_vtable_5etree__ExceptionContext._store_exception = (void(*)())__pyx_f_5etree_17_ExceptionContext__store_exception;
*(void(**)())&__pyx_vtable_5etree__ExceptionContext._has_raised = (void(*)())__pyx_f_5etree_17_ExceptionContext__has_raised;
*(void(**)())&__pyx_vtable_5etree__ExceptionContext._raise_if_stored = (void(*)())__pyx_f_5etree_17_ExceptionContext__raise_if_stored;
__pyx_type_5etree__ExceptionContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ExceptionContext.tp_dict, __pyx_vtabptr_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ExceptionContext", (PyObject *)&__pyx_type_5etree__ExceptionContext) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; goto __pyx_L1;}
__pyx_ptype_5etree__ExceptionContext = &__pyx_type_5etree__ExceptionContext;
__pyx_type_5etree_QName.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "QName", (PyObject *)&__pyx_type_5etree_QName) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; goto __pyx_L1;}
__pyx_ptype_5etree_QName = &__pyx_type_5etree_QName;
__pyx_vtabptr_5etree__BaseParser = &__pyx_vtable_5etree__BaseParser;
*(void(**)())&__pyx_vtable_5etree__BaseParser._cleanup = (void(*)())__pyx_f_5etree_11_BaseParser__cleanup;
*(void(**)())&__pyx_vtable_5etree__BaseParser._lockParser = (void(*)())__pyx_f_5etree_11_BaseParser__lockParser;
*(void(**)())&__pyx_vtable_5etree__BaseParser._unlockParser = (void(*)())__pyx_f_5etree_11_BaseParser__unlockParser;
*(void(**)())&__pyx_vtable_5etree__BaseParser._copy = (void(*)())__pyx_f_5etree_11_BaseParser__copy;
*(void(**)())&__pyx_vtable_5etree__BaseParser._parseUnicodeDoc = (void(*)())__pyx_f_5etree_11_BaseParser__parseUnicodeDoc;
*(void(**)())&__pyx_vtable_5etree__BaseParser._parseDoc = (void(*)())__pyx_f_5etree_11_BaseParser__parseDoc;
*(void(**)())&__pyx_vtable_5etree__BaseParser._parseDocFromFile = (void(*)())__pyx_f_5etree_11_BaseParser__parseDocFromFile;
*(void(**)())&__pyx_vtable_5etree__BaseParser._parseDocFromFilelike = (void(*)())__pyx_f_5etree_11_BaseParser__parseDocFromFilelike;
__pyx_type_5etree__BaseParser.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__BaseParser.tp_dict, __pyx_vtabptr_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseParser", (PyObject *)&__pyx_type_5etree__BaseParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 344; goto __pyx_L1;}
__pyx_ptype_5etree__BaseParser = &__pyx_type_5etree__BaseParser;
__pyx_vtabptr_5etree__Document = &__pyx_vtable_5etree__Document;
*(void(**)())&__pyx_vtable_5etree__Document.getroot = (void(*)())__pyx_f_5etree_9_Document_getroot;
*(void(**)())&__pyx_vtable_5etree__Document.getdoctype = (void(*)())__pyx_f_5etree_9_Document_getdoctype;
*(void(**)())&__pyx_vtable_5etree__Document.getxmlinfo = (void(*)())__pyx_f_5etree_9_Document_getxmlinfo;
*(void(**)())&__pyx_vtable_5etree__Document.getURL = (void(*)())__pyx_f_5etree_9_Document_getURL;
*(void(**)())&__pyx_vtable_5etree__Document.buildNewPrefix = (void(*)())__pyx_f_5etree_9_Document_buildNewPrefix;
*(void(**)())&__pyx_vtable_5etree__Document._findOrBuildNodeNs = (void(*)())__pyx_f_5etree_9_Document__findOrBuildNodeNs;
*(void(**)())&__pyx_vtable_5etree__Document._setNodeNs = (void(*)())__pyx_f_5etree_9_Document__setNodeNs;
*(void(**)())&__pyx_vtable_5etree__Document._setNodeNamespaces = (void(*)())__pyx_f_5etree_9_Document__setNodeNamespaces;
LxmlDocumentType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlDocumentType.tp_dict, __pyx_vtabptr_5etree__Document) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Document", (PyObject *)&LxmlDocumentType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; goto __pyx_L1;}
__pyx_ptype_5etree__Document = &LxmlDocumentType;
__pyx_type_5etree_DocInfo.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "DocInfo", (PyObject *)&__pyx_type_5etree_DocInfo) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; goto __pyx_L1;}
__pyx_ptype_5etree_DocInfo = &__pyx_type_5etree_DocInfo;
LxmlElementType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Element", (PyObject *)&LxmlElementType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; goto __pyx_L1;}
__pyx_ptype_5etree__Element = &LxmlElementType;
__pyx_vtabptr_5etree___ContentOnlyElement = &__pyx_vtable_5etree___ContentOnlyElement;
*(void(**)())&__pyx_vtable_5etree___ContentOnlyElement._raiseImmutable = (void(*)())__pyx_f_5etree_20__ContentOnlyElement__raiseImmutable;
__pyx_type_5etree___ContentOnlyElement.tp_base = __pyx_ptype_5etree__Element;
if (PyType_Ready(&__pyx_type_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree___ContentOnlyElement.tp_dict, __pyx_vtabptr_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "__ContentOnlyElement", (PyObject *)&__pyx_type_5etree___ContentOnlyElement) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1011; goto __pyx_L1;}
__pyx_ptype_5etree___ContentOnlyElement = &__pyx_type_5etree___ContentOnlyElement;
__pyx_vtabptr_5etree__Comment = &__pyx_vtable_5etree__Comment;
__pyx_vtable_5etree__Comment.__pyx_base = *__pyx_vtabptr_5etree___ContentOnlyElement;
__pyx_type_5etree__Comment.tp_base = __pyx_ptype_5etree___ContentOnlyElement;
if (PyType_Ready(&__pyx_type_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__Comment.tp_dict, __pyx_vtabptr_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Comment", (PyObject *)&__pyx_type_5etree__Comment) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; goto __pyx_L1;}
__pyx_ptype_5etree__Comment = &__pyx_type_5etree__Comment;
__pyx_vtabptr_5etree__ProcessingInstruction = &__pyx_vtable_5etree__ProcessingInstruction;
__pyx_vtable_5etree__ProcessingInstruction.__pyx_base = *__pyx_vtabptr_5etree___ContentOnlyElement;
__pyx_type_5etree__ProcessingInstruction.tp_base = __pyx_ptype_5etree___ContentOnlyElement;
if (PyType_Ready(&__pyx_type_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ProcessingInstruction.tp_dict, __pyx_vtabptr_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ProcessingInstruction", (PyObject *)&__pyx_type_5etree__ProcessingInstruction) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1075; goto __pyx_L1;}
__pyx_ptype_5etree__ProcessingInstruction = &__pyx_type_5etree__ProcessingInstruction;
__pyx_vtabptr_5etree__ElementTree = &__pyx_vtable_5etree__ElementTree;
*(void(**)())&__pyx_vtable_5etree__ElementTree._assertHasRoot = (void(*)())__pyx_f_5etree_12_ElementTree__assertHasRoot;
LxmlElementTreeType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementTreeType.tp_dict, __pyx_vtabptr_5etree__ElementTree) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementTree", (PyObject *)&LxmlElementTreeType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1098; goto __pyx_L1;}
__pyx_ptype_5etree__ElementTree = &LxmlElementTreeType;
__pyx_type_5etree__Attrib.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Attrib", (PyObject *)&__pyx_type_5etree__Attrib) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1351; goto __pyx_L1;}
__pyx_ptype_5etree__Attrib = &__pyx_type_5etree__Attrib;
__pyx_type_5etree__AttribIterator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_AttribIterator", (PyObject *)&__pyx_type_5etree__AttribIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1444; goto __pyx_L1;}
__pyx_ptype_5etree__AttribIterator = &__pyx_type_5etree__AttribIterator;
__pyx_vtabptr_5etree__ElementTagMatcher = &__pyx_vtable_5etree__ElementTagMatcher;
*(void(**)())&__pyx_vtable_5etree__ElementTagMatcher._initTagMatch = (void(*)())__pyx_f_5etree_18_ElementTagMatcher__initTagMatch;
LxmlElementTagMatcherType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementTagMatcherType.tp_dict, __pyx_vtabptr_5etree__ElementTagMatcher) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementTagMatcher", (PyObject *)&LxmlElementTagMatcherType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1487; goto __pyx_L1;}
__pyx_ptype_5etree__ElementTagMatcher = &LxmlElementTagMatcherType;
__pyx_vtabptr_5etree__ElementIterator = &__pyx_vtable_5etree__ElementIterator;
__pyx_vtable_5etree__ElementIterator.__pyx_base = *__pyx_vtabptr_5etree__ElementTagMatcher;
*(void(**)())&__pyx_vtable_5etree__ElementIterator._storeNext = (void(*)())__pyx_f_5etree_16_ElementIterator__storeNext;
LxmlElementIteratorType.tp_base = __pyx_ptype_5etree__ElementTagMatcher;
LxmlElementIteratorType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlElementIteratorType.tp_dict, __pyx_vtabptr_5etree__ElementIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ElementIterator", (PyObject *)&LxmlElementIteratorType) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1506; goto __pyx_L1;}
__pyx_ptype_5etree__ElementIterator = &LxmlElementIteratorType;
__pyx_vtabptr_5etree_ElementChildIterator = &__pyx_vtable_5etree_ElementChildIterator;
__pyx_vtable_5etree_ElementChildIterator.__pyx_base = *__pyx_vtabptr_5etree__ElementIterator;
__pyx_type_5etree_ElementChildIterator.tp_base = __pyx_ptype_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_ElementChildIterator.tp_dict, __pyx_vtabptr_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementChildIterator", (PyObject *)&__pyx_type_5etree_ElementChildIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1536; goto __pyx_L1;}
__pyx_ptype_5etree_ElementChildIterator = &__pyx_type_5etree_ElementChildIterator;
__pyx_vtabptr_5etree_SiblingsIterator = &__pyx_vtable_5etree_SiblingsIterator;
__pyx_vtable_5etree_SiblingsIterator.__pyx_base = *__pyx_vtabptr_5etree__ElementIterator;
__pyx_type_5etree_SiblingsIterator.tp_base = __pyx_ptype_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_SiblingsIterator.tp_dict, __pyx_vtabptr_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "SiblingsIterator", (PyObject *)&__pyx_type_5etree_SiblingsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1555; goto __pyx_L1;}
__pyx_ptype_5etree_SiblingsIterator = &__pyx_type_5etree_SiblingsIterator;
__pyx_vtabptr_5etree_AncestorsIterator = &__pyx_vtable_5etree_AncestorsIterator;
__pyx_vtable_5etree_AncestorsIterator.__pyx_base = *__pyx_vtabptr_5etree__ElementIterator;
__pyx_type_5etree_AncestorsIterator.tp_base = __pyx_ptype_5etree__ElementIterator;
if (PyType_Ready(&__pyx_type_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_AncestorsIterator.tp_dict, __pyx_vtabptr_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "AncestorsIterator", (PyObject *)&__pyx_type_5etree_AncestorsIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1568; goto __pyx_L1;}
__pyx_ptype_5etree_AncestorsIterator = &__pyx_type_5etree_AncestorsIterator;
__pyx_vtabptr_5etree_ElementDepthFirstIterator = &__pyx_vtable_5etree_ElementDepthFirstIterator;
__pyx_vtable_5etree_ElementDepthFirstIterator.__pyx_base = *__pyx_vtabptr_5etree__ElementTagMatcher;
*(void(**)())&__pyx_vtable_5etree_ElementDepthFirstIterator._nextNodeAnyTag = (void(*)())__pyx_f_5etree_25ElementDepthFirstIterator__nextNodeAnyTag;
*(void(**)())&__pyx_vtable_5etree_ElementDepthFirstIterator._nextNodeMatchTag = (void(*)())__pyx_f_5etree_25ElementDepthFirstIterator__nextNodeMatchTag;
__pyx_type_5etree_ElementDepthFirstIterator.tp_base = __pyx_ptype_5etree__ElementTagMatcher;
__pyx_type_5etree_ElementDepthFirstIterator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_ElementDepthFirstIterator.tp_dict, __pyx_vtabptr_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementDepthFirstIterator", (PyObject *)&__pyx_type_5etree_ElementDepthFirstIterator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1575; goto __pyx_L1;}
__pyx_ptype_5etree_ElementDepthFirstIterator = &__pyx_type_5etree_ElementDepthFirstIterator;
__pyx_vtabptr_5etree__LogEntry = &__pyx_vtable_5etree__LogEntry;
*(void(**)())&__pyx_vtable_5etree__LogEntry._setError = (void(*)())__pyx_f_5etree_9_LogEntry__setError;
*(void(**)())&__pyx_vtable_5etree__LogEntry._setGeneric = (void(*)())__pyx_f_5etree_9_LogEntry__setGeneric;
__pyx_type_5etree__LogEntry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__LogEntry.tp_dict, __pyx_vtabptr_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_LogEntry", (PyObject *)&__pyx_type_5etree__LogEntry) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 34; goto __pyx_L1;}
__pyx_ptype_5etree__LogEntry = &__pyx_type_5etree__LogEntry;
__pyx_vtabptr_5etree__BaseErrorLog = &__pyx_vtable_5etree__BaseErrorLog;
*(void(**)())&__pyx_vtable_5etree__BaseErrorLog._receive = (void(*)())__pyx_f_5etree_13_BaseErrorLog__receive;
*(void(**)())&__pyx_vtable_5etree__BaseErrorLog._receiveGeneric = (void(*)())__pyx_f_5etree_13_BaseErrorLog__receiveGeneric;
__pyx_type_5etree__BaseErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__BaseErrorLog.tp_dict, __pyx_vtabptr_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseErrorLog", (PyObject *)&__pyx_type_5etree__BaseErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 82; goto __pyx_L1;}
__pyx_ptype_5etree__BaseErrorLog = &__pyx_type_5etree__BaseErrorLog;
__pyx_vtabptr_5etree__ListErrorLog = &__pyx_vtable_5etree__ListErrorLog;
__pyx_vtable_5etree__ListErrorLog.__pyx_base = *__pyx_vtabptr_5etree__BaseErrorLog;
__pyx_type_5etree__ListErrorLog.tp_base = __pyx_ptype_5etree__BaseErrorLog;
__pyx_type_5etree__ListErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ListErrorLog.tp_dict, __pyx_vtabptr_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ListErrorLog", (PyObject *)&__pyx_type_5etree__ListErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 123; goto __pyx_L1;}
__pyx_ptype_5etree__ListErrorLog = &__pyx_type_5etree__ListErrorLog;
__pyx_vtabptr_5etree__ErrorLog = &__pyx_vtable_5etree__ErrorLog;
__pyx_vtable_5etree__ErrorLog.__pyx_base = *__pyx_vtabptr_5etree__ListErrorLog;
*(void(**)())&__pyx_vtable_5etree__ErrorLog.connect = (void(*)())__pyx_f_5etree_9_ErrorLog_connect;
*(void(**)())&__pyx_vtable_5etree__ErrorLog.disconnect = (void(*)())__pyx_f_5etree_9_ErrorLog_disconnect;
__pyx_type_5etree__ErrorLog.tp_base = __pyx_ptype_5etree__ListErrorLog;
if (PyType_Ready(&__pyx_type_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ErrorLog.tp_dict, __pyx_vtabptr_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ErrorLog", (PyObject *)&__pyx_type_5etree__ErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 201; goto __pyx_L1;}
__pyx_ptype_5etree__ErrorLog = &__pyx_type_5etree__ErrorLog;
__pyx_vtabptr_5etree__DomainErrorLog = &__pyx_vtable_5etree__DomainErrorLog;
__pyx_vtable_5etree__DomainErrorLog.__pyx_base = *__pyx_vtabptr_5etree__ErrorLog;
__pyx_type_5etree__DomainErrorLog.tp_base = __pyx_ptype_5etree__ErrorLog;
if (PyType_Ready(&__pyx_type_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__DomainErrorLog.tp_dict, __pyx_vtabptr_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_DomainErrorLog", (PyObject *)&__pyx_type_5etree__DomainErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 224; goto __pyx_L1;}
__pyx_ptype_5etree__DomainErrorLog = &__pyx_type_5etree__DomainErrorLog;
__pyx_vtabptr_5etree__RotatingErrorLog = &__pyx_vtable_5etree__RotatingErrorLog;
__pyx_vtable_5etree__RotatingErrorLog.__pyx_base = *__pyx_vtabptr_5etree__ErrorLog;
__pyx_type_5etree__RotatingErrorLog.tp_base = __pyx_ptype_5etree__ErrorLog;
if (PyType_Ready(&__pyx_type_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__RotatingErrorLog.tp_dict, __pyx_vtabptr_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_RotatingErrorLog", (PyObject *)&__pyx_type_5etree__RotatingErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 233; goto __pyx_L1;}
__pyx_ptype_5etree__RotatingErrorLog = &__pyx_type_5etree__RotatingErrorLog;
__pyx_vtabptr_5etree_PyErrorLog = &__pyx_vtable_5etree_PyErrorLog;
__pyx_vtable_5etree_PyErrorLog.__pyx_base = *__pyx_vtabptr_5etree__BaseErrorLog;
__pyx_type_5etree_PyErrorLog.tp_base = __pyx_ptype_5etree__BaseErrorLog;
__pyx_type_5etree_PyErrorLog.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 245; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_PyErrorLog.tp_dict, __pyx_vtabptr_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 245; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PyErrorLog", (PyObject *)&__pyx_type_5etree_PyErrorLog) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 245; goto __pyx_L1;}
__pyx_ptype_5etree_PyErrorLog = &__pyx_type_5etree_PyErrorLog;
LxmlElementBaseType.tp_base = __pyx_ptype_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_5etree_ElementBase = &LxmlElementBaseType;
__pyx_vtabptr_5etree_CommentBase = &__pyx_vtable_5etree_CommentBase;
__pyx_vtable_5etree_CommentBase.__pyx_base = *__pyx_vtabptr_5etree__Comment;
__pyx_type_5etree_CommentBase.tp_base = __pyx_ptype_5etree__Comment;
if (PyType_Ready(&__pyx_type_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_CommentBase.tp_dict, __pyx_vtabptr_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "CommentBase", (PyObject *)&__pyx_type_5etree_CommentBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_ptype_5etree_CommentBase = &__pyx_type_5etree_CommentBase;
__pyx_vtabptr_5etree_PIBase = &__pyx_vtable_5etree_PIBase;
__pyx_vtable_5etree_PIBase.__pyx_base = *__pyx_vtabptr_5etree__ProcessingInstruction;
__pyx_type_5etree_PIBase.tp_base = __pyx_ptype_5etree__ProcessingInstruction;
if (PyType_Ready(&__pyx_type_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_PIBase.tp_dict, __pyx_vtabptr_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "PIBase", (PyObject *)&__pyx_type_5etree_PIBase) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 27; goto __pyx_L1;}
__pyx_ptype_5etree_PIBase = &__pyx_type_5etree_PIBase;
if (PyType_Ready(&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 44; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementClassLookup", (PyObject *)&LxmlElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 44; goto __pyx_L1;}
__pyx_ptype_5etree_ElementClassLookup = &LxmlElementClassLookupType;
__pyx_vtabptr_5etree_FallbackElementClassLookup = &__pyx_vtable_5etree_FallbackElementClassLookup;
*(void(**)())&__pyx_vtable_5etree_FallbackElementClassLookup._callFallback = (void(*)())__pyx_f_5etree_26FallbackElementClassLookup__callFallback;
LxmlFallbackElementClassLookupType.tp_base = __pyx_ptype_5etree_ElementClassLookup;
LxmlFallbackElementClassLookupType.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; goto __pyx_L1;}
if (__Pyx_SetVtable(LxmlFallbackElementClassLookupType.tp_dict, __pyx_vtabptr_5etree_FallbackElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "FallbackElementClassLookup", (PyObject *)&LxmlFallbackElementClassLookupType) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 52; goto __pyx_L1;}
__pyx_ptype_5etree_FallbackElementClassLookup = &LxmlFallbackElementClassLookupType;
__pyx_type_5etree_ElementDefaultClassLookup.tp_base = __pyx_ptype_5etree_ElementClassLookup;
__pyx_type_5etree_ElementDefaultClassLookup.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementDefaultClassLookup", (PyObject *)&__pyx_type_5etree_ElementDefaultClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 79; goto __pyx_L1;}
__pyx_ptype_5etree_ElementDefaultClassLookup = &__pyx_type_5etree_ElementDefaultClassLookup;
__pyx_vtabptr_5etree_ElementNamespaceClassLookup = &__pyx_vtable_5etree_ElementNamespaceClassLookup;
__pyx_vtable_5etree_ElementNamespaceClassLookup.__pyx_base = *__pyx_vtabptr_5etree_FallbackElementClassLookup;
__pyx_type_5etree_ElementNamespaceClassLookup.tp_base = __pyx_ptype_5etree_FallbackElementClassLookup;
if (PyType_Ready(&__pyx_type_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_ElementNamespaceClassLookup.tp_dict, __pyx_vtabptr_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ElementNamespaceClassLookup", (PyObject *)&__pyx_type_5etree_ElementNamespaceClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 135; goto __pyx_L1;}
__pyx_ptype_5etree_ElementNamespaceClassLookup = &__pyx_type_5etree_ElementNamespaceClassLookup;
__pyx_vtabptr_5etree_AttributeBasedElementClassLookup = &__pyx_vtable_5etree_AttributeBasedElementClassLookup;
__pyx_vtable_5etree_AttributeBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_5etree_FallbackElementClassLookup;
__pyx_type_5etree_AttributeBasedElementClassLookup.tp_base = __pyx_ptype_5etree_FallbackElementClassLookup;
__pyx_type_5etree_AttributeBasedElementClassLookup.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_AttributeBasedElementClassLookup.tp_dict, __pyx_vtabptr_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "AttributeBasedElementClassLookup", (PyObject *)&__pyx_type_5etree_AttributeBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 143; goto __pyx_L1;}
__pyx_ptype_5etree_AttributeBasedElementClassLookup = &__pyx_type_5etree_AttributeBasedElementClassLookup;
__pyx_vtabptr_5etree_ParserBasedElementClassLookup = &__pyx_vtable_5etree_ParserBasedElementClassLookup;
__pyx_vtable_5etree_ParserBasedElementClassLookup.__pyx_base = *__pyx_vtabptr_5etree_FallbackElementClassLookup;
__pyx_type_5etree_ParserBasedElementClassLookup.tp_base = __pyx_ptype_5etree_FallbackElementClassLookup;
if (PyType_Ready(&__pyx_type_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_ParserBasedElementClassLookup.tp_dict, __pyx_vtabptr_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ParserBasedElementClassLookup", (PyObject *)&__pyx_type_5etree_ParserBasedElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; goto __pyx_L1;}
__pyx_ptype_5etree_ParserBasedElementClassLookup = &__pyx_type_5etree_ParserBasedElementClassLookup;
__pyx_vtabptr_5etree_CustomElementClassLookup = &__pyx_vtable_5etree_CustomElementClassLookup;
__pyx_vtable_5etree_CustomElementClassLookup.__pyx_base = *__pyx_vtabptr_5etree_FallbackElementClassLookup;
__pyx_type_5etree_CustomElementClassLookup.tp_base = __pyx_ptype_5etree_FallbackElementClassLookup;
if (PyType_Ready(&__pyx_type_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 204; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_CustomElementClassLookup.tp_dict, __pyx_vtabptr_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 204; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "CustomElementClassLookup", (PyObject *)&__pyx_type_5etree_CustomElementClassLookup) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 204; goto __pyx_L1;}
__pyx_ptype_5etree_CustomElementClassLookup = &__pyx_type_5etree_CustomElementClassLookup;
__pyx_vtabptr_5etree__NamespaceRegistry = &__pyx_vtable_5etree__NamespaceRegistry;
*(void(**)())&__pyx_vtable_5etree__NamespaceRegistry._get = (void(*)())__pyx_f_5etree_18_NamespaceRegistry__get;
*(void(**)())&__pyx_vtable_5etree__NamespaceRegistry._getForString = (void(*)())__pyx_f_5etree_18_NamespaceRegistry__getForString;
__pyx_type_5etree__NamespaceRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 46; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__NamespaceRegistry.tp_dict, __pyx_vtabptr_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 46; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_NamespaceRegistry", (PyObject *)&__pyx_type_5etree__NamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 46; goto __pyx_L1;}
__pyx_ptype_5etree__NamespaceRegistry = &__pyx_type_5etree__NamespaceRegistry;
__pyx_vtabptr_5etree__ClassNamespaceRegistry = &__pyx_vtable_5etree__ClassNamespaceRegistry;
__pyx_vtable_5etree__ClassNamespaceRegistry.__pyx_base = *__pyx_vtabptr_5etree__NamespaceRegistry;
__pyx_type_5etree__ClassNamespaceRegistry.tp_base = __pyx_ptype_5etree__NamespaceRegistry;
if (PyType_Ready(&__pyx_type_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ClassNamespaceRegistry.tp_dict, __pyx_vtabptr_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ClassNamespaceRegistry", (PyObject *)&__pyx_type_5etree__ClassNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 104; goto __pyx_L1;}
__pyx_ptype_5etree__ClassNamespaceRegistry = &__pyx_type_5etree__ClassNamespaceRegistry;
__pyx_vtabptr_5etree__FunctionNamespaceRegistry = &__pyx_vtable_5etree__FunctionNamespaceRegistry;
__pyx_vtable_5etree__FunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_5etree__NamespaceRegistry;
__pyx_type_5etree__FunctionNamespaceRegistry.tp_base = __pyx_ptype_5etree__NamespaceRegistry;
if (PyType_Ready(&__pyx_type_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 117; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__FunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 117; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FunctionNamespaceRegistry", (PyObject *)&__pyx_type_5etree__FunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_ptype_5etree__FunctionNamespaceRegistry = &__pyx_type_5etree__FunctionNamespaceRegistry;
__pyx_vtabptr_5etree__XPathFunctionNamespaceRegistry = &__pyx_vtable_5etree__XPathFunctionNamespaceRegistry;
__pyx_vtable_5etree__XPathFunctionNamespaceRegistry.__pyx_base = *__pyx_vtabptr_5etree__FunctionNamespaceRegistry;
__pyx_type_5etree__XPathFunctionNamespaceRegistry.tp_base = __pyx_ptype_5etree__FunctionNamespaceRegistry;
__pyx_type_5etree__XPathFunctionNamespaceRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 130; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XPathFunctionNamespaceRegistry.tp_dict, __pyx_vtabptr_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 130; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathFunctionNamespaceRegistry", (PyObject *)&__pyx_type_5etree__XPathFunctionNamespaceRegistry) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 130; goto __pyx_L1;}
__pyx_ptype_5etree__XPathFunctionNamespaceRegistry = &__pyx_type_5etree__XPathFunctionNamespaceRegistry;
__pyx_type_5etree__InputDocument.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_InputDocument", (PyObject *)&__pyx_type_5etree__InputDocument) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_ptype_5etree__InputDocument = &__pyx_type_5etree__InputDocument;
if (PyType_Ready(&__pyx_type_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 14; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "Resolver", (PyObject *)&__pyx_type_5etree_Resolver) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_ptype_5etree_Resolver = &__pyx_type_5etree_Resolver;
__pyx_vtabptr_5etree__ResolverRegistry = &__pyx_vtable_5etree__ResolverRegistry;
*(void(**)())&__pyx_vtable_5etree__ResolverRegistry._copy = (void(*)())__pyx_f_5etree_17_ResolverRegistry__copy;
__pyx_type_5etree__ResolverRegistry.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 52; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ResolverRegistry.tp_dict, __pyx_vtabptr_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 52; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ResolverRegistry", (PyObject *)&__pyx_type_5etree__ResolverRegistry) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 52; goto __pyx_L1;}
__pyx_ptype_5etree__ResolverRegistry = &__pyx_type_5etree__ResolverRegistry;
__pyx_vtabptr_5etree__ResolverContext = &__pyx_vtable_5etree__ResolverContext;
__pyx_vtable_5etree__ResolverContext.__pyx_base = *__pyx_vtabptr_5etree__ExceptionContext;
*(void(**)())&__pyx_vtable_5etree__ResolverContext.__pyx_base.clear = (void(*)())__pyx_f_5etree_16_ResolverContext_clear;
__pyx_type_5etree__ResolverContext.tp_base = __pyx_ptype_5etree__ExceptionContext;
__pyx_type_5etree__ResolverContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ResolverContext.tp_dict, __pyx_vtabptr_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ResolverContext", (PyObject *)&__pyx_type_5etree__ResolverContext) < 0) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 94; goto __pyx_L1;}
__pyx_ptype_5etree__ResolverContext = &__pyx_type_5etree__ResolverContext;
__pyx_vtabptr_5etree__ParserContext = &__pyx_vtable_5etree__ParserContext;
*(void(**)())&__pyx_vtable_5etree__ParserContext.initMainParserContext = (void(*)())__pyx_f_5etree_14_ParserContext_initMainParserContext;
*(void(**)())&__pyx_vtable_5etree__ParserContext._findThreadParserContext = (void(*)())__pyx_f_5etree_14_ParserContext__findThreadParserContext;
*(void(**)())&__pyx_vtable_5etree__ParserContext.setDefaultParser = (void(*)())__pyx_f_5etree_14_ParserContext_setDefaultParser;
*(void(**)())&__pyx_vtable_5etree__ParserContext.getDefaultParser = (void(*)())__pyx_f_5etree_14_ParserContext_getDefaultParser;
*(void(**)())&__pyx_vtable_5etree__ParserContext._getThreadDict = (void(*)())__pyx_f_5etree_14_ParserContext__getThreadDict;
*(void(**)())&__pyx_vtable_5etree__ParserContext.initThreadDictRef = (void(*)())__pyx_f_5etree_14_ParserContext_initThreadDictRef;
*(void(**)())&__pyx_vtable_5etree__ParserContext.initParserDict = (void(*)())__pyx_f_5etree_14_ParserContext_initParserDict;
*(void(**)())&__pyx_vtable_5etree__ParserContext.initXPathParserDict = (void(*)())__pyx_f_5etree_14_ParserContext_initXPathParserDict;
*(void(**)())&__pyx_vtable_5etree__ParserContext.initDocDict = (void(*)())__pyx_f_5etree_14_ParserContext_initDocDict;
__pyx_type_5etree__ParserContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 18; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ParserContext.tp_dict, __pyx_vtabptr_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 18; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ParserContext", (PyObject *)&__pyx_type_5etree__ParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 18; goto __pyx_L1;}
__pyx_ptype_5etree__ParserContext = &__pyx_type_5etree__ParserContext;
__pyx_vtabptr_5etree__FileParserContext = &__pyx_vtable_5etree__FileParserContext;
*(void(**)())&__pyx_vtable_5etree__FileParserContext._createParserInput = (void(*)())__pyx_f_5etree_18_FileParserContext__createParserInput;
*(void(**)())&__pyx_vtable_5etree__FileParserContext._readDoc = (void(*)())__pyx_f_5etree_18_FileParserContext__readDoc;
*(void(**)())&__pyx_vtable_5etree__FileParserContext.copyToBuffer = (void(*)())__pyx_f_5etree_18_FileParserContext_copyToBuffer;
__pyx_type_5etree__FileParserContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__FileParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__FileParserContext.tp_dict, __pyx_vtabptr_5etree__FileParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FileParserContext", (PyObject *)&__pyx_type_5etree__FileParserContext) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 182; goto __pyx_L1;}
__pyx_ptype_5etree__FileParserContext = &__pyx_type_5etree__FileParserContext;
__pyx_vtabptr_5etree_XMLParser = &__pyx_vtable_5etree_XMLParser;
__pyx_vtable_5etree_XMLParser.__pyx_base = *__pyx_vtabptr_5etree__BaseParser;
__pyx_type_5etree_XMLParser.tp_base = __pyx_ptype_5etree__BaseParser;
if (PyType_Ready(&__pyx_type_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 634; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_XMLParser.tp_dict, __pyx_vtabptr_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 634; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XMLParser", (PyObject *)&__pyx_type_5etree_XMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 634; goto __pyx_L1;}
__pyx_ptype_5etree_XMLParser = &__pyx_type_5etree_XMLParser;
__pyx_vtabptr_5etree_HTMLParser = &__pyx_vtable_5etree_HTMLParser;
__pyx_vtable_5etree_HTMLParser.__pyx_base = *__pyx_vtabptr_5etree__BaseParser;
__pyx_type_5etree_HTMLParser.tp_base = __pyx_ptype_5etree__BaseParser;
if (PyType_Ready(&__pyx_type_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 773; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_HTMLParser.tp_dict, __pyx_vtabptr_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 773; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "HTMLParser", (PyObject *)&__pyx_type_5etree_HTMLParser) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 773; goto __pyx_L1;}
__pyx_ptype_5etree_HTMLParser = &__pyx_type_5etree_HTMLParser;
__pyx_vtabptr_5etree__FilelikeWriter = &__pyx_vtable_5etree__FilelikeWriter;
*(void(**)())&__pyx_vtable_5etree__FilelikeWriter._createOutputBuffer = (void(*)())__pyx_f_5etree_15_FilelikeWriter__createOutputBuffer;
*(void(**)())&__pyx_vtable_5etree__FilelikeWriter.write = (void(*)())__pyx_f_5etree_15_FilelikeWriter_write;
*(void(**)())&__pyx_vtable_5etree__FilelikeWriter.close = (void(*)())__pyx_f_5etree_15_FilelikeWriter_close;
__pyx_type_5etree__FilelikeWriter.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__FilelikeWriter.tp_dict, __pyx_vtabptr_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_FilelikeWriter", (PyObject *)&__pyx_type_5etree__FilelikeWriter) < 0) {__pyx_filename = __pyx_f[8]; __pyx_lineno = 105; goto __pyx_L1;}
__pyx_ptype_5etree__FilelikeWriter = &__pyx_type_5etree__FilelikeWriter;
__pyx_vtabptr_5etree__IterparseResolverContext = &__pyx_vtable_5etree__IterparseResolverContext;
__pyx_vtable_5etree__IterparseResolverContext.__pyx_base = *__pyx_vtabptr_5etree__ResolverContext;
*(void(**)())&__pyx_vtable_5etree__IterparseResolverContext._wrapCallbacks = (void(*)())__pyx_f_5etree_25_IterparseResolverContext__wrapCallbacks;
*(void(**)())&__pyx_vtable_5etree__IterparseResolverContext._setEventFilter = (void(*)())__pyx_f_5etree_25_IterparseResolverContext__setEventFilter;
*(void(**)())&__pyx_vtable_5etree__IterparseResolverContext.startNode = (void(*)())__pyx_f_5etree_25_IterparseResolverContext_startNode;
*(void(**)())&__pyx_vtable_5etree__IterparseResolverContext.endNode = (void(*)())__pyx_f_5etree_25_IterparseResolverContext_endNode;
__pyx_type_5etree__IterparseResolverContext.tp_base = __pyx_ptype_5etree__ResolverContext;
__pyx_type_5etree__IterparseResolverContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__IterparseResolverContext) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 51; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__IterparseResolverContext.tp_dict, __pyx_vtabptr_5etree__IterparseResolverContext) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 51; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_IterparseResolverContext", (PyObject *)&__pyx_type_5etree__IterparseResolverContext) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 51; goto __pyx_L1;}
__pyx_ptype_5etree__IterparseResolverContext = &__pyx_type_5etree__IterparseResolverContext;
__pyx_vtabptr_5etree_iterparse = &__pyx_vtable_5etree_iterparse;
__pyx_vtable_5etree_iterparse.__pyx_base = *__pyx_vtabptr_5etree__BaseParser;
__pyx_type_5etree_iterparse.tp_base = __pyx_ptype_5etree__BaseParser;
__pyx_type_5etree_iterparse.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_iterparse.tp_dict, __pyx_vtabptr_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "iterparse", (PyObject *)&__pyx_type_5etree_iterparse) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 197; goto __pyx_L1;}
__pyx_ptype_5etree_iterparse = &__pyx_type_5etree_iterparse;
__pyx_vtabptr_5etree_iterwalk = &__pyx_vtable_5etree_iterwalk;
*(void(**)())&__pyx_vtable_5etree_iterwalk._setTagFilter = (void(*)())__pyx_f_5etree_8iterwalk__setTagFilter;
*(void(**)())&__pyx_vtable_5etree_iterwalk._start_node = (void(*)())__pyx_f_5etree_8iterwalk__start_node;
*(void(**)())&__pyx_vtable_5etree_iterwalk._end_node = (void(*)())__pyx_f_5etree_8iterwalk__end_node;
__pyx_type_5etree_iterwalk.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 318; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_iterwalk.tp_dict, __pyx_vtabptr_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 318; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "iterwalk", (PyObject *)&__pyx_type_5etree_iterwalk) < 0) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 318; goto __pyx_L1;}
__pyx_ptype_5etree_iterwalk = &__pyx_type_5etree_iterwalk;
__pyx_vtabptr_5etree__IDDict = &__pyx_vtable_5etree__IDDict;
*(void(**)())&__pyx_vtable_5etree__IDDict._build_keys = (void(*)())__pyx_f_5etree_7_IDDict__build_keys;
*(void(**)())&__pyx_vtable_5etree__IDDict._build_items = (void(*)())__pyx_f_5etree_7_IDDict__build_items;
__pyx_type_5etree__IDDict.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__IDDict.tp_dict, __pyx_vtabptr_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_IDDict", (PyObject *)&__pyx_type_5etree__IDDict) < 0) {__pyx_filename = __pyx_f[10]; __pyx_lineno = 45; goto __pyx_L1;}
__pyx_ptype_5etree__IDDict = &__pyx_type_5etree__IDDict;
__pyx_vtabptr_5etree__BaseContext = &__pyx_vtable_5etree__BaseContext;
*(void(**)())&__pyx_vtable_5etree__BaseContext._copy = (void(*)())__pyx_f_5etree_12_BaseContext__copy;
*(void(**)())&__pyx_vtable_5etree__BaseContext._to_utf = (void(*)())__pyx_f_5etree_12_BaseContext__to_utf;
*(void(**)())&__pyx_vtable_5etree__BaseContext._set_xpath_context = (void(*)())__pyx_f_5etree_12_BaseContext__set_xpath_context;
*(void(**)())&__pyx_vtable_5etree__BaseContext._register_context = (void(*)())__pyx_f_5etree_12_BaseContext__register_context;
*(void(**)())&__pyx_vtable_5etree__BaseContext._unregister_context = (void(*)())__pyx_f_5etree_12_BaseContext__unregister_context;
*(void(**)())&__pyx_vtable_5etree__BaseContext._free_context = (void(*)())__pyx_f_5etree_12_BaseContext__free_context;
*(void(**)())&__pyx_vtable_5etree__BaseContext._find_cached_function = (void(*)())__pyx_f_5etree_12_BaseContext__find_cached_function;
*(void(**)())&__pyx_vtable_5etree__BaseContext._prepare_function_call = (void(*)())__pyx_f_5etree_12_BaseContext__prepare_function_call;
*(void(**)())&__pyx_vtable_5etree__BaseContext._release_temp_refs = (void(*)())__pyx_f_5etree_12_BaseContext__release_temp_refs;
*(void(**)())&__pyx_vtable_5etree__BaseContext._hold = (void(*)())__pyx_f_5etree_12_BaseContext__hold;
__pyx_type_5etree__BaseContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__BaseContext.tp_dict, __pyx_vtabptr_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_BaseContext", (PyObject *)&__pyx_type_5etree__BaseContext) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 15; goto __pyx_L1;}
__pyx_ptype_5etree__BaseContext = &__pyx_type_5etree__BaseContext;
__pyx_vtabptr_5etree__XPathContext = &__pyx_vtable_5etree__XPathContext;
__pyx_vtable_5etree__XPathContext.__pyx_base = *__pyx_vtabptr_5etree__BaseContext;
*(void(**)())&__pyx_vtable_5etree__XPathContext.register_context = (void(*)())__pyx_f_5etree_13_XPathContext_register_context;
*(void(**)())&__pyx_vtable_5etree__XPathContext.unregister_context = (void(*)())__pyx_f_5etree_13_XPathContext_unregister_context;
*(void(**)())&__pyx_vtable_5etree__XPathContext._registerVariable = (void(*)())__pyx_f_5etree_13_XPathContext__registerVariable;
__pyx_type_5etree__XPathContext.tp_base = __pyx_ptype_5etree__BaseContext;
__pyx_type_5etree__XPathContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 12; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XPathContext.tp_dict, __pyx_vtabptr_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 12; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathContext", (PyObject *)&__pyx_type_5etree__XPathContext) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 12; goto __pyx_L1;}
__pyx_ptype_5etree__XPathContext = &__pyx_type_5etree__XPathContext;
__pyx_vtabptr_5etree__XPathEvaluatorBase = &__pyx_vtable_5etree__XPathEvaluatorBase;
*(void(**)())&__pyx_vtable_5etree__XPathEvaluatorBase._checkAbsolutePath = (void(*)())__pyx_f_5etree_19_XPathEvaluatorBase__checkAbsolutePath;
*(void(**)())&__pyx_vtable_5etree__XPathEvaluatorBase._raise_parse_error = (void(*)())__pyx_f_5etree_19_XPathEvaluatorBase__raise_parse_error;
*(void(**)())&__pyx_vtable_5etree__XPathEvaluatorBase._handle_result = (void(*)())__pyx_f_5etree_19_XPathEvaluatorBase__handle_result;
__pyx_type_5etree__XPathEvaluatorBase.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 55; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XPathEvaluatorBase.tp_dict, __pyx_vtabptr_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 55; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XPathEvaluatorBase", (PyObject *)&__pyx_type_5etree__XPathEvaluatorBase) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 55; goto __pyx_L1;}
__pyx_ptype_5etree__XPathEvaluatorBase = &__pyx_type_5etree__XPathEvaluatorBase;
__pyx_vtabptr_5etree_XPathElementEvaluator = &__pyx_vtable_5etree_XPathElementEvaluator;
__pyx_vtable_5etree_XPathElementEvaluator.__pyx_base = *__pyx_vtabptr_5etree__XPathEvaluatorBase;
__pyx_type_5etree_XPathElementEvaluator.tp_base = __pyx_ptype_5etree__XPathEvaluatorBase;
__pyx_type_5etree_XPathElementEvaluator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 116; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_XPathElementEvaluator.tp_dict, __pyx_vtabptr_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 116; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPathElementEvaluator", (PyObject *)&__pyx_type_5etree_XPathElementEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 116; goto __pyx_L1;}
__pyx_ptype_5etree_XPathElementEvaluator = &__pyx_type_5etree_XPathElementEvaluator;
__pyx_vtabptr_5etree_XPathDocumentEvaluator = &__pyx_vtable_5etree_XPathDocumentEvaluator;
__pyx_vtable_5etree_XPathDocumentEvaluator.__pyx_base = *__pyx_vtabptr_5etree_XPathElementEvaluator;
__pyx_type_5etree_XPathDocumentEvaluator.tp_base = __pyx_ptype_5etree_XPathElementEvaluator;
if (PyType_Ready(&__pyx_type_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_XPathDocumentEvaluator.tp_dict, __pyx_vtabptr_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPathDocumentEvaluator", (PyObject *)&__pyx_type_5etree_XPathDocumentEvaluator) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 178; goto __pyx_L1;}
__pyx_ptype_5etree_XPathDocumentEvaluator = &__pyx_type_5etree_XPathDocumentEvaluator;
__pyx_vtabptr_5etree_XPath = &__pyx_vtable_5etree_XPath;
__pyx_vtable_5etree_XPath.__pyx_base = *__pyx_vtabptr_5etree__XPathEvaluatorBase;
__pyx_type_5etree_XPath.tp_base = __pyx_ptype_5etree__XPathEvaluatorBase;
__pyx_type_5etree_XPath.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_XPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 229; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_XPath.tp_dict, __pyx_vtabptr_5etree_XPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 229; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XPath", (PyObject *)&__pyx_type_5etree_XPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 229; goto __pyx_L1;}
__pyx_ptype_5etree_XPath = &__pyx_type_5etree_XPath;
__pyx_vtabptr_5etree_ETXPath = &__pyx_vtable_5etree_ETXPath;
__pyx_vtable_5etree_ETXPath.__pyx_base = *__pyx_vtabptr_5etree_XPath;
*(void(**)())&__pyx_vtable_5etree_ETXPath._nsextract_path = (void(*)())__pyx_f_5etree_7ETXPath__nsextract_path;
__pyx_type_5etree_ETXPath.tp_base = __pyx_ptype_5etree_XPath;
if (PyType_Ready(&__pyx_type_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_ETXPath.tp_dict, __pyx_vtabptr_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "ETXPath", (PyObject *)&__pyx_type_5etree_ETXPath) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 287; goto __pyx_L1;}
__pyx_ptype_5etree_ETXPath = &__pyx_type_5etree_ETXPath;
__pyx_vtabptr_5etree__XSLTResolverContext = &__pyx_vtable_5etree__XSLTResolverContext;
__pyx_vtable_5etree__XSLTResolverContext.__pyx_base = *__pyx_vtabptr_5etree__ResolverContext;
__pyx_type_5etree__XSLTResolverContext.tp_base = __pyx_ptype_5etree__ResolverContext;
__pyx_type_5etree__XSLTResolverContext.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 40; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XSLTResolverContext.tp_dict, __pyx_vtabptr_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 40; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTResolverContext", (PyObject *)&__pyx_type_5etree__XSLTResolverContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 40; goto __pyx_L1;}
__pyx_ptype_5etree__XSLTResolverContext = &__pyx_type_5etree__XSLTResolverContext;
__pyx_vtabptr_5etree_XSLTAccessControl = &__pyx_vtable_5etree_XSLTAccessControl;
*(void(**)())&__pyx_vtable_5etree_XSLTAccessControl._setAccess = (void(*)())__pyx_f_5etree_17XSLTAccessControl__setAccess;
*(void(**)())&__pyx_vtable_5etree_XSLTAccessControl._register_in_context = (void(*)())__pyx_f_5etree_17XSLTAccessControl__register_in_context;
if (PyType_Ready(&__pyx_type_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 154; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree_XSLTAccessControl.tp_dict, __pyx_vtabptr_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 154; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XSLTAccessControl", (PyObject *)&__pyx_type_5etree_XSLTAccessControl) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 154; goto __pyx_L1;}
__pyx_ptype_5etree_XSLTAccessControl = &__pyx_type_5etree_XSLTAccessControl;
__pyx_vtabptr_5etree__XSLTContext = &__pyx_vtable_5etree__XSLTContext;
__pyx_vtable_5etree__XSLTContext.__pyx_base = *__pyx_vtabptr_5etree__BaseContext;
*(void(**)())&__pyx_vtable_5etree__XSLTContext.register_context = (void(*)())__pyx_f_5etree_12_XSLTContext_register_context;
*(void(**)())&__pyx_vtable_5etree__XSLTContext.free_context = (void(*)())__pyx_f_5etree_12_XSLTContext_free_context;
*(void(**)())&__pyx_vtable_5etree__XSLTContext._addLocalExtensionFunction = (void(*)())__pyx_f_5etree_12_XSLTContext__addLocalExtensionFunction;
*(void(**)())&__pyx_vtable_5etree__XSLTContext._registerExtensionFunctions = (void(*)())__pyx_f_5etree_12_XSLTContext__registerExtensionFunctions;
__pyx_type_5etree__XSLTContext.tp_base = __pyx_ptype_5etree__BaseContext;
if (PyType_Ready(&__pyx_type_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 196; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XSLTContext.tp_dict, __pyx_vtabptr_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 196; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTContext", (PyObject *)&__pyx_type_5etree__XSLTContext) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 196; goto __pyx_L1;}
__pyx_ptype_5etree__XSLTContext = &__pyx_type_5etree__XSLTContext;
__pyx_vtabptr_5etree__ExsltRegExp = &__pyx_vtable_5etree__ExsltRegExp;
*(void(**)())&__pyx_vtable_5etree__ExsltRegExp._make_string = (void(*)())__pyx_f_5etree_12_ExsltRegExp__make_string;
*(void(**)())&__pyx_vtable_5etree__ExsltRegExp._compile = (void(*)())__pyx_f_5etree_12_ExsltRegExp__compile;
*(void(**)())&__pyx_vtable_5etree__ExsltRegExp._register_in_context = (void(*)())__pyx_f_5etree_12_ExsltRegExp__register_in_context;
__pyx_type_5etree__ExsltRegExp.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 646; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__ExsltRegExp.tp_dict, __pyx_vtabptr_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 646; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_ExsltRegExp", (PyObject *)&__pyx_type_5etree__ExsltRegExp) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 646; goto __pyx_L1;}
__pyx_ptype_5etree__ExsltRegExp = &__pyx_type_5etree__ExsltRegExp;
__pyx_type_5etree_XSLT.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 266; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XSLT", (PyObject *)&__pyx_type_5etree_XSLT) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 266; goto __pyx_L1;}
__pyx_ptype_5etree_XSLT = &__pyx_type_5etree_XSLT;
__pyx_vtabptr_5etree__XSLTResultTree = &__pyx_vtable_5etree__XSLTResultTree;
__pyx_vtable_5etree__XSLTResultTree.__pyx_base = *__pyx_vtabptr_5etree__ElementTree;
*(void(**)())&__pyx_vtable_5etree__XSLTResultTree._saveToStringAndSize = (void(*)())__pyx_f_5etree_15_XSLTResultTree__saveToStringAndSize;
__pyx_type_5etree__XSLTResultTree.tp_base = __pyx_ptype_5etree__ElementTree;
__pyx_type_5etree__XSLTResultTree.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 460; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XSLTResultTree.tp_dict, __pyx_vtabptr_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 460; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTResultTree", (PyObject *)&__pyx_type_5etree__XSLTResultTree) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 460; goto __pyx_L1;}
__pyx_ptype_5etree__XSLTResultTree = &__pyx_type_5etree__XSLTResultTree;
__pyx_vtabptr_5etree__XSLTProcessingInstruction = &__pyx_vtable_5etree__XSLTProcessingInstruction;
__pyx_vtable_5etree__XSLTProcessingInstruction.__pyx_base = *__pyx_vtabptr_5etree_PIBase;
__pyx_type_5etree__XSLTProcessingInstruction.tp_base = __pyx_ptype_5etree_PIBase;
if (PyType_Ready(&__pyx_type_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 570; goto __pyx_L1;}
if (__Pyx_SetVtable(__pyx_type_5etree__XSLTProcessingInstruction.tp_dict, __pyx_vtabptr_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 570; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_XSLTProcessingInstruction", (PyObject *)&__pyx_type_5etree__XSLTProcessingInstruction) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 570; goto __pyx_L1;}
__pyx_ptype_5etree__XSLTProcessingInstruction = &__pyx_type_5etree__XSLTProcessingInstruction;
__pyx_type_5etree__Validator.tp_free = _PyObject_GC_Del;
if (PyType_Ready(&__pyx_type_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "_Validator", (PyObject *)&__pyx_type_5etree__Validator) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1850; goto __pyx_L1;}
__pyx_ptype_5etree__Validator = &__pyx_type_5etree__Validator;
__pyx_type_5etree_RelaxNG.tp_base = __pyx_ptype_5etree__Validator;
if (PyType_Ready(&__pyx_type_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 16; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "RelaxNG", (PyObject *)&__pyx_type_5etree_RelaxNG) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_ptype_5etree_RelaxNG = &__pyx_type_5etree_RelaxNG;
__pyx_type_5etree_XMLSchema.tp_base = __pyx_ptype_5etree__Validator;
if (PyType_Ready(&__pyx_type_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 16; goto __pyx_L1;}
if (PyObject_SetAttrString(__pyx_m, "XMLSchema", (PyObject *)&__pyx_type_5etree_XMLSchema) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 16; goto __pyx_L1;}
__pyx_ptype_5etree_XMLSchema = &__pyx_type_5etree_XMLSchema;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":10 */
__pyx_1 = __Pyx_Import(__pyx_n___builtin__, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n___builtin__, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":13 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_True); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_5etree_True);
__pyx_v_5etree_True = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":14 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_False); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_5etree_False);
__pyx_v_5etree_False = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":17 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":18 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L3;}
  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_set); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; goto __pyx_L3;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  Py_DECREF(__pyx_v_5etree_set);
  __pyx_v_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/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":19 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_AttributeError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
__pyx_3 = PyErr_ExceptionMatches(__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
  __Pyx_AddTraceback("etree");
  __pyx_2 = __Pyx_GetExcValue(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":20 */
  __pyx_1 = PyList_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_INCREF(__pyx_n_Set);
  PyList_SET_ITEM(__pyx_1, 0, __pyx_n_Set);
  __pyx_2 = __Pyx_Import(__pyx_n_sets, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_Set); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; goto __pyx_L1;}
  Py_DECREF(__pyx_v_5etree_set);
  __pyx_v_5etree_set = __pyx_1;
  __pyx_1 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  goto __pyx_L4;
}
goto __pyx_L1;
__pyx_L4:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":23 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_id); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 23; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_5etree_id);
__pyx_v_5etree_id = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":25 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_super); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_5etree_super);
__pyx_v_5etree_super = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":28 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n___builtin__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
__pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_StopIteration); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 28; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_5etree_StopIteration);
__pyx_v_5etree_StopIteration = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":30 */
if (PyObject_DelAttrString(__pyx_m, "__builtin__") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":33 */
__pyx_2 = __Pyx_Import(__pyx_n__elementpath, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree__elementpath);
__pyx_v_5etree__elementpath = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":36 */
__pyx_1 = __Pyx_Import(__pyx_n_sys, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree_sys);
__pyx_v_5etree_sys = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":39 */
__pyx_2 = __Pyx_Import(__pyx_n_re, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree_re);
__pyx_v_5etree_re = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":42 */
__pyx_1 = PyTuple_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
__pyx_2 = iter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_v_5etree_ITER_EMPTY);
__pyx_v_5etree_ITER_EMPTY = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":53 */
__pyx_v_5etree___DEBUG = 1;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":57 */
__pyx_v_5etree___MAX_LOG_SIZE = 100;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":60 */
__pyx_1 = PyInt_FromLong(__pyx_v_5etree___DEBUG); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_DEBUG, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":63 */
xmlThrDefIndentTreeOutput(1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":64 */
xmlThrDefLineNumbersDefaultValue(1);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":66 */
__pyx_f_5etree__initThreadLogging();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":69 */
xmlInitParser();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":73 */
__pyx_2 = PyObject_GetAttr(__pyx_v_5etree_sys, __pyx_n_getfilesystemencoding); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
__pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_5etree__FILENAME_ENCODING);
__pyx_v_5etree__FILENAME_ENCODING = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":74 */
__pyx_3 = __pyx_v_5etree__FILENAME_ENCODING == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":75 */
  __pyx_2 = PyObject_GetAttr(__pyx_v_5etree_sys, __pyx_n_getdefaultencoding); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; goto __pyx_L1;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  Py_DECREF(__pyx_v_5etree__FILENAME_ENCODING);
  __pyx_v_5etree__FILENAME_ENCODING = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L5;
}
__pyx_L5:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":76 */
__pyx_3 = __pyx_v_5etree__FILENAME_ENCODING == Py_None;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":77 */
  Py_INCREF(__pyx_n_ascii);
  Py_DECREF(__pyx_v_5etree__FILENAME_ENCODING);
  __pyx_v_5etree__FILENAME_ENCODING = __pyx_n_ascii;
  goto __pyx_L6;
}
__pyx_L6:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":79 */
__pyx_v_5etree__C_FILENAME_ENCODING = _cstr(__pyx_v_5etree__FILENAME_ENCODING);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":83 */
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_4, __pyx_2, __pyx_n_Error, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":84 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_Error, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":87 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_Error); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
__pyx_1 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_4, __pyx_n_LxmlError, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":88 */
__pyx_2 = PyCFunction_New(&__pyx_mdef_5etree_9LxmlError___init__, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; goto __pyx_L1;}
__pyx_5 = PyMethod_New(__pyx_2, 0, __pyx_1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; 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[0]; __pyx_lineno = 88; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlError, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":93 */
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree__LxmlError);
__pyx_v_5etree__LxmlError = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":99 */
__pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_type); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; goto __pyx_L1;}
__pyx_3 = isinstance(__pyx_v_5etree__LxmlError,__pyx_5);
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":100 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n__superError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; goto __pyx_L1;}
  Py_DECREF(__pyx_v_5etree__initError);
  __pyx_v_5etree__initError = __pyx_1;
  __pyx_1 = 0;
  goto __pyx_L7;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":102 */
  __pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_Error); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
  __pyx_2 = PyObject_GetAttr(__pyx_4, __pyx_n___init__); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_v_5etree__initError);
  __pyx_v_5etree__initError = __pyx_2;
  __pyx_2 = 0;
}
__pyx_L7:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":104 */
if (PyObject_DelAttrString(__pyx_m, "_superError") < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 104; goto __pyx_L1;}

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":108 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_b, __pyx_n_SyntaxError); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_1 = 0;
__pyx_4 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_5, __pyx_n_LxmlSyntaxError, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":109 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":111 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
__pyx_2 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_1, __pyx_4, __pyx_n_DocumentInvalid, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":112 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_DocumentInvalid, __pyx_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":114 */
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
__pyx_1 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_2, __pyx_n_XIncludeError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":115 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XIncludeError, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":117 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_5);
__pyx_5 = 0;
__pyx_2 = __Pyx_CreateClass(__pyx_4, __pyx_1, __pyx_n_C14NError, "etree"); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":118 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_C14NError, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":145 */
/*try:*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":146 */
  __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_int); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  __pyx_4 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_match); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  __pyx_2 = PyString_FromString(xmlParserVersion); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_INCREF(__pyx_k24p);
  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k24p);
  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_2);
  __pyx_2 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_4, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_4 = PyObject_GetAttr(__pyx_2, __pyx_n_group); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_1 = PyInt_FromLong(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
  __pyx_1 = 0;
  __pyx_1 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_1);
  __pyx_1 = 0;
  __pyx_2 = PyObject_CallObject(__pyx_5, __pyx_4); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  __pyx_3 = PyInt_AsLong(__pyx_2); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; goto __pyx_L8;}
  Py_DECREF(__pyx_2); __pyx_2 = 0;
  __pyx_v_5etree__LIBXML_VERSION_INT = __pyx_3;
}
goto __pyx_L9;
__pyx_L8:;
Py_XDECREF(__pyx_1); __pyx_1 = 0;
Py_XDECREF(__pyx_5); __pyx_5 = 0;
Py_XDECREF(__pyx_4); __pyx_4 = 0;
Py_XDECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":147 */
__pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_Exception); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
__pyx_3 = PyErr_ExceptionMatches(__pyx_1);
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (__pyx_3) {
  __Pyx_AddTraceback("etree");
  __pyx_5 = __Pyx_GetExcValue(); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; goto __pyx_L1;}
  Py_DECREF(__pyx_5); __pyx_5 = 0;

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":148 */
  if (__Pyx_PrintItem(__pyx_k25p) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  __pyx_4 = PyString_FromString(xmlParserVersion); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  if (__Pyx_PrintItem(__pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}
  Py_DECREF(__pyx_4); __pyx_4 = 0;
  if (__Pyx_PrintNewline() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; goto __pyx_L1;}

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":149 */
  __pyx_v_5etree__LIBXML_VERSION_INT = 0;
  goto __pyx_L9;
}
goto __pyx_L1;
__pyx_L9:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":151 */
__pyx_2 = __pyx_f_5etree___unpackIntVersion(__pyx_v_5etree__LIBXML_VERSION_INT); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXML_VERSION, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":152 */
__pyx_1 = __pyx_f_5etree___unpackIntVersion(LIBXML_VERSION); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXML_COMPILED_VERSION, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":153 */
__pyx_5 = PyString_FromString(LXML_VERSION_STRING); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
__pyx_4 = __pyx_f_5etree___unpackDottedVersion(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_LXML_VERSION, __pyx_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":155 */
__pyx_2 = PyString_FromString(LXML_VERSION_STRING); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n___version__, __pyx_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":203 */
Py_INCREF(Py_None);
__pyx_k26 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":751 */
Py_INCREF(Py_None);
__pyx_k27 = Py_None;
Py_INCREF(Py_None);
__pyx_k28 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":823 */
Py_INCREF(Py_None);
__pyx_k29 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":885 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k30 = __pyx_v_5etree_False;
Py_INCREF(Py_None);
__pyx_k31 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":895 */
Py_INCREF(Py_None);
__pyx_k32 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":903 */
Py_INCREF(Py_None);
__pyx_k33 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":912 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k34 = __pyx_v_5etree_False;
Py_INCREF(Py_None);
__pyx_k35 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":930 */
Py_INCREF(Py_None);
__pyx_k36 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":939 */
Py_INCREF(Py_None);
__pyx_k37 = Py_None;
Py_INCREF(Py_None);
__pyx_k38 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":952 */
Py_INCREF(Py_None);
__pyx_k39 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":966 */
Py_INCREF(Py_None);
__pyx_k40 = Py_None;
Py_INCREF(Py_None);
__pyx_k41 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":974 */
__pyx_3 = ENABLE_THREADING;
if (__pyx_3) {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":975 */
  __pyx_v_5etree_ELEMENT_CREATION_LOCK = PyThread_allocate_lock();
  goto __pyx_L10;
}
/*else*/ {

  /* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":977 */
  __pyx_v_5etree_ELEMENT_CREATION_LOCK = NULL;
}
__pyx_L10:;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1058 */
Py_INCREF(Py_None);
__pyx_k42 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1116 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k43 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1160 */
Py_INCREF(Py_None);
__pyx_k44 = Py_None;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k45 = __pyx_v_5etree_False;
Py_INCREF(Py_None);
__pyx_k46 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1201 */
Py_INCREF(Py_None);
__pyx_k47 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1219 */
Py_INCREF(Py_None);
__pyx_k48 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1238 */
Py_INCREF(Py_None);
__pyx_k49 = Py_None;
Py_INCREF(Py_None);
__pyx_k50 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1258 */
Py_INCREF(Py_None);
__pyx_k51 = Py_None;
Py_INCREF(Py_None);
__pyx_k52 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1394 */
Py_INCREF(Py_None);
__pyx_k53 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1538 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k54 = __pyx_v_5etree_False;
Py_INCREF(Py_None);
__pyx_k55 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1560 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k56 = __pyx_v_5etree_False;
Py_INCREF(Py_None);
__pyx_k57 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1570 */
Py_INCREF(Py_None);
__pyx_k58 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1592 */
Py_INCREF(Py_None);
__pyx_k59 = Py_None;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k60 = __pyx_v_5etree_True;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1649 */
Py_INCREF(Py_None);
__pyx_k61 = Py_None;
Py_INCREF(Py_None);
__pyx_k62 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1657 */
Py_INCREF(Py_None);
__pyx_k63 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1674 */
Py_INCREF(Py_None);
__pyx_k64 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1692 */
Py_INCREF(Py_None);
__pyx_k65 = Py_None;
Py_INCREF(Py_None);
__pyx_k66 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1708 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__Element)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k67 = ((struct LxmlElement *)Py_None);
Py_INCREF(Py_None);
__pyx_k68 = Py_None;
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1708; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k69 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1728 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1728; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k70 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1740 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1740; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k71 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1752 */
__pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_XML); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_fromstring, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1752; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1759 */
Py_INCREF(__pyx_v_5etree_True);
__pyx_k72 = __pyx_v_5etree_True;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1765 */
Py_INCREF(Py_None);
__pyx_k73 = Py_None;
Py_INCREF(Py_None);
__pyx_k74 = Py_None;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k75 = __pyx_v_5etree_False;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1800 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k76 = __pyx_v_5etree_False;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/etree.pyx":1820 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1820; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k77 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":235 */
__pyx_5 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; goto __pyx_L1;}
__pyx_4 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_U); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; goto __pyx_L1;}
__pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; goto __pyx_L1;}
Py_INCREF(__pyx_k78p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k78p);
PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
__pyx_4 = 0;
__pyx_1 = PyObject_CallObject(__pyx_5, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 235; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_v_5etree___RE_XML_ENCODING);
__pyx_v_5etree___RE_XML_ENCODING = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":239 */
__pyx_4 = PyObject_GetAttr(__pyx_v_5etree___RE_XML_ENCODING, __pyx_n_sub); if (!__pyx_4) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 239; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree___REPLACE_XML_ENCODING);
__pyx_v_5etree___REPLACE_XML_ENCODING = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/apihelpers.pxi":242 */
__pyx_5 = PyObject_GetAttr(__pyx_v_5etree___RE_XML_ENCODING, __pyx_n_match); if (!__pyx_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 242; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree___HAS_XML_ENCODING);
__pyx_v_5etree___HAS_XML_ENCODING = __pyx_5;
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":84 */
Py_INCREF(Py_None);
__pyx_k79 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":126 */
Py_INCREF(Py_None);
__pyx_k80 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":265 */
Py_INCREF(Py_None);
__pyx_k81 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":293 */
__pyx_2 = PyInt_FromLong(__pyx_v_5etree___MAX_LOG_SIZE); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
__pyx_2 = 0;
__pyx_4 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__RotatingErrorLog), __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
if (!__Pyx_TypeTest(__pyx_4, __pyx_ptype_5etree__BaseErrorLog)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 293; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree___GLOBAL_ERROR_LOG));
__pyx_v_5etree___GLOBAL_ERROR_LOG = ((struct __pyx_obj_5etree__BaseErrorLog *)__pyx_4);
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":410 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; goto __pyx_L1;}
if (PyDict_SetItemString(__pyx_5, "__doc__", __pyx_k83p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_5, __pyx_n_ErrorLevels, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorLevels, __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 410; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":413 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 413; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 413; goto __pyx_L1;}
if (PyDict_SetItemString(__pyx_4, "__doc__", __pyx_k85p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 413; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_4, __pyx_n_ErrorDomains, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 413; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorDomains, __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 413; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":416 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 416; goto __pyx_L1;}
__pyx_2 = PyTuple_New(0); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 416; goto __pyx_L1;}
if (PyDict_SetItemString(__pyx_5, "__doc__", __pyx_k87p) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 416; goto __pyx_L1;}
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_5, __pyx_n_ErrorTypes, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 416; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;
if (PyObject_SetAttr(__pyx_m, __pyx_n_ErrorTypes, __pyx_1) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 416; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":428 */
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 428; goto __pyx_L1;}
Py_INCREF(__pyx_k88p);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k88p);
Py_DECREF(__pyx_v_5etree___ERROR_LEVELS);
__pyx_v_5etree___ERROR_LEVELS = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":436 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 436; goto __pyx_L1;}
Py_INCREF(__pyx_k89p);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k89p);
Py_DECREF(__pyx_v_5etree___ERROR_DOMAINS);
__pyx_v_5etree___ERROR_DOMAINS = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":468 */
__pyx_1 = PyTuple_New(10); if (!__pyx_1) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 468; goto __pyx_L1;}
Py_INCREF(__pyx_k90p);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k90p);
Py_INCREF(__pyx_k91p);
PyTuple_SET_ITEM(__pyx_1, 1, __pyx_k91p);
Py_INCREF(__pyx_k92p);
PyTuple_SET_ITEM(__pyx_1, 2, __pyx_k92p);
Py_INCREF(__pyx_k93p);
PyTuple_SET_ITEM(__pyx_1, 3, __pyx_k93p);
Py_INCREF(__pyx_k94p);
PyTuple_SET_ITEM(__pyx_1, 4, __pyx_k94p);
Py_INCREF(__pyx_k95p);
PyTuple_SET_ITEM(__pyx_1, 5, __pyx_k95p);
Py_INCREF(__pyx_k96p);
PyTuple_SET_ITEM(__pyx_1, 6, __pyx_k96p);
Py_INCREF(__pyx_k97p);
PyTuple_SET_ITEM(__pyx_1, 7, __pyx_k97p);
Py_INCREF(__pyx_k98p);
PyTuple_SET_ITEM(__pyx_1, 8, __pyx_k98p);
Py_INCREF(__pyx_k99p);
PyTuple_SET_ITEM(__pyx_1, 9, __pyx_k99p);
Py_DECREF(__pyx_v_5etree___ERROR_TYPES);
__pyx_v_5etree___ERROR_TYPES = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlerror.pxi":1216 */
__pyx_f_5etree___initErrorConstants();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":59 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 59; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k100 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":86 */
Py_INCREF(Py_None);
__pyx_k101 = Py_None;
Py_INCREF(Py_None);
__pyx_k102 = Py_None;
Py_INCREF(Py_None);
__pyx_k103 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":139 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 139; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k104 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":159 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 160; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k105 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":190 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k106 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":219 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 219; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k107 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":270 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 270; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k108 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":278 */
__pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_ParserBasedElementClassLookup), 0); if (!__pyx_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_5etree_ParserBasedElementClassLookup)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 278; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP = ((struct __pyx_obj_5etree_ParserBasedElementClassLookup *)__pyx_5);
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/classlookup.pxi":280 */
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_setElementClassLookup); if (!__pyx_4) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 280; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 280; goto __pyx_L1;}
Py_INCREF(((PyObject *)__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
PyTuple_SET_ITEM(__pyx_2, 0, ((PyObject *)__pyx_v_5etree_DEFAULT_ELEMENT_CLASS_LOOKUP));
__pyx_1 = PyObject_CallObject(__pyx_4, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 280; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_2); __pyx_2 = 0;
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":3 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_5, __pyx_n_LxmlRegistryError, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":4 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_LxmlRegistryError, __pyx_1) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":6 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlRegistryError); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 6; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
__pyx_2 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_1, __pyx_4, __pyx_n_NamespaceRegistryError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":7 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_NamespaceRegistryError, __pyx_5) < 0) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":10 */
__pyx_2 = PyDict_New(); if (!__pyx_2) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree___NAMESPACE_REGISTRIES);
__pyx_v_5etree___NAMESPACE_REGISTRIES = __pyx_2;
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/nsclasses.pxi":13 */
__pyx_1 = PyDict_New(); if (!__pyx_1) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 13; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES);
__pyx_v_5etree___FUNCTION_NAMESPACE_REGISTRIES = __pyx_1;
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/docloader.pxi":55 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_Resolver)) {__pyx_filename = __pyx_f[6]; __pyx_lineno = 55; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k111 = ((struct __pyx_obj_5etree_Resolver *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":7 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlSyntaxError); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 7; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_4);
__pyx_4 = 0;
__pyx_1 = __Pyx_CreateClass(__pyx_2, __pyx_5, __pyx_n_XMLSyntaxError, "etree"); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_2); __pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":8 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSyntaxError, __pyx_1) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":10 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 10; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_2);
__pyx_2 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_1, __pyx_4, __pyx_n_ParserError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_1); __pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":11 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_ParserError, __pyx_5) < 0) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":120 */
__pyx_2 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree__ParserContext), 0); if (!__pyx_2) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_5etree__ParserContext)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 120; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT));
__pyx_v_5etree___GLOBAL_PARSER_CONTEXT = ((struct __pyx_obj_5etree__ParserContext *)__pyx_2);
__pyx_2 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":121 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->initMainParserContext(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":139 */
__pyx_v_5etree__UNICODE_ENCODING = NULL;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":176 */
__pyx_f_5etree__setupPythonUnicode();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":189 */
Py_INCREF(Py_None);
__pyx_k114 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":336 */
__pyx_v_5etree___DEFAULT_ENTITY_LOADER = xmlGetExternalEntityLoader();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":338 */
xmlSetExternalEntityLoader(__pyx_f_5etree__local_resolver);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":354 */
Py_INCREF(((PyObject*)__pyx_ptype_5etree__ResolverContext));
__pyx_k115 = ((PyObject*)__pyx_ptype_5etree__ResolverContext);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":419 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree_ElementClassLookup)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 419; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k116 = ((struct LxmlElementClassLookup *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":441 */
Py_INCREF(Py_None);
__pyx_k117 = Py_None;
Py_INCREF(Py_None);
__pyx_k118 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":630 */
__pyx_v_5etree__XML_DEFAULT_PARSE_OPTIONS = (XML_PARSE_NOENT | XML_PARSE_NOCDATA);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":663 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k119 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k120 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k121 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k122 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k123 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k124 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k125 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k126 = __pyx_v_5etree_True;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":737 */
__pyx_1 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XMLParser), 0); if (!__pyx_1) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 737; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_5etree_XMLParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 737; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree___DEFAULT_XML_PARSER));
__pyx_v_5etree___DEFAULT_XML_PARSER = ((struct __pyx_obj_5etree_XMLParser *)__pyx_1);
__pyx_1 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":739 */
((struct __pyx_vtabstruct_5etree__ParserContext *)__pyx_v_5etree___GLOBAL_PARSER_CONTEXT->__pyx_vtab)->setDefaultParser(__pyx_v_5etree___GLOBAL_PARSER_CONTEXT,((struct __pyx_obj_5etree__BaseParser *)__pyx_v_5etree___DEFAULT_XML_PARSER));

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":741 */
if (!__Pyx_TypeTest(Py_None, __pyx_ptype_5etree__BaseParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 741; goto __pyx_L1;}
Py_INCREF(Py_None);
__pyx_k127 = ((struct __pyx_obj_5etree__BaseParser *)Py_None);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":771 */
__pyx_v_5etree__HTML_DEFAULT_PARSE_OPTIONS = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":790 */
Py_INCREF(__pyx_v_5etree_True);
__pyx_k128 = __pyx_v_5etree_True;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k129 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k130 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k131 = __pyx_v_5etree_True;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/parser.pxi":808 */
__pyx_5 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_HTMLParser), 0); if (!__pyx_5) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 808; goto __pyx_L1;}
if (!__Pyx_TypeTest(__pyx_5, __pyx_ptype_5etree_HTMLParser)) {__pyx_filename = __pyx_f[7]; __pyx_lineno = 808; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree___DEFAULT_HTML_PARSER));
__pyx_v_5etree___DEFAULT_HTML_PARSER = ((struct __pyx_obj_5etree_HTMLParser *)__pyx_5);
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/serializer.pxi":109 */
Py_INCREF(Py_None);
__pyx_k132 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":4 */
__pyx_4 = PyInt_FromLong(16384); if (!__pyx_4) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree___ITERPARSE_CHUNK_SIZE);
__pyx_v_5etree___ITERPARSE_CHUNK_SIZE = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":230 */
__pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 230; goto __pyx_L1;}
Py_INCREF(__pyx_n_end);
PyTuple_SET_ITEM(__pyx_2, 0, __pyx_n_end);
__pyx_k134 = __pyx_2;
__pyx_2 = 0;
Py_INCREF(Py_None);
__pyx_k135 = Py_None;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k136 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k137 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k138 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k139 = __pyx_v_5etree_False;
Py_INCREF(__pyx_v_5etree_False);
__pyx_k140 = __pyx_v_5etree_False;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/iterparse.pxi":332 */
__pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[9]; __pyx_lineno = 332; goto __pyx_L1;}
Py_INCREF(__pyx_n_end);
PyTuple_SET_ITEM(__pyx_1, 0, __pyx_n_end);
__pyx_k142 = __pyx_1;
__pyx_1 = 0;
Py_INCREF(Py_None);
__pyx_k143 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlid.pxi":33 */
Py_INCREF(Py_None);
__pyx_k144 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":3 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_6, __pyx_5, __pyx_n_XPathError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":4 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathError, __pyx_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":6 */
__pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_6, __pyx_n_XPathFunctionError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":7 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathFunctionError, __pyx_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":9 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_6, __pyx_5, __pyx_n_XPathResultError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":10 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathResultError, __pyx_4) < 0) {__pyx_filename = __pyx_f[11]; __pyx_lineno = 9; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/extensions.pxi":217 */
Py_INCREF(Py_None);
__pyx_k148 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":3 */
__pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
__pyx_4 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_5, __pyx_6, __pyx_n_XPathContextError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":4 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathContextError, __pyx_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 3; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":6 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlSyntaxError); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XPathError); if (!__pyx_6) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
__pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_4);
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_6);
__pyx_4 = 0;
__pyx_6 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_7, __pyx_5, __pyx_n_XPathSyntaxError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":7 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XPathSyntaxError, __pyx_4) < 0) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 6; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":59 */
Py_INCREF(Py_None);
__pyx_k151 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":125 */
Py_INCREF(Py_None);
__pyx_k152 = Py_None;
Py_INCREF(Py_None);
__pyx_k153 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":183 */
Py_INCREF(Py_None);
__pyx_k154 = Py_None;
Py_INCREF(Py_None);
__pyx_k155 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":215 */
Py_INCREF(Py_None);
__pyx_k156 = Py_None;
Py_INCREF(Py_None);
__pyx_k157 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":240 */
Py_INCREF(Py_None);
__pyx_k158 = Py_None;
Py_INCREF(Py_None);
__pyx_k159 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":284 */
__pyx_6 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_6) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 284; goto __pyx_L1;}
__pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 284; goto __pyx_L1;}
Py_INCREF(__pyx_k160p);
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_k160p);
__pyx_4 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 284; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;
__pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_sub); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 284; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_5etree__replace_strings);
__pyx_v_5etree__replace_strings = __pyx_5;
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":285 */
__pyx_6 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_6) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 285; goto __pyx_L1;}
__pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 285; goto __pyx_L1;}
Py_INCREF(__pyx_k161p);
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_k161p);
__pyx_4 = PyObject_CallObject(__pyx_6, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 285; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;
__pyx_5 = PyObject_GetAttr(__pyx_4, __pyx_n_findall); if (!__pyx_5) {__pyx_filename = __pyx_f[12]; __pyx_lineno = 285; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_5etree__find_namespaces);
__pyx_v_5etree__find_namespaces = __pyx_5;
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xpath.pxi":290 */
Py_INCREF(Py_None);
__pyx_k162 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":5 */
__pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 5; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 5; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_7);
__pyx_7 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_4, __pyx_6, __pyx_n_XSLTError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 5; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":6 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTError, __pyx_5) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 5; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":8 */
__pyx_7 = PyDict_New(); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_4);
__pyx_4 = 0;
__pyx_6 = __Pyx_CreateClass(__pyx_5, __pyx_7, __pyx_n_XSLTParseError, "etree"); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":9 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTParseError, __pyx_6) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 8; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":11 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_5);
__pyx_5 = 0;
__pyx_7 = __Pyx_CreateClass(__pyx_6, __pyx_4, __pyx_n_XSLTApplyError, "etree"); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":12 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTApplyError, __pyx_7) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 11; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":14 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}
__pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_6);
__pyx_6 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_7, __pyx_5, __pyx_n_XSLTSaveError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":15 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTSaveError, __pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 14; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":17 */
__pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_XSLTError); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_7);
__pyx_7 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_4, __pyx_6, __pyx_n_XSLTExtensionError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":18 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XSLTExtensionError, __pyx_5) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 17; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":21 */
__pyx_7 = __pyx_f_5etree___unpackIntVersion(LIBXSLT_VERSION); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXSLT_COMPILED_VERSION, __pyx_7) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 21; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":22 */
__pyx_4 = __pyx_f_5etree___unpackIntVersion(xsltLibxsltVersion); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 22; goto __pyx_L1;}
if (PyObject_SetAttr(__pyx_m, __pyx_n_LIBXSLT_VERSION, __pyx_4) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 22; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":147 */
__pyx_v_5etree_XSLT_DOC_DEFAULT_LOADER = xsltDocDefaultLoader;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":149 */
xsltSetLoaderFunc(__pyx_f_5etree__xslt_doc_loader);

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":167 */
Py_INCREF(__pyx_v_5etree_True);
__pyx_k168 = __pyx_v_5etree_True;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k169 = __pyx_v_5etree_True;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k170 = __pyx_v_5etree_True;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k171 = __pyx_v_5etree_True;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k172 = __pyx_v_5etree_True;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":276 */
Py_INCREF(Py_None);
__pyx_k173 = Py_None;
Py_INCREF(__pyx_v_5etree_True);
__pyx_k174 = __pyx_v_5etree_True;
Py_INCREF(Py_None);
__pyx_k175 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":340 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k176 = __pyx_v_5etree_False;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":452 */
Py_INCREF(__pyx_v_5etree_False);
__pyx_k177 = __pyx_v_5etree_False;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":530 */
xsltRegisterAllExtras();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":533 */
exsltRegisterAll();

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":554 */
__pyx_5 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 554; goto __pyx_L1;}
__pyx_6 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_U); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 554; goto __pyx_L1;}
__pyx_7 = PyTuple_New(2); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 554; goto __pyx_L1;}
Py_INCREF(__pyx_k178p);
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_k178p);
PyTuple_SET_ITEM(__pyx_7, 1, __pyx_6);
__pyx_6 = 0;
__pyx_4 = PyObject_CallObject(__pyx_5, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 554; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;
__pyx_6 = PyObject_GetAttr(__pyx_4, __pyx_n_findall); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 554; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_v_5etree__FIND_PI_ATTRIBUTES);
__pyx_v_5etree__FIND_PI_ATTRIBUTES = __pyx_6;
__pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":557 */
__pyx_5 = PyObject_GetAttr(__pyx_v_5etree_re, __pyx_n_compile); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 557; goto __pyx_L1;}
__pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 557; goto __pyx_L1;}
Py_INCREF(__pyx_k179p);
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_k179p);
__pyx_4 = PyObject_CallObject(__pyx_5, __pyx_7); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 557; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;
Py_DECREF(__pyx_v_5etree__RE_PI_HREF);
__pyx_v_5etree__RE_PI_HREF = __pyx_4;
__pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":560 */
__pyx_6 = PyObject_GetAttr(__pyx_v_5etree__RE_PI_HREF, __pyx_n_findall); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 560; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree__FIND_PI_HREF);
__pyx_v_5etree__FIND_PI_HREF = __pyx_6;
__pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":563 */
__pyx_5 = PyObject_GetAttr(__pyx_v_5etree__RE_PI_HREF, __pyx_n_sub); if (!__pyx_5) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 563; goto __pyx_L1;}
Py_DECREF(__pyx_v_5etree__REPLACE_PI_HREF);
__pyx_v_5etree__REPLACE_PI_HREF = __pyx_5;
__pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":566 */
__pyx_7 = PyDict_New(); if (!__pyx_7) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 568; goto __pyx_L1;}
if (PyDict_SetItem(__pyx_7, __pyx_n_xsl, __pyx_k182p) < 0) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 568; goto __pyx_L1;}
__pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 566; goto __pyx_L1;}
Py_INCREF(__pyx_k180p);
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k180p);
PyTuple_SET_ITEM(__pyx_4, 1, __pyx_7);
__pyx_7 = 0;
__pyx_6 = PyObject_CallObject(((PyObject*)__pyx_ptype_5etree_XPath), __pyx_4); if (!__pyx_6) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 566; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
if (!__Pyx_TypeTest(__pyx_6, __pyx_ptype_5etree_XPath)) {__pyx_filename = __pyx_f[13]; __pyx_lineno = 566; goto __pyx_L1;}
Py_DECREF(((PyObject *)__pyx_v_5etree__findStylesheetByID));
__pyx_v_5etree__findStylesheetByID = ((struct __pyx_obj_5etree_XPath *)__pyx_6);
__pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":571 */
Py_INCREF(Py_None);
__pyx_k183 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":637 */
Py_INCREF(Py_None);
__pyx_k184 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":671 */
Py_INCREF(__pyx_k185p);
__pyx_k186 = __pyx_k185p;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xslt.pxi":680 */
Py_INCREF(__pyx_k187p);
__pyx_k188 = __pyx_k187p;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":4 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_7) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_7);
__pyx_7 = 0;
__pyx_6 = __Pyx_CreateClass(__pyx_4, __pyx_5, __pyx_n_RelaxNGError, "etree"); if (!__pyx_6) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":5 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGError, __pyx_6) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":7 */
__pyx_7 = PyDict_New(); if (!__pyx_7) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGError); if (!__pyx_4) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 7; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_6, __pyx_7, __pyx_n_RelaxNGParseError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":8 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGParseError, __pyx_5) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":10 */
__pyx_4 = PyDict_New(); if (!__pyx_4) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_6 = __Pyx_GetName(__pyx_m, __pyx_n_RelaxNGError); if (!__pyx_6) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_5, 0, __pyx_6);
__pyx_6 = 0;
__pyx_7 = __Pyx_CreateClass(__pyx_5, __pyx_4, __pyx_n_RelaxNGValidateError, "etree"); if (!__pyx_7) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":11 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_RelaxNGValidateError, __pyx_7) < 0) {__pyx_filename = __pyx_f[14]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/relaxng.pxi":21 */
Py_INCREF(Py_None);
__pyx_k192 = Py_None;
Py_INCREF(Py_None);
__pyx_k193 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":4 */
__pyx_6 = PyDict_New(); if (!__pyx_6) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_5 = __Pyx_GetName(__pyx_m, __pyx_n_LxmlError); if (!__pyx_5) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
__pyx_7 = PyTuple_New(1); if (!__pyx_7) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_7, 0, __pyx_5);
__pyx_5 = 0;
__pyx_4 = __Pyx_CreateClass(__pyx_7, __pyx_6, __pyx_n_XMLSchemaError, "etree"); if (!__pyx_4) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":5 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaError, __pyx_4) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 4; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":7 */
__pyx_5 = PyDict_New(); if (!__pyx_5) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_7 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (!__pyx_7) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 7; goto __pyx_L1;}
__pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 7; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_4, 0, __pyx_7);
__pyx_7 = 0;
__pyx_6 = __Pyx_CreateClass(__pyx_4, __pyx_5, __pyx_n_XMLSchemaParseError, "etree"); if (!__pyx_6) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_4); __pyx_4 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":8 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaParseError, __pyx_6) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 7; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;
Py_DECREF(__pyx_5); __pyx_5 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":10 */
__pyx_7 = PyDict_New(); if (!__pyx_7) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_4 = __Pyx_GetName(__pyx_m, __pyx_n_XMLSchemaError); if (!__pyx_4) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 10; goto __pyx_L1;}
__pyx_6 = PyTuple_New(1); if (!__pyx_6) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 10; goto __pyx_L1;}
PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
__pyx_4 = 0;
__pyx_5 = __Pyx_CreateClass(__pyx_6, __pyx_7, __pyx_n_XMLSchemaValidateError, "etree"); if (!__pyx_5) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_6); __pyx_6 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":11 */
if (PyObject_SetAttr(__pyx_m, __pyx_n_XMLSchemaValidateError, __pyx_5) < 0) {__pyx_filename = __pyx_f[15]; __pyx_lineno = 10; goto __pyx_L1;}
Py_DECREF(__pyx_5); __pyx_5 = 0;
Py_DECREF(__pyx_7); __pyx_7 = 0;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/xmlschema.pxi":20 */
Py_INCREF(Py_None);
__pyx_k197 = Py_None;
Py_INCREF(Py_None);
__pyx_k198 = Py_None;

/* "/home/me/source/Python/lxml/lxml-1.2/RELEASE-DIR/lxml-1.2.1/src/lxml/public-api.pxi":137 */
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_7);
__Pyx_AddTraceback("etree");
}

static char *__pyx_filenames[] = {
"etree.pyx",
"proxy.pxi",
"apihelpers.pxi",
"xmlerror.pxi",
"classlookup.pxi",
"nsclasses.pxi",
"docloader.pxi",
"parser.pxi",
"serializer.pxi",
"iterparse.pxi",
"xmlid.pxi",
"extensions.pxi",
"xpath.pxi",
"xslt.pxi",
"relaxng.pxi",
"xmlschema.pxi",
"public-api.pxi",
};

/* 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)
{
    PyObject *x = 0, *args1 = 0, *kwds1 = 0;
    
    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_Size(*args));
        if (!*args2)
            goto bad;
    }
    else {
        args1 = *args;
        Py_INCREF(args1);
    }
    
    if (kwds2) {
        if (*kwds) {
            char **p;
            kwds1 = PyDict_New();
            if (!kwds)
                goto bad;
            *kwds2 = PyDict_Copy(*kwds);
            if (!*kwds2)
                goto bad;
            for (p = kwd_list; *p; 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 {
            *kwds2 = PyDict_New();
            if (!*kwds2)
                goto bad;
        }
    }
    else {
        kwds1 = *kwds;
        Py_XINCREF(kwds1);
    }
    
    *args = args1;
    *kwds = kwds1;
    return 0;
bad:
    Py_XDECREF(args1);
    Py_XDECREF(kwds1);
    Py_XDECREF(*args2);
    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 PyObject *__Pyx_GetExcValue(void) {
    PyObject *type = 0, *value = 0, *tb = 0;
    PyObject *result = 0;
    PyThreadState *tstate = PyThreadState_Get();
    PyErr_Fetch(&type, &value, &tb);
    PyErr_NormalizeException(&type, &value, &tb);
    if (PyErr_Occurred())
        goto bad;
    if (!value) {
        value = Py_None;
        Py_INCREF(value);
    }
    Py_XDECREF(tstate->exc_type);
    Py_XDECREF(tstate->exc_value);
    Py_XDECREF(tstate->exc_traceback);
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    result = value;
    Py_XINCREF(result);
    type = 0;
    value = 0;
    tb = 0;
bad:
    Py_XDECREF(type);
    Py_XDECREF(value);
    Py_XDECREF(tb);
    return result;
}

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);
    }
    /* Next, repeatedly, replace a tuple exception with its first item */
    while (PyTuple_Check(type) && PyTuple_Size(type) > 0) {
        PyObject *tmp = type;
        type = PyTuple_GET_ITEM(type, 0);
        Py_INCREF(type);
        Py_DECREF(tmp);
    }
    if (PyString_Check(type)) {
        if (PyErr_Warn(PyExc_DeprecationWarning,
                "raising a string exception is deprecated"))
            goto raise_error;
    }
    else if (PyType_Check(type) || PyClass_Check(type))
        ; /*PyErr_NormalizeException(&type, &value, &tb);*/
    else {
        /* 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 (PyInstance_Check(type))
            type = (PyObject*) ((PyInstanceObject*)type)->in_class;
        else
            type = (PyObject*) type->ob_type;
        Py_INCREF(type);
    }
    PyErr_Restore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static void __Pyx_ReRaise(void) {
    PyThreadState *tstate = PyThreadState_Get();
    PyObject *type = tstate->exc_type;
    PyObject *value = tstate->exc_value;
    PyObject *tb = tstate->exc_traceback;
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    PyErr_Restore(type, value, tb);
}

static int __Pyx_ImportModuleCApi(__Pyx_CApiTabEntry *t) {
    __Pyx_CApiTabEntry *api_t;
    while (t->s) {
        if (*t->s == '\0')
            continue; /* shortcut for erased string entries */
        api_t = __pyx_c_api_tab;
        while ((api_t->s) && (strcmp(api_t->s, t->s) < 0))
            ++api_t;
        if ((!api_t->p) || (strcmp(api_t->s, t->s) != 0)) {
            PyErr_Format(PyExc_ValueError,
                         "Unknown function name in C API: %s", t->s);
            return -1;
        }
        *t->p = api_t->p;
        ++t;
    }
    return 0;
}

static int __Pyx_InitCApi(PyObject *module) {
    int result;
    PyObject* cobj = PyCObject_FromVoidPtr(&__Pyx_ImportModuleCApi, NULL);
    if (!cobj)
        return -1;

    result = PyObject_SetAttrString(module, "_import_c_api", cobj);
    Py_DECREF(cobj);
    return result;
}

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) {
        *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

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;
}

#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);
}


syntax highlighted by Code2HTML, v. 0.9.1