Guido van Rossum | 548703a | 1998-03-26 22:14:20 +0000 | [diff] [blame] | 1 | '''Test module to thest the xmllib module. |
| 2 | Sjoerd Mullender |
| 3 | ''' |
| 4 | |
| 5 | from test_support import verbose |
| 6 | |
| 7 | testdoc = """\ |
| 8 | <?xml version="1.0" encoding="UTF-8" standalone='yes' ?> |
| 9 | <!-- comments aren't allowed before the <?xml?> tag, |
| 10 | but they are allowed before the <!DOCTYPE> tag --> |
| 11 | <!DOCTYPE greeting [ |
| 12 | <!ELEMENT greeting (#PCDATA)> |
| 13 | ]> |
| 14 | <greeting>Hello, world!</greeting> |
| 15 | """ |
| 16 | |
| 17 | import xmllib |
| 18 | if verbose: |
| 19 | parser = xmllib.TestXMLParser() |
| 20 | else: |
| 21 | parser = xmllib.XMLParser() |
| 22 | |
| 23 | for c in testdoc: |
| 24 | parser.feed(c) |
| 25 | parser.close() |