summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Veillard <veillard@src.gnome.org>2005-06-09 08:18:24 +0000
committerDaniel Veillard <veillard@src.gnome.org>2005-06-09 08:18:24 +0000
commit365cf67ff812caf2f3edc7c52955c4ffa8fb2597 (patch)
tree44ec1eda460c87c18751258ace907776aefbbcfb
parentd892557d993be0ae7d1d5c817fbec680844b30db (diff)
downloadlibxml2-365cf67ff812caf2f3edc7c52955c4ffa8fb2597.tar.gz
applied patch from Malcolm Rowe to avoid namespace troubles on rollback
* parser.c: applied patch from Malcolm Rowe to avoid namespace troubles on rollback parsing of elements start #304761 * test/nsclean.xml result/noent/nsclean.xml result/nsclean.xml*: added it to the regression tests. Daniel
-rw-r--r--ChangeLog7
-rw-r--r--parser.c3
-rw-r--r--result/noent/nsclean.xml5
-rw-r--r--result/nsclean.xml5
-rw-r--r--result/nsclean.xml.rde10
-rw-r--r--result/nsclean.xml.rdr10
-rw-r--r--result/nsclean.xml.sax13
-rw-r--r--test/nsclean.xml9
8 files changed, 62 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index beef272c..d864b1ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jun 9 10:16:11 CEST 2005 Daniel Veillard <daniel@veillard.com>
+
+ * parser.c: applied patch from Malcolm Rowe to avoid namespace
+ troubles on rollback parsing of elements start #304761
+ * test/nsclean.xml result/noent/nsclean.xml result/nsclean.xml*:
+ added it to the regression tests.
+
Thu Jun 9 00:33:50 CEST 2005 Daniel Veillard <daniel@veillard.com>
* parser.c include/libxml/xmlerror.h: applied patch from Rob Richards
diff --git a/parser.c b/parser.c
index b0d9f688..352ffa37 100644
--- a/parser.c
+++ b/parser.c
@@ -7535,6 +7535,7 @@ xmlParseStartTag2(xmlParserCtxtPtr ctxt, const xmlChar **pref,
int i, j, nbNs, attval;
const xmlChar *base;
unsigned long cur;
+ int nsNr = ctxt->nsNr;
if (RAW != '<') return(NULL);
NEXT1;
@@ -7555,6 +7556,8 @@ reparse:
nbdef = 0;
nbNs = 0;
attval = 0;
+ /* Forget any namespaces added during an earlier parse of this element. */
+ ctxt->nsNr = nsNr;
localname = xmlParseQName(ctxt, &prefix);
if (localname == NULL) {
diff --git a/result/noent/nsclean.xml b/result/noent/nsclean.xml
new file mode 100644
index 00000000..8f1ea823
--- /dev/null
+++ b/result/noent/nsclean.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<article xmlns="tag:foofoofoofoofoofoofoofoo" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/">
+<foop:content xmlns="http://www.w3.org/1999/xhtml" xmlns:foop="tag:foofoofoofoofoofoofoofoo">
+</foop:content>
+</article>
diff --git a/result/nsclean.xml b/result/nsclean.xml
new file mode 100644
index 00000000..8f1ea823
--- /dev/null
+++ b/result/nsclean.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<article xmlns="tag:foofoofoofoofoofoofoofoo" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/">
+<foop:content xmlns="http://www.w3.org/1999/xhtml" xmlns:foop="tag:foofoofoofoofoofoofoofoo">
+</foop:content>
+</article>
diff --git a/result/nsclean.xml.rde b/result/nsclean.xml.rde
new file mode 100644
index 00000000..c606593b
--- /dev/null
+++ b/result/nsclean.xml.rde
@@ -0,0 +1,10 @@
+0 1 article 0 0
+1 14 #text 0 1
+
+1 1 foop:content 0 0
+2 14 #text 0 1
+
+1 15 foop:content 0 0
+1 14 #text 0 1
+
+0 15 article 0 0
diff --git a/result/nsclean.xml.rdr b/result/nsclean.xml.rdr
new file mode 100644
index 00000000..c606593b
--- /dev/null
+++ b/result/nsclean.xml.rdr
@@ -0,0 +1,10 @@
+0 1 article 0 0
+1 14 #text 0 1
+
+1 1 foop:content 0 0
+2 14 #text 0 1
+
+1 15 foop:content 0 0
+1 14 #text 0 1
+
+0 15 article 0 0
diff --git a/result/nsclean.xml.sax b/result/nsclean.xml.sax
new file mode 100644
index 00000000..b01aeae7
--- /dev/null
+++ b/result/nsclean.xml.sax
@@ -0,0 +1,13 @@
+SAX.setDocumentLocator()
+SAX.startDocument()
+SAX.startElement(article, xmlns='tag:foofoofoofoofoofoofoofoo', xmlns:dc='http://purl.org/dc/elements/1.1/', xmlns:dcterms='http://purl.org/dc/terms/')
+SAX.characters(
+, 1)
+SAX.startElement(foop:content, xmlns='http://www.w3.org/1999/xhtml', xmlns:foop='tag:foofoofoofoofoofoofoofoo')
+SAX.characters(
+, 1)
+SAX.endElement(foop:content)
+SAX.characters(
+, 1)
+SAX.endElement(article)
+SAX.endDocument()
diff --git a/test/nsclean.xml b/test/nsclean.xml
new file mode 100644
index 00000000..c293ddb6
--- /dev/null
+++ b/test/nsclean.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<article xmlns="tag:foofoofoofoofoofoofoofoo"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:dcterms="http://purl.org/dc/terms/">
+<foop:content xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:foop="tag:foofoofoofoofoofoofoofoo">
+</foop:content>
+</article>
+