[cduce-users] Cduce on very large files

Alain Frisch Alain.Frisch at inria.fr
Sun Dec 10 22:31:00 CET 2006

andrew.p.cone at gmail.com wrote:
> I am working with an XML file that is 1.8GB. I need to do some
> specific actions for each tag. I have been writing in Perl, but I am
> getting tired of it's ugliness, and I'd like something cleaner and
> strongly typed.
> I am an OCaml fan, so I thought I'd try using CDuce/OCamlDuce. But it
> seems the only way to load in the XML file is to use the load_xml
> function. Will this work for a file that's 1.8GB? Is there some way
> to have CDuce work like a parser, so that it doesn't need to hold the
> entire abstract syntax tree in memory?


CDuce indeed requires the whole document to be loaded in memory.

I suggest you to have a look at XStream:


This is very small tool which takes a functional specification of an XML
transformation and produces efficient streaming code (when possible).
Currently, there is no type system and the language is quite low-level,
but it might be well adapted to your needs. Let me know about your
experience if you give it a try.



More information about the Cduce-users mailing list