home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 4 / AACD04.ISO / AACD / Programming / Python / Lib / Python1.5 / test / test_xmllib.py < prev    next >
Encoding:
Python Source  |  1998-01-29  |  523 b   |  26 lines

  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()
  26.