Commit 48ef4c98 authored by Daniel Veillard's avatar Daniel Veillard

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
parent 120e8eb2
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>
* xmlreader.c: fixed bug #108546 on long CDATA (or text nodes)
......
......@@ -399,6 +399,31 @@ if res != expect:
print res
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
#
......
......@@ -598,7 +598,11 @@ xmlTextReaderRead(xmlTextReaderPtr reader) {
return(-1);
reader->state = XML_TEXTREADER_ELEMENT;
} 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->depth = 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment