#include "frameobject.h"
#include "expat.h"
+#define XML_COMBINED_VERSION (10000*XML_MAJOR_VERSION+100*XML_MINOR_VERSION+XML_MICRO_VERSION)
+
#ifndef PyDoc_STRVAR
/*
XmlDecl,
ElementDecl,
AttlistDecl,
+#if XML_COMBINED_VERSION >= 19504
SkippedEntity,
+#endif
_DummyDecl
};
STRING_CONV_FUNC,att_type, STRING_CONV_FUNC,dflt,
isrequired))
+#if XML_COMBINED_VERSION >= 19504
VOID_HANDLER(SkippedEntity,
(void *userData,
const XML_Char *entityName,
int is_parameter_entity),
("Ni",
string_intern(self, entityName), is_parameter_entity))
+#endif
VOID_HANDLER(NotationDecl,
(void *userData,
return PyInt_FromLong(flag);
}
+
+#if XML_COMBINED_VERSION >= 19505
PyDoc_STRVAR(xmlparse_UseForeignDTD__doc__,
"UseForeignDTD([flag])\n\
Allows the application to provide an artificial external subset if one is\n\
Py_INCREF(Py_None);
return Py_None;
}
+#endif
static struct PyMethodDef xmlparse_methods[] = {
{"Parse", (PyCFunction)xmlparse_Parse,
METH_VARARGS, xmlparse_SetParamEntityParsing__doc__},
{"GetInputContext", (PyCFunction)xmlparse_GetInputContext,
METH_VARARGS, xmlparse_GetInputContext__doc__},
+#if XML_COMBINED_VERSION >= 19505
{"UseForeignDTD", (PyCFunction)xmlparse_UseForeignDTD,
METH_VARARGS, xmlparse_UseForeignDTD__doc__},
+#endif
{NULL, NULL} /* sentinel */
};
/* Don't core dump later! */
return;
+#if XML_COMBINED_VERSION > 19505
{
const XML_Feature *features = XML_GetFeatureList();
PyObject *list = PyList_New(0);
PyModule_AddObject(m, "features", list);
}
}
+#endif
#define MYCONST(name) \
PyModule_AddStringConstant(errors_module, #name, \
{"AttlistDeclHandler",
(xmlhandlersetter)XML_SetAttlistDeclHandler,
(xmlhandler)my_AttlistDeclHandler},
+#if XML_COMBINED_VERSION >= 19504
{"SkippedEntityHandler",
(xmlhandlersetter)XML_SetSkippedEntityHandler,
(xmlhandler)my_SkippedEntityHandler},
+#endif
{NULL, NULL, NULL} /* sentinel */
};