mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-28 00:21:53 +03:00
fixed a bug pointed out by Stphane Bidoul and integrated it into the
* xmlreader.c python/tests/reader.py: fixed a bug pointed out by Stphane Bidoul and integrated it into the tests Daniel
This commit is contained in:
@ -1,3 +1,8 @@
|
|||||||
|
Sun Dec 29 12:13:18 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* xmlreader.c python/tests/reader.py: fixed a bug pointed out
|
||||||
|
by St<53>phane Bidoul and integrated it into the tests
|
||||||
|
|
||||||
Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com>
|
Sat Dec 28 23:49:12 CET 2002 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
* xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml:
|
* xmlreader.c include/libxml/xmlreader.h doc/libxml2-api.xml:
|
||||||
|
@ -235,6 +235,36 @@ if reader.MoveToNextAttribute() != 0:
|
|||||||
print "Failed to detect last attribute"
|
print "Failed to detect last attribute"
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
|
#
|
||||||
|
# Another test provided by St<53>phane Bidoul and checked with C#
|
||||||
|
#
|
||||||
|
expect="""1 (a) [None]
|
||||||
|
1 (b) [None]
|
||||||
|
-- 2 (b1) [b1]
|
||||||
|
1 (c) [None]
|
||||||
|
3 (#text) [content of c]
|
||||||
|
15 (c) [None]
|
||||||
|
15 (a) [None]
|
||||||
|
"""
|
||||||
|
res=""
|
||||||
|
f = StringIO.StringIO("""<a><b b1="b1"/><c>content of c</c></a>""")
|
||||||
|
input = libxml2.inputBuffer(f)
|
||||||
|
reader = input.newTextReader("test5")
|
||||||
|
|
||||||
|
while reader.Read():
|
||||||
|
res=res + "%s (%s) [%s]\n" % (reader.NodeType(),reader.Name(),
|
||||||
|
reader.Value())
|
||||||
|
if reader.NodeType() == 1: # Element
|
||||||
|
while reader.MoveToNextAttribute():
|
||||||
|
res = res + "-- %s (%s) [%s]\n" % (reader.NodeType(),
|
||||||
|
reader.Name(),reader.Value())
|
||||||
|
|
||||||
|
if res != expect:
|
||||||
|
print "test5 failed"
|
||||||
|
print res
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
|
||||||
del f
|
del f
|
||||||
del input
|
del input
|
||||||
del reader
|
del reader
|
||||||
|
@ -349,6 +349,7 @@ xmlTextReaderRead(xmlTextReaderPtr reader) {
|
|||||||
fprintf(stderr, "\nREAD ");
|
fprintf(stderr, "\nREAD ");
|
||||||
DUMP_READER
|
DUMP_READER
|
||||||
#endif
|
#endif
|
||||||
|
reader->curnode = NULL;
|
||||||
if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
|
if (reader->mode == XML_TEXTREADER_MODE_INITIAL) {
|
||||||
reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
|
reader->mode = XML_TEXTREADER_MODE_INTERACTIVE;
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user