event-based XML parsing

Ulf Wiger etxuwig@REDACTED
Wed Nov 22 11:05:53 CET 2000


Down to more earthly matters, I've published a new version of 
xmerl, with an example of an event-based interface to the 
XML processor. It seems to work quite well for very large files.

The example event-based parser is 122 lines of Erlang code
(not counting the actual processor, which is 1971 LOC).

The trick to parsing large XML files without using up lots of memory
is an accumulator hook function which accumulates nothing:

    AccF = fun(X, Acc, S) ->
                   {Acc, S}
           end,

All the data is instead handled in a user-provided event hook
function.

The README.html file has much more documentation.

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB




More information about the erlang-questions mailing list