summaryrefslogtreecommitdiff
path: root/SAX2.c
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@redhat.com>2010-09-09 18:17:47 +0200
committerDaniel Veillard <veillard@redhat.com>2010-09-09 18:17:47 +0200
commitaa54d37cd75399722f012e37f17d9ffeeddba556 (patch)
treefdbdae6f277043a002ebaebd211b74d7e1d72ce5 /SAX2.c
parentaf58ee130fe9eec14a0b8c6f6f3cdf7e7ec37872 (diff)
downloadlibxml2-aa54d37cd75399722f012e37f17d9ffeeddba556.tar.gz
Fix handling of XML-1.0 XML namespace declaration
Usually 'xml' namespace for XML-1.0 declaration does not need to be carried but Mike Hommey raised the problem that the SVG XSD file fails to parse due to a mishandling. - SAX2.c: failure to create a namespace should not be interpreted as a memory allocation error - tree.c: document better xmlNewNs behaviour, and fix it in the case the 'xml' prefix is being used.
Diffstat (limited to 'SAX2.c')
-rw-r--r--SAX2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/SAX2.c b/SAX2.c
index 84c1f004..c0482c0b 100644
--- a/SAX2.c
+++ b/SAX2.c
@@ -2242,8 +2242,12 @@ xmlSAX2StartElementNs(void *ctx,
if ((URI != NULL) && (prefix == pref))
ret->ns = ns;
} else {
- xmlSAX2ErrMemory(ctxt, "xmlSAX2StartElementNs");
- return;
+ /*
+ * any out of memory error would already have been raised
+ * but we can't be garanteed it's the actual error due to the
+ * API, best is to skip in this case
+ */
+ continue;
}
#ifdef LIBXML_VALID_ENABLED
if ((!ctxt->html) && ctxt->validate && ctxt->wellFormed &&