1998-01-29 14:55:24 +00:00
|
|
|
'''Test module to thest the xmllib module.
|
|
|
|
Sjoerd Mullender
|
|
|
|
'''
|
|
|
|
|
2001-01-17 19:11:13 +00:00
|
|
|
from test_support import verify, verbose
|
1998-01-29 14:55:24 +00:00
|
|
|
|
|
|
|
testdoc = """\
|
|
|
|
<?xml version="1.0" encoding="UTF-8" standalone='yes' ?>
|
|
|
|
<!-- comments aren't allowed before the <?xml?> tag,
|
|
|
|
but they are allowed before the <!DOCTYPE> tag -->
|
|
|
|
<!DOCTYPE greeting [
|
|
|
|
<!ELEMENT greeting (#PCDATA)>
|
|
|
|
]>
|
|
|
|
<greeting>Hello, world!</greeting>
|
|
|
|
"""
|
|
|
|
|
|
|
|
import xmllib
|
|
|
|
if verbose:
|
2000-10-23 17:22:08 +00:00
|
|
|
parser = xmllib.TestXMLParser()
|
1998-01-29 14:55:24 +00:00
|
|
|
else:
|
2000-10-23 17:22:08 +00:00
|
|
|
parser = xmllib.XMLParser()
|
1998-01-29 14:55:24 +00:00
|
|
|
|
|
|
|
for c in testdoc:
|
2000-10-23 17:22:08 +00:00
|
|
|
parser.feed(c)
|
1998-01-29 14:55:24 +00:00
|
|
|
parser.close()
|