[XML-SIG] Python/XML HOWTO
Lars Marius Garshol
27 May 1999 12:48:32 +0200
* Paul Chung Chee Soong
| parser.parseFile('collection.xml') # 4
| Next in # 4, I got problem again. In your example, your parameter is
| a file. What is the 'file' represents? I thought it was a xml file
| but it isn't right??
* Lars Marius Garshol
| It's the name of an XML file. If you want to push an XML document as a
| string ('<root><title>My title</title> ...</root>') you can use the
| parser.reset(), parser.feed('...') and parser.close() methods.
Sorry, I was a bit quick here and got it wrong. The SAX parser class
has two parse methods:
So parse takes the file name of an XML document (but it can be a URL)
and parseFile takes a file-like object (like what is returned by
urllib.urlopen and open).
Sorry about that.