I’ve been working on my XMPP server pet project recently, and the need for a good Erlang XML parser has finally struck. I decided to go with Erlsom. It’s in MacPorts, so from there I installed it. Now, since I don’t update my port tree frequently I get delightful surprises from time to time. This time installing Erlsom triggered an update of Erlang, to the latest version!
Short story shorter, the update changes the path to the erlang-mode.el file so before you can M-x erlang-mode again you’ll have you fix your Emacs load-path to register the new location. (See my older post on how to initially set up Erlang and Emacs from MacPorts from scratch)
The new load commands should be:
(setq load-path (cons "/opt/local/lib/erlang/lib/tools-2.6.5/emacs/" load-path))
(setq erlang-root-dir "/opt/local/lib/erlang")
(setq exec-path (cons "/opt/local/bin" exec-path))
(require 'erlang-start)
It just requires changing the tools-x.x.x to 2.6.5.
p.s. about erlang-mode
Kenneth
03 Feb 2010 06:02 am
I am just curious regarding what you mean with good XML parser?
And I also wonder if you are aware of the brand new XML parser in
the xmerl application (included in the Erlang/OTP distro). The new XML parser is a sax parser with about the same speed as Erlsom. There is currently no validation but that is on its way.
/Kenneth , Erlang/OTP Ericsson
tbielawa
03 Feb 2010 07:02 am
Kenneth,
At the time “good” just meant the first thing that looked good. When reading over documentation for each module I noticed where I could find an example of how to use a continuation function in Erlsom before I found the Xmerl example.
Honestly I haven’t tried either module yet, though. Right now I’d much rather go with something that ships with my distribution than require an external dependency in each installation.
Just before you made your comment I read Jack Moffitt’s post in which he parses a TCP stream with xmerl. After which I realized that that he was doing it the same way I would have in Erlsom, just with xmerl.
While I would like to pass binaries straight out of gen_tcp:recv() to the scanner, I recognize that I do not have ultra high performance needs at this time, so the conversion to strings will only be an additional operation, and in no way a game killer. I’m going to give Xmerl a try.
Can you comment on the prospects of binary scanning coming to xmerl, and if there would be noticeable performance gains at this point?