summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--SAX2.c11
-rw-r--r--parser.c5
2 files changed, 8 insertions, 8 deletions
diff --git a/SAX2.c b/SAX2.c
index b6be1a6c..91019389 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2874,20 +2874,23 @@ xmlSAXVersion(xmlSAXHandler *hdlr, int version)
{
if (hdlr == NULL) return(-1);
if (version == 2) {
- hdlr->startElement = NULL;
- hdlr->endElement = NULL;
hdlr->startElementNs = xmlSAX2StartElementNs;
hdlr->endElementNs = xmlSAX2EndElementNs;
hdlr->serror = NULL;
hdlr->initialized = XML_SAX2_MAGIC;
#ifdef LIBXML_SAX1_ENABLED
} else if (version == 1) {
- hdlr->startElement = xmlSAX2StartElement;
- hdlr->endElement = xmlSAX2EndElement;
hdlr->initialized = 1;
#endif /* LIBXML_SAX1_ENABLED */
} else
return(-1);
+#ifdef LIBXML_SAX1_ENABLED
+ hdlr->startElement = xmlSAX2StartElement;
+ hdlr->endElement = xmlSAX2EndElement;
+#else
+ hdlr->startElement = NULL;
+ hdlr->endElement = NULL;
+#endif /* LIBXML_SAX1_ENABLED */
hdlr->internalSubset = xmlSAX2InternalSubset;
hdlr->externalSubset = xmlSAX2ExternalSubset;
hdlr->isStandalone = xmlSAX2IsStandalone;
diff --git a/parser.c b/parser.c
index 0c8bed12..e133fe0a 100644
--- a/parser.c
+++ b/parser.c
@@ -842,10 +842,7 @@ xmlDetectSAX2(xmlParserCtxtPtr ctxt) {
if (ctxt == NULL) return;
sax = ctxt->sax;
#ifdef LIBXML_SAX1_ENABLED
- if ((sax) && (sax->initialized == XML_SAX2_MAGIC) &&
- ((sax->startElementNs != NULL) ||
- (sax->endElementNs != NULL) ||
- ((sax->startElement == NULL) && (sax->endElement == NULL))))
+ if ((sax) && (sax->initialized == XML_SAX2_MAGIC))
ctxt->sax2 = 1;
#else
ctxt->sax2 = 1;