Re: Sequential XML parsing with xml.sax

2005-08-23 Thread peter
Hi. Fredrik Lundh wrote: > [EMAIL PROTECTED] wrote: > > > The API reference isn't clear on whether parseString can only handle > > discrete bits of valid XML > > the documentation says that "parse" expects an XML document, > and that "parseString" is the same thing, but parses from a buffer. OK,

Re: Sequential XML parsing with xml.sax

2005-08-23 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > The API reference isn't clear on whether parseString can only handle > discrete bits of valid XML the documentation says that "parse" expects an XML document, and that "parseString" is the same thing, but parses from a buffer. it's probably easier to pass a BZ2File ins

Sequential XML parsing with xml.sax

2005-08-23 Thread peter
Hi hi. I'm trying to do sequential decompression of a bzipped XML file and feed it to a SAX parser with the following code. remotefh = urllib.urlopen('file:///home/peter/catalog.rdf.bz2') decompressor = bz2.BZ2Decompressor() handler = CatalogueDocumentHandler(sys.stdout) chunksize = 2048 data = r