[libxml-devel] Sax-Parser: Reading not from file
Jochen Topf
jochen at remote.org
Sun Dec 9 04:30:09 EST 2007
On Fri, Dec 07, 2007 at 07:24:49PM -0500, Todd Fisher wrote:
> On Dec 7, 2007 4:30 AM, Jochen Topf <jochen at remote.org> wrote:
> > I have some rather large XML files which I want to read with the SAX
> > parser. Unfortunately it can only read from files or strings, not from
> > a Ruby IO stream or so. I want to pipe in the XML file directly from
> > a process decompressing the file or use some Ruby lib to do the
> > decompression on the fly.
>
> It doesn't look like it's supported. It could be we'd have to use
> xmlParseChunk. It shouldn't be too hard the tricky part would be how to
> expose that feature in a easy to use ruby API...
Hm. I think we need something the other way round: Whenever the Parser needs
more characters to parse, it should call back into Ruby code which will read
some bytes from an IO object and give those bytes to the parser.
Jochen
--
Jochen Topf jochen at remote.org http://www.remote.org/jochen/ +49-721-388298
More information about the libxml-devel
mailing list