fixed bug #164556 where non-fatal errors stopped push parsing and
* parser.c: fixed bug #164556 where non-fatal errors stopped
push parsing and xmlreader.
* Makefile.am: fixup
* test/errors/webdav.xml result/errors/webdav*: adding regression
test for this problem.
Daniel
diff --git a/ChangeLog b/ChangeLog
index 0de6985..666c7e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+Fri Jan 21 16:08:21 CET 2005 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: fixed bug #164556 where non-fatal errors stopped
+ push parsing and xmlreader.
+ * Makefile.am: fixup
+ * test/errors/webdav.xml result/errors/webdav*: adding regression
+ test for this problem.
+
Wed Jan 19 17:24:34 CET 2005 Kasimier Buchcik <libxml2-cvs@cazic.net>
* xmlschemas.c: Corrected targetNamespace in
diff --git a/Makefile.am b/Makefile.am
index 92dd8b9..3ac2887 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -354,15 +354,14 @@
echo New test file $$name ; \
$(CHECKER) $(top_builddir)/xmllint --stream $$i \
2> $(srcdir)/result/errors/$$name.str \
- > $(srcdir)/result/errors/$$name ; \
+ > /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
else \
- log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > result.$$name ; \
+ log=`$(CHECKER) $(top_builddir)/xmllint --stream $$i 2> error.$$name > /dev/null ; \
grep "MORY ALLO" .memdump | grep -v "MEMORY ALLOCATED : 0"; \
- diff $(srcdir)/result/errors/$$name result.$$name ; \
diff $(srcdir)/result/errors/$$name.str error.$$name` ; \
if [ -n "$$log" ] ; then echo $$name result ; echo $$log ; fi ; \
- rm result.$$name error.$$name ; \
+ rm error.$$name ; \
fi ; fi ; done)
Docbtests : xmllint$(EXEEXT)
diff --git a/parser.c b/parser.c
index 8c8e6b9..84b230f 100644
--- a/parser.c
+++ b/parser.c
@@ -9035,7 +9035,7 @@
xmlParseGetLasts(ctxt, &lastlt, &lastgt);
while (1) {
- if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
+ if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1))
return(0);
@@ -9837,7 +9837,7 @@
int terminate) {
if (ctxt == NULL)
return(XML_ERR_INTERNAL_ERROR);
- if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
+ if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
if (ctxt->instate == XML_PARSER_START)
xmlDetectSAX2(ctxt);
@@ -9879,7 +9879,7 @@
}
}
xmlParseTryOrFinish(ctxt, terminate);
- if ((ctxt->errNo != XML_ERR_OK) && (ctxt->disableSAX == 1))
+ if ((ctxt->wellFormed != 1) && (ctxt->disableSAX == 1))
return(ctxt->errNo);
if (terminate) {
/*
@@ -9909,6 +9909,7 @@
}
ctxt->instate = XML_PARSER_EOF;
}
+ if (ctxt->wellFormed) return(0);
return((xmlParserErrors) ctxt->errNo);
}
diff --git a/result/errors/webdav.xml b/result/errors/webdav.xml
new file mode 100644
index 0000000..2646219
--- /dev/null
+++ b/result/errors/webdav.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<propfind xmlns="DAV:"><prop>
+<getcontentlength xmlns="DAV:"/>
+<getlastmodified xmlns="DAV:"/>
+<displayname xmlns="DAV:"/>
+<executable xmlns="http://apache.org/dav/props/"/>
+<resourcetype xmlns="DAV:"/>
+</prop></propfind>
diff --git a/result/errors/webdav.xml.err b/result/errors/webdav.xml.err
new file mode 100644
index 0000000..a722454
--- /dev/null
+++ b/result/errors/webdav.xml.err
@@ -0,0 +1,15 @@
+./test/errors/webdav.xml:2: parser warning : xmlns: DAV: not a valid URI
+<propfind xmlns="DAV:"><prop>
+ ^
+./test/errors/webdav.xml:3: parser warning : xmlns: DAV: not a valid URI
+<getcontentlength xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:4: parser warning : xmlns: DAV: not a valid URI
+<getlastmodified xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:5: parser warning : xmlns: DAV: not a valid URI
+<displayname xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:7: parser warning : xmlns: DAV: not a valid URI
+<resourcetype xmlns="DAV:"/>
+ ^
diff --git a/result/errors/webdav.xml.str b/result/errors/webdav.xml.str
new file mode 100644
index 0000000..a722454
--- /dev/null
+++ b/result/errors/webdav.xml.str
@@ -0,0 +1,15 @@
+./test/errors/webdav.xml:2: parser warning : xmlns: DAV: not a valid URI
+<propfind xmlns="DAV:"><prop>
+ ^
+./test/errors/webdav.xml:3: parser warning : xmlns: DAV: not a valid URI
+<getcontentlength xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:4: parser warning : xmlns: DAV: not a valid URI
+<getlastmodified xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:5: parser warning : xmlns: DAV: not a valid URI
+<displayname xmlns="DAV:"/>
+ ^
+./test/errors/webdav.xml:7: parser warning : xmlns: DAV: not a valid URI
+<resourcetype xmlns="DAV:"/>
+ ^
diff --git a/test/errors/webdav.xml b/test/errors/webdav.xml
new file mode 100644
index 0000000..981c7c9
--- /dev/null
+++ b/test/errors/webdav.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="utf-8"?>
+<propfind xmlns="DAV:"><prop>
+<getcontentlength xmlns="DAV:"/>
+<getlastmodified xmlns="DAV:"/>
+<displayname xmlns="DAV:"/>
+<executable xmlns="http://apache.org/dav/props/"/>
+<resourcetype xmlns="DAV:"/>
+</prop></propfind>
+