patch from Stéphane Bidoul for better per context error message APIs
* xmlreader.c python/drv_libxml2.py python/generator.py
python/libxml.c python/libxml.py python/libxml_wrap.h
python/types.c: patch from Stéphane Bidoul for better per
context error message APIs
* python/tests/ctxterror.py python/tests/readererr.py:
update of the tests
Daniel
diff --git a/include/libxml/xmlreader.h b/include/libxml/xmlreader.h
index 53314b1..e9475a7 100644
--- a/include/libxml/xmlreader.h
+++ b/include/libxml/xmlreader.h
@@ -24,11 +24,11 @@
} xmlParserProperties;
typedef enum {
- XMLREADER_SEVERITY_VALIDITY_WARNING = 1,
- XMLREADER_SEVERITY_VALIDITY_ERROR = 2,
- XMLREADER_SEVERITY_WARNING = 3,
- XMLREADER_SEVERITY_ERROR = 4
-} xmlReaderSeverities;
+ XML_PARSER_SEVERITY_VALIDITY_WARNING = 1,
+ XML_PARSER_SEVERITY_VALIDITY_ERROR = 2,
+ XML_PARSER_SEVERITY_WARNING = 3,
+ XML_PARSER_SEVERITY_ERROR = 4
+} xmlParserSeverities;
typedef struct _xmlTextReader xmlTextReader;
typedef xmlTextReader *xmlTextReaderPtr;
@@ -110,12 +110,14 @@
/*
* Error handling extensions
*/
-typedef void (*xmlTextReaderErrorFunc) (void *arg,
+typedef void * xmlTextReaderLocatorPtr;
+typedef void (*xmlTextReaderErrorFunc) (void *arg,
const char *msg,
- int line,
- int col,
- const char *URI,
- xmlReaderSeverities severity);
+ xmlParserSeverities severity,
+ xmlTextReaderLocatorPtr locator);
+int xmlTextReaderLocatorLineNumber (xmlTextReaderLocatorPtr locator);
+/*int xmlTextReaderLocatorLinePosition(xmlTextReaderLocatorPtr locator);*/
+xmlChar * xmlTextReaderLocatorBaseURI (xmlTextReaderLocatorPtr locator);
void xmlTextReaderSetErrorHandler (xmlTextReaderPtr reader,
xmlTextReaderErrorFunc f,
void *arg);