aboutsummaryrefslogtreecommitdiff
blob: 5fa2d6f0c1571f90abc3faccdec5ce8f6abb1b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From 6c91aa384f48ff6d406553a6dd47fd556c1ef2e6 Mon Sep 17 00:00:00 2001
From: Daniel Veillard <veillard@redhat.com>
Date: Thu, 25 Oct 2012 15:33:59 +0800
Subject: [PATCH] Fix a regression in 2.9.0 breaking validation while
 streaming

https://bugzilla.gnome.org/show_bug.cgi?id=684774
with help from Kjell Ahlstedt <kjell.ahlstedt@bredband.net>
---
 SAX2.c   | 2 +-
 parser.c | 7 +++++--
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/SAX2.c b/SAX2.c
index a24abc8..3eea39a 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2202,7 +2202,7 @@ xmlSAX2StartElementNs(void *ctx,
 	  (ctxt->myDoc->intSubset->elements == NULL) &&
 	  (ctxt->myDoc->intSubset->attributes == NULL) &&
 	  (ctxt->myDoc->intSubset->entities == NULL)))) {
-	xmlErrValid(ctxt, XML_ERR_NO_DTD,
+	xmlErrValid(ctxt, XML_DTD_NO_DTD,
 	  "Validation failed: no DTD found !", NULL, NULL);
 	ctxt->validate = 0;
     }
diff --git a/parser.c b/parser.c
index 28b0d80..19f1217 100644
--- a/parser.c
+++ b/parser.c
@@ -11633,7 +11633,7 @@ xmlParseTryOrFinish(xmlParserCtxtPtr ctxt, int terminate) {
 			    "PP: Parsing internal subset\n");
 #endif
 		    ctxt->inSubset = 1;
-                    ctxt->progressive = 1;
+                    ctxt->progressive = 0;
 		    ctxt->checkIndex = 0;
 		    xmlParseDocTypeDecl(ctxt);
 		    if (RAW == '[') {
@@ -12219,7 +12219,10 @@ xmldecl_done:
 	}
 	ctxt->instate = XML_PARSER_EOF;
     }
-    return((xmlParserErrors) ctxt->errNo);
+    if (ctxt->wellFormed == 0)
+	return((xmlParserErrors) ctxt->errNo);
+    else
+        return(0);
 }
 
 /************************************************************************
-- 
1.8.0