[erlang-questions] Thoughts on EHE - the PHP killer

Matti Oinas matti.oinas@REDACTED
Sat Feb 18 19:20:15 CET 2012


On 02/18/2012 07:21 PM, Ulf Wiger wrote:
> Like I wrote, there is an unreleased version of xmerl_sax_parser with 
> a 'html' mode, which handles most of the usual HTML badness (i.e. 
> non-well-formed XML).

Sorry, I forgot to quote you in my previous post and there was also a 
major error in my text. I meant to say that if template engine supports 
only XHTML syntax then xmerl will do as it is at the moment because only 
XML parser is needed. That would be enough for me. I think I'll have to 
try to write an erlang version of enlive library and allow only XHTML 
syntax. Would be a great exercise and erlang doesn't have that kind of 
template engine at the moment as far as I know.

> I would like to suggest that the OTP team release it. It doesn't have 
> to be perfect. When parsing html, there is no such thing as perfect.
> There is also the yaws_html module, which I admit that I've never used.

Decent HTML parser would be great. I'm currently maintaining an 
application that allows users to use normal HTML syntax to format the 
content they send to the service. HTML parser is used to do some cleanup 
and possibly modify the content a bit before it is stored into database. 
Xmerl html support sounds really promising. Allready using xmerl to 
parse XML in my erlang applications so this would remove the need for 
external module for parsing HTML.

I have to try to rewrite my HTML cleanup code using the yaws_html module 
while waiting the xmerl html parser. The rest of the application is easy 
to rewrite using erlang so I might be able to get rid of PHP. Once this 
is done I could get the new erlang version accepted and running in 
production and eventually everyone would win. PHP isn't a good choice if 
the application is run on several machines and every machine must be 
able to communicate with others.



More information about the erlang-questions mailing list