[erlang-questions] xmerl producing atoms

Willem de Jong w.a.de.jong@REDACTED
Tue Mar 13 21:07:29 CET 2007


Hello igwan,

Maybe you can use the sax parser that is part of Erlsom. It wouldn't be
difficult to implement a call-back function that produces output similar or
the xmerl 'simple-form', or calls a function similar to the 'hook_fun'. The
sax parser does not create any atoms.

Regards
Willem


On 3/13/07, igwan <igwan@REDACTED> wrote:
>
> Dear list,
>
> I'm currently working on a system that parses user-provided XML data
> using xmerl. What I find is a problem is that xmerl produces new atoms
> for every element name or namespace URI it parses from the input. This
> is not a big deal if you work with a limited number of schemas and
> "internal" users, but when you have to accept input from the internet,
> your node could be quickly taken down by filling up the atom table. The
> documentation ("Efficiency Guide" / 7.1  "Memory") says that atoms are
> not garbage-collected.
>
> I came to another post from 2005 describing this issue :
> http://www.erlang.org/ml-archive/erlang-questions/200502/msg00070.html
>
> I have looked at alternative parsers like ErlSom, but it seems to work
> against a pre-compiled schema and for my application, I have to accept
> any XML document, without knowing its structure. Plus, I make heavy use
> of hook_fun in xmerl_scan.
>
> My questions : Is there a (possibly-undocumented) option for telling
> xmerl to produce binaries or strings instead of atoms ? Or are there
> plans to garbage-collect atoms in the near future ?
>
> Thanks in advance,
>
> igwan
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070313/4821873b/attachment.htm>


More information about the erlang-questions mailing list