1
0
mirror of https://gitlab.gnome.org/GNOME/libxml2.git synced 2025-07-28 00:21:53 +03:00

fixed bug #108801 reported by Malcolm Tredinnick about the DocType node

* xmlreader.c: fixed bug #108801 reported by Malcolm Tredinnick
  about the DocType node not being reported sometimes.
* python/tests/reader.py: added to test to the regression checks
Daniel
This commit is contained in:
Daniel Veillard
2003-03-22 12:38:15 +00:00
parent 120e8eb291
commit 48ef4c98d2
3 changed files with 36 additions and 1 deletions

View File

@ -1,3 +1,9 @@
Sat Mar 22 13:32:39 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c: fixed bug #108801 reported by Malcolm Tredinnick
about the DocType node not being reported sometimes.
* python/tests/reader.py: added to test to the regression checks
Sat Mar 22 01:57:40 CET 2003 Daniel Veillard <daniel@veillard.com> Sat Mar 22 01:57:40 CET 2003 Daniel Veillard <daniel@veillard.com>
* xmlreader.c: fixed bug #108546 on long CDATA (or text nodes) * xmlreader.c: fixed bug #108546 on long CDATA (or text nodes)

View File

@ -399,6 +399,31 @@ if res != expect:
print res print res
sys.exit(1) sys.exit(1)
#
# test from bug #108801
#
doc="""<?xml version="1.0" standalone="no"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
]>
<article>
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
</article>
"""
expect="""10 (article) [None] 0 0
1 (article) [None] 0 0
3 (#text) [
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
] 0 1
15 (article) [None] 0 0
"""
res = tst_reader(doc)
if res != expect:
print "test15 failed"
print res
sys.exit(1)
# #
# cleanup for memory allocation counting # cleanup for memory allocation counting
# #

View File

@ -598,7 +598,11 @@ xmlTextReaderRead(xmlTextReaderPtr reader) {
return(-1); return(-1);
reader->state = XML_TEXTREADER_ELEMENT; reader->state = XML_TEXTREADER_ELEMENT;
} else { } else {
reader->node = reader->ctxt->nodeTab[0]; if (reader->ctxt->myDoc != NULL) {
reader->node = reader->ctxt->myDoc->children;
}
if (reader->node == NULL)
reader->node = reader->ctxt->nodeTab[0];
reader->state = XML_TEXTREADER_ELEMENT; reader->state = XML_TEXTREADER_ELEMENT;
} }
reader->depth = 0; reader->depth = 0;