mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-17 18:21:05 +03:00
cleanup added class for parser context, added first cut for push mode
* python/Makefile.am python/types.c: cleanup * python/libxml.c python/libxml.py python/libxml_wrap.h python/generator.py python/libxml2-python-api.xml python/libxml2class.txt: added class for parser context, added first cut for push mode support. Added a framework to generate accessors functions. * python/tests/Makefile.am python/tests/push.py: added a push test Daniel
This commit is contained in:
25
python/tests/push.py
Executable file
25
python/tests/push.py
Executable file
@ -0,0 +1,25 @@
|
||||
#!/usr/bin/python -u
|
||||
import sys
|
||||
import libxml2
|
||||
|
||||
ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml")
|
||||
ctxt.parseChunk("/>", 2, 1)
|
||||
doc = ctxt.doc()
|
||||
ctxt=None
|
||||
if doc.name != "test.xml":
|
||||
print "document name error"
|
||||
sys.exit(1)
|
||||
root = doc.children
|
||||
if root.name != "foo":
|
||||
print "root element name error"
|
||||
sys.exit(1)
|
||||
doc.freeDoc()
|
||||
i = 10000
|
||||
while i > 0:
|
||||
ctxt = libxml2.createPushParser(None, "<foo", 4, "test.xml")
|
||||
ctxt.parseChunk("/>", 2, 1)
|
||||
doc = ctxt.doc()
|
||||
doc.freeDoc()
|
||||
i = i -1
|
||||
ctxt=None
|
||||
print "OK"
|
Reference in New Issue
Block a user